Chap 1number Systems and Codes
Chap 1number Systems and Codes
Octal 8
4
8
3
8
2
8
1
8
0
Decimal 10
4
10
3
10
2
10
1
10
0
Hexadecimal 16
4
16
3
16
2
16
1
16
0
Conversion of Decimal number to
other number systems
Decimal to Binary Decimal to Octal Decimal to Hex
25 47 79
2 12 1 (LSB) 8 5 7 LSD 16 4 15(F)
2 6 0 8 0 5 16 0 4
2 3 0 MSD
2 1 1
2 0 1 (MSB)
Octal Digit 0 1 2 3 4 5 6 7
Binary
000 001 010 011 100 101 110 111
Equivalent
Conversion of Binary number to Octal
number and vice versa continued
10101110
(403)8 = (100000011)2
010 101 110
2 5 6 (371)8 = (11111001)2
(10101110)2 = (256)8
Octal to binary
Binary to octal
Conversion of Binary number to
Hexadecimal number and vice versa
5 B 7
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
• 1 + 1 + 1 = 11(sum 1 carry 1)
Binary addition continued
1010 10110 10110110 A
+1001 +01111 + 01011100 B
------------ ------------ ------------------
1 1111 111111 carry
------------ ------------ ------------------
10011 1 0 0 1 0 1 1 0 0 0 1 0 0 1 0 result
Binary subtraction
Rules of binary subtraction
A B Difference(A-B) borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Binary subtraction continued
1 10
0 10 0 10 10 0 10 0 0 10 Borrow
59 0101 1001
+ 29 + 0010 1001
------ -----------------------
88 1111 1
-----------------------
1000 0010 right group is invalid
+ 0110 BCD because of carry
----------------
11
-----------------
1000 1000