Professional Documents
Culture Documents
DESIGN
EEE122 A
Ref. Morris MANO & Michael D. CILETTI
DIGITAL DESIGN 4th edition
Digital Calculators
Computer systems
Robot system
Measurement devices
Telecommunication systems
Control circuits
Controllers
Number Systems
Binary Numbers
Decimal
It is composed as
combination of two
digits (0 and 1). The
first few counting in
binary is shown in
the table besides
decimal numbers for
comparison.
Binary
10
11
100
101
110
111
1000
1001
10
1010
11
1011
25
24
23
22
21
20
2-1
32
16
2-2
0.25
2-3
0.125
2-4
0.0625
2-5
0.03125
2-6
0.01562
5
Binary-to-Decimal Conversion
26
25
24
23
22
21
20
bin
10101002
= 26 + 0 + 24 +0+ 22 +0+0
= 64 + 16 + 4
= 84
Binary-to-Decimal Conversion
2-1
2-2
2-3
24
bin
0.1101
Decimal-to-Binary Conversion
(two methods)
1: Sum-of-weights method
To get the binary number for a given
decimal number, find the binary weights
that add up to the decimal number.
ex: convert 1210 , 2510 , 5810 , 8210 to binary
12
25
58
82
=
=
=
=
Decimal-to-Binary Conversion
2: Repeated
division-by-2
method
To get the binary
number for a given
decimal number,
divide the decimal
number by 2 until
the quotient is 0.
Remainders form
the binary number.
4110 = 1010012
remainder
41/2 = 20
20/2 = 10
10/2 = 5
5/2
= 2
2/2
= 1
1/2
= 0
LSB
MSB
Decimal-to-Binary Conversion
Repeated multiplication by 2
Repeated Multiplication by 2
0.3125 x 2 =
0.625
0.625 x 2 =
1.25
0.25 x 2 =
0.50
0
LSB
0.50 x 2 =
Continue to the desired number of
decimal places or stop when the
fractional part is all zero
1.00
0.312510 = 0.01012
Hexadecimal Numbers
Decimal
Binary
Hexadecimal
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
10
1010
11
1011
12
1100
13
1101
14
1110
15
1111
Hexadecimal Numbers
Hexadecimal Numbers
Bin-to-Hex Conversion
Simply break the binary number into 4-bit groups, starting
at the right-most bit and replace each 4-bit group with the
equivalent hex symbol.
(a) 1100101001010111
1100101001010111
= CA5716
(b) 111111000101101001
00111111000101101001
= 3F16916
Hexadecimal Numbers
Hex-to-Bin Conversion
Reverse the process (of bin-to-hex) and
replace each hex symbol with its
equivalent four bits.
ex: Determine the binary numbers for the following hex
numbers:
(a) 10A4h
1
0
A
0001000010100100
(b) CF8Eh
C
F
8
1100111110001110
(c) 9742h
9
7
4
1001011101000010
Hexadecimal Numbers
Hex-to-Dec Conversion
2 methods:
Hex-to-Bin first and then Bin-to-Dec.
Multiply the decimal values of each hex
digits by its weight and then take the sum
of these products.
Hexadecimal Numbers
Hex-to-Dec Conversion
Hex-to-Bin first and then Bin-to-Dec
ex: Convert the following hex numbers to decimal:
(a) 1Ch
1Ch = 00011100 = 16+8+4 = 2810
(b) A85h
A85h = 101010000101 = 2048+512+128+4+1 = 269310
Hexadecimal Numbers
Hex-to-Dec Conversion
Multiply the decimal values of each hex digits by its
weight and then take the sum of these products.
ex: Convert the following hex numbers to decimal:
(a) E5h
E5h = (Ex16)+(5x1) = (14x16)+5 = 224+5 = 22910
(b) B2F8h
B2F8h = (Bx4096)+(2x256)+(Fx16)+(8x1)
= (11x4096)+(2x256)+(15x16)+(8x1)
= 45,056+512+240+8 = 45,81610
Hexadecimal Numbers
Dec-to-Hex conversion
Repeated division of a dec number by
16
0.625x16 = 10 = A
0.5x16
=8
0.125x16 = 2
=8
=2
LSD
Hence 65010 = 28A h
MSD
Octal Numbers
Octal Numbers
The conversion to/from other bases follow the same rules
as the hexadecimal ones, examples:
Bin-to-Oct Conversion
(a) 101110101
(b) 1011011001
Grouped into 3 digits and write the equivalent octal number
(a) 101110101
(b) 1011011001
(565)8
(1331)8
Oct-to-Bin Conversion
(a) 138
(b) 258
(c) 75268
(a) 011011 (b) 010101 (c) 111101010110
Oct-to-Dec Conversion
(a) 23748 = 2x83 +3x82 +7x81 + 4x80
=1024+192+56+4=(1276)10
Dec-to-Oct Conversion
(a) 35910 =(447)8
Remainder
359/8
44
7 LSB
44/8
4/8
MSB
Binary Addition
11
+11
110
3
+3
6
111
+ 11
1010
7
+3
10
110
+100
1010
6
+4
10
Binary Subtraction
11
-01
10
=
=
=
=
3
-1
2
0
0
1
1 ; 0-1 with a borrow of 1
11
-10
01
3
-2
1
101
-011
010
5
-3
2
Binary Multiplication
11
x11
11
+11
1001
101
x111
101
101
+101
100011
Binary Division
11
10 110
10
10
10
00
1s and 2s Complements
1s
Radix Complement:
2s
1 1 1 0 0 1 0 1
1s complement
0 0 0 1 1 0 1 0