Thursday 15 November 2012

Computer Logic (part.2)

Where we were last time :
So there is the BINARY and the DECIMAL
So lets say we want to convert from binary to decimal
and
from decimal to binary



Binary to Decimal

We have the number 1001 base 2

8 4 2 1
1 0 0 1
8+1=9
1001 base 2 - 9 base 10

Decimal to Binary

9 base 10

8 4 2 1
1 0 0 1
9 base 10 - 1001 base 2

There is hexadecimal too !
It's base is 16
It has 15 numbers but with a difference -
1
2
3
4
5
6
7
8
9
10-A
11-B
12-C
13-D
14-E
15-F

Convert Binary to Hexadecimal 


011010 base 2 - 1A base 16
8421  8421
0001  1010
1         8+2=10

Convert Hexadecimal to Binary 

1A base 16 - 00011010 base 2

1    A (10)           Working
0001 1010          8 4 2 1
                            0 0 0 1
                                     
                            8 4 2 1
                            1 0 1 0          


Convert Decimal to Hexadecimal

27 base 10 - 1B bas 16
Convert to Binary
16 8 4 2 1
1   1 0  1 1
Convert to hexadecimal 
8 4 2 1   8 4 2 1  
0 0 0 1   1 0 1 1
1             8+2+1=11


Convert Hexadecimal to Decimal

A1 base 16 - 10100001 base 10
Convert to Binary 
A        1
1010    0001
10100001 base 2
Convert to decimal
 128 64 32 16 8 4 2 1
  1     0   1   0  0  0 0 1

A. Converting BINARY TO DECIMAL 
B. Converting DECIMAL TO BINARY 
C.Converting BINARY TO HEXADECIMAL
D.Converting HEXADECIMAL TO BINARY
E.Converting DECIMAL TO HEXADECIMAL
F.Converting HEXADECIMAL TO DECIMAL

Representations of Characters 

Besides numbers, characters are also used in everyday life to express information. This means that characters also have to be represented in binary using a unique binary code. This is called the character code.

ASCII 
ASCII ( American Standard Code for Information Interchange) is an 8-bit code used to represent characters in binary.

Unicode 
Unicode by using 16 bits to represent each character. These 16 bit binary numbers allow 2 base 16 different combinations to be represented, which gives us a system that can encode up to 65,535 different characters. For the moment at least, this system should suit purposes.

Analogue and Digital data

Analogue - An analogue device is one in which data is represented by some quantity which is continuously changing.


Digital Data - Digital data is a device that shows data at discrete intervals.





Modem (MODulator - DEModulator)

To convert between the analogue signals used in telephone cables and digital signals used by a computer

Sound Card
A sound card is needed to output for music or speech from programs.

Network Card
A network card lets computer communicate with other computers that are networked together.









No comments:

Post a Comment