Homework - Binary Numbers and Coding Systems

BINARY 2^(N-1)
0000 0000 0001 1
0000 0000 0010 2
0000 0000 0100 4
0000 0000 1000 8

0000 0001 0000 16
0000 0010 0000 32
0000 0100 0000 64
0000 1000 0000 128

0001 0000 0000 256
0010 0000 0000 512
0100 0000 0000 1024
1000 0000 0000 2048


1- Decimal to Binary

(a) 187

= 128 + 32 + 16 + 8 +2 +1 =

+0000 1000 0000
+0000 0010 0000
+0000 0001 0000
+0000 0000 1000
+0000 0000 0010
+0000 0000 0001 = 0000 1011 1011

(b) 1023 = 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 0001 1111 1111

(c) 512 = 0010 0000 0000


2- Decimal to Hexadecimal

BIN DEC HEX
0001 1 1
0010 2 2
0011 3 3
0100 4 4
0101 5 5
0110 6 6
0111 7 7
1000 8 8
1001 9 9
1010 10 A
1011 11 B
1100 12 C
1101 13 D
1110 14 E
1111 15 F

(a) 334 = 256 + 64 + 8 + 4 + 2 = 0001  0100  1110 (bin) = 1 4 E (hex)

(b) 1024 = 0100 0000 0000 (bin) = 400 (hex)

(c) 99 = 64 + 32 + 3 = 0000 0110 0011 (bin) = 63 (hex)


3- Hexadeccimal to Binary

(a) 1A9 (hex) = 0001 1010 1001 (bin)

(b) 99 (hex) = 0000 1001 1001 (bin)

(c) 2C8F (hex) = 0010 1100 1000 1111 (bin)


4- Addition of Binary numbers

    0001 1001 1101
+ 0001 0001 0100

  0010 1011 0001


5- Addition of Hex numbers

1A56 + A273 =
0001 1010 0101 0110
1010 0010 0111 0011
1011 1100 1100 0101
BCC9(hex)

6- 2's Compliment Aritmetic

 

7-Truth Table for Logic Gates