Chapter 1
Chapter 1
Numbers
EE 200
Digital Logic Circuit Design
Dr. Abdulaziz Tabbakh
1 0001 01 1 9 1001 11 9
2 0010 02 2 10 1010 12 A
3 0011 03 3 11 1011 13 B
4 0100 04 4 12 1100 14 C
5 0101 05 5 13 1101 15 D
6 0110 06 6 14 1110 16 E
7 0111 07 7 15 1111 17 F
stop when
37 = 100101 quotient is zero
EE 200– Digital Logic Circuit Design – KFUPM slide 32
Another Procedure for Converting from
Decimal to Binary
Start with a binary representation of all 0’s
Determine the highest possible power of two that is less
or equal to the number.
Put a 1 in the bit position corresponding to the highest
power of two found above.
Subtract the highest power of two found above from the
number.
Repeat the process for the remaining number
M1023. swf
M1021. swf
d = hexadecimal digit
Examples:
(1234)16 = (1 163) + (2 162) + (3 161) + (4 160) =
(4,660) 10
(3BA4)16 = (3 163) + (11 * 162) + (10 161) + (4 160) =
(15,268)10
stop when
quotient is zero
(422)10 = (1A6)16
EE 200– Digital Logic Circuit Design – KFUPM slide 40
Converting Fractions
Assume that XB has n digits, XB = (0.b-1 b-2 b-3…….b-n)B
Assume that XA has m digits, XA = (0.a-1 a-2 a-3…….a-m)A
carry: 1
0 0 0 0 0 1 0 0 (4)
+ 0 0 0 0 0 1 1 1 (7)
0 0 0 0 1 0 1 1 (11)
bit position: 7 6 5 4 3 2 1 0
21 / 16 = 1, remainder 5
Example:
9’s complement of 4345 is 9999 – 4345 = 5654.
9’s complement of 00123 is 99999 – 00123 = 99876.
EE 200– Digital Logic Circuit Design – KFUPM slide 50
(r-1)’s Complement
For a binary number, r=2 and (r – 1)=1
(r –1)’s complement is (1)’s complement
The 1’s complement for a given binary number N with n-
digits is
(2n – 1) – N
Note that 1 – 0= 1, 1 – 1=0 (10), (01)
Example:
1’s complement of 101101 is 111111 – 101101= 010010
1’s complement of 10111 is 11111 – 10111 = 01000
For octal and hexadecimal, subtract from 7 and F
respectively.
EE 200– Digital Logic Circuit Design – KFUPM slide 51
Radix Complement (r)
The r’s complement of an n-digit number N in base r is
defined as:
rn – N, for N≠ 0, and 0 for N=0
r’s complement = (r+1)’s complement + 1
Example:
10’s complement of 8921 is 9999 – 8921+1 = 1079
10’s complement of 01201 is 99999 – 01201+1 = 98799
2’s complement of 10011 is 11111 – 10011 + 1 = 01101
2’s complement of 01011 is 11111 – 01011 + 1 = 10101
1
M 9326
N (10)’s complement +2437
11763
Discard the end carry –1 0 0 0 0
1763
11
M 6657
N (10)’s complement +1892
08549
1
M 11010
N (2)’s complement +01001
100011
Discard the end carry –1 0 0 0 0 0
00011
11
M 10001
N (2)’s complement +00011
010100
M 11010
N (1)’s complement +01000
100010
End-around carry – 1
00011
M 10001
N (1)’s complement +00010
010011
+8 01000 -8 11000
+3 00011 -3 11101
+11 01011 -11 110101
-8 11000 +8 01000
+3 00011 -3 11101
-5 11011 +5 100101
𝐴−𝐵
(±𝐴) − +𝐵 = ±𝐴 + −𝐵
±𝐴 − −𝐵 = ±𝐴 + (+𝐵)