EE200 - DLD - Chapter 01
EE200 - DLD - Chapter 01
Chapter 1
Numbers System
Numbers Numbers
Each number system is associated with a base or radix An1 An2 A1 A0 . A1 A2 Am1 Am
1
21-Oct-13
2
21-Oct-13
Binary = Decimal
3
21-Oct-13
Octal (base-8)
6 39
(1726)8
Hexadecimal (base-16) 6 6 3
(3d6)16 1 0
(0100111)2 = (103)6
8 + 4 + 0 + 1 + 0 + 0.25 = 13.25
4
21-Oct-13
5
21-Oct-13
6
21-Oct-13
7
21-Oct-13
8
21-Oct-13
010001 (17=16+1)
001011 (11=8+2+1)
---------------
011100 (28=16+8+4)
(7.5)10 = (111.10)2 Q3.2 Unsigned arithmetic Signed arithmetic (w/ 2’s complement)
111.10 010001 (17=16+1) 010001 (17=16+1)
10.1 (2.5)10 = (10.1)2 Q2.1 101011 (43=32+8+2+1) 101011 (-21: 2’s complement=010101=21)
11110 (18.75)10 = (10010.110)2 Q5.3 --------------- ---------------
111100 (60=32+16+8+4) 111100 (2’s complement=000100=4, i.e. -4)
00000x
11110xx
10010110
Binary Computation
Unsigned arithmetic
101111 (47)
The carry is 011111 (31)
discarded ---------------
001110 (78?? Due to overflow, note that
78 cannot be represented
by a 6-bit unsigned number)