Logic Design - Unit 1 - v1.6 - 20210915
Logic Design - Unit 1 - v1.6 - 20210915
Logic Design - Unit 1 - v1.6 - 20210915
Fall 2021
Number Systems and Conversions
2
¨ Contents
¤ Digital systems
¤ Number systems and conversion
¤ Binary arithmetic
¤ Representation of negative numbers
n Addition of two’s complement numbers
n Addition of one’s complement numbers
¤ Binary codes
¤ Binary storage and register
¤ Binary register
2 53
2 26 …… remainder = 1 = a0 (LSB)
2 13 …… remainder = 0 = a1
2 6 …… remainder = 1 = a2 5310 = 1101012
2 3 …… remainder = 0 = a3
2 1 …… remainder = 1 = a4
0 …… remainder = 1 = a5 (MSB)
integer fraction
231.34 = 45.7510 = 63.517
Number Systems and Conversions
Conversion between Two Bases (2/2)
11
¨ Convert between binary and octal/hexadecimal by inspection
1. Start at the binary point
2. Divide bits into groups of three/four, adding 0’s if necessary
3. Replace each group by an octal/hexadecimal digit
4. And vice versa
¤ Binary Û octal
1001101.0101112 = 001 001 101 . 010 1112 =115.278
1 1 5 2 7
adding 0’s
¤ Binary Û hexadecimal
1001101.0101112 = 0100 1101 . 0101 11002 =4D.5C16
4 D 5 C
¤ 1+0=1
1111 carries
1310 = 1101
1110 = 1011
11000 = 2410
¤ 1–1=0
1 borrow
2910 = 11101
1910 = 10011
1010 = 1010
¤ 1x0=0
¤ 1x1=1
¤ e.g., multiply 1310 by 1110 in binary
¨ 2’s complement: N* = 2n – N = N_ + 1
¤ Complement +N bit-by-bit and then add 1
¤ Or complement all bits to the left of the rightmost 1
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Number Systems and Conversions
BCD
27
n Feature of BCD
n Example of BCD
n BCD Addition
k-digit decimal requires 4k-bits in BCD !!
BCD carry 1 1
0001 1000 0100 184
+0101 0111 0110 +576
Binary Sum 0111 10000 1010
Add 6 0110 0110
BCD Sum 0111 0110 0000 760
(395)10
= 0110 1100 1000 (in Exceed-3)
= 1001 0011 0111 (9'sc 604)
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110 Binary: 0 bn b3 b2 b1 b0
...
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100 Gray Code: gn g3 g2 g1 g0
...
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
Number Systems and Conversions
Feature of Gray Code
34
Only one bit in the code group changes from one number
to the next !
Only one bit
change !!
For Example 7 Þ 8
4 bit change
¤ 7 bits
¨ Big-5 code
¤ Traditional Chinese characters
94 printable
characters are
numbered 3210 to
12610 in ASCII code
n Error-Detecting Code:
Communication and computation will cause error
n Register
n Register Transfer
keybord
J
O Keyboard
Strike
H Controller
J O H N
N 01001010 01001111 01001000 01001110
Memory Register
Memory Unit
Sum
0000000000
Operand 1 0011100001
Operand 2
0001000010
n Transfer of
Information with 0001000010 R1
Register
Digital logic
circuits for 0100100011 R3
binary addition
0011100001 R2
Processor Unit
Number Systems and Conversions
Binary Logic
46
n Binary Logic
1. 1/0
2. True/False
3. Yes/No
x y=z
AND or x AND y is equal to z
xy=z
Why?
OR x y=z x OR y is equal to z
x'=z
NOT or NOT x is equal to z
x=z
AND OR NOT
x y x y x y x+y x x’
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
Volts
4
Range for Logic 1
3
Transition occurs
between these limits
1
Range for Logic 0
0
Number Systems and Conversions
Binary Logic
51
x Two Input
z=x y
y AND Gate
x Two Input
z=x+y
y OR Gate
NOT Gate or
x x' Inverter
A
3 Input
B F=A B C
C AND Gate
A 3 Input
B G=A+B+C OR Gate
C
54 (To be continued)