IDS Lecture8
IDS Lecture8
Outline
2 Level Gate Implementation
Combinational Design
1
Logic Gates
2
OR Operation
4
OR Gate
6
NAND Gate
Y=A’+B’
A A’
X=(A.B)’ A Y=A’+B’
B B
B’
AND-NOT
NOT-OR
7
NAND Gate or Bubbled OR
A’
A
Y=A’+B’
B
B’
A Y B Y=A’+B’
=
B B
Bubbled OR
Y=(A.B)’ Y=A’+B’
A B W Y A B A’ B’ Y
0 0 0 1 0 0 1 1 1
0 1 0 1 0 1 1 0 1
1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 0 0 0 8
NOR Gate
Y=A’.B’
OR-NOT
A’
A W
X=(A+B)’ A Y=A’.B’
B B
B’
9
NOR Gate or Bubbled AND
A’ Y=A’.B’
A
B
B’
A A
Y = Y
A B
Y =(A+B)’ Y =A’.B’
A B Y A B A’ B’ Y
0 0 1 0 0 1 1 1
0 1 0 0 1 1 0 0
1 0 0 1 0 0 1 0
1 1 0 1 1 0 0 0 10
NAND and NOR Properties
11
NAND and NOR Properties
NAND NOR
X Y Z X Y Z
Disable 0 0 1 Enable 0 0 1
o/p=1 0 1 1 /Inverter 0 1 0
Enable 1 0 1 Disable 1 0 0
/Inverter 1 1 0 o/p=0 1 1 0
6. Unused Inputs:
1. For NAND gate unused inputs is treated as same as in AND gate.
2. For NOR gate unused inputs is treated as same as in OR gate.
12
Exclusive-OR Gate (EX-OR/XOR)
X = AB’ + A’B
X= (A+B).(A’+B’)
B A’.B
Internal circuit:
A Symbols:
X
B
=1
14
XOR and XNOR Properties
15
XOR and XNOR Properties
0
XOR Y=B =
B
Buffer
1
XOR Y=B’ =
B
Inverter 16
XNOR
XOR
Generalized:
A A A ………………n =A,When n is Odd (same for NOR)
=0,When n is Even (1 for NOR)
17
XOR and XNOR Properties
Example:
A B C =A B C (Odd inputs)
For A B C (Prove)
18
NAND as Universal Gates
X=(A.B)’ Y=A’+B’
A A A AB
B
Inverter AND gate
A A
A+B A+B
B B
20
EXOR using NAND Gates
21
EXOR using NAND Gates
22
EXOR using NAND Gates
A A’B (A’B)’
B
Y=AB’
+A’B
A AB’
B
(AB’)’
NOT AND OR
23
EXOR using NAND Gates
(A’B)’ (A’B)’
A A’B (A’B)’
B
Y=AB’
+A’B
A AB’
B
(AB’)’
NOT AND OR 24
EXOR using NAND Gates
A (A’B)’
B
Y=AB’+A’B
A
B
(AB’)’
4 NAND Gates can be reduce to 3
=(AB’)’
=(A’B)’
A
Y=AB+A’B’
EXOR
B
1 NAND Gates
4 NAND Gates
(A + B)’
A A A A+ B
B
Inverter OR gate
A A
AB AB
B B
27
XOR and XNOR using NOR Gate
Y=AB+A’B’
Y=AB’+A’B
NOT
29
Two-level Implementations
Two-level Implementations:
The implementation of a logic expression such that each one of the I/P
has to pass through only two gates to reach the O/P.
30
AND-OR (SOP) Emulation Using NANDs
a) Original SOP (b) Implementation with NANDs
Two-level implementations
Verify:
(a) G = WXY + YZ
G(A,B,C,D) = ((AB)'(CD)')'
= ((AB)')'+((CD)')'
= (AB) + (CD)
32
NOR Implementation
b
G(a,b,c,d)
c
d
G(a,b,c,d) = (a+b)*(c+d)
F (X,Y,Z) = m(0,6)
1. Express F in SOP form:
F = X’Y’Z’ + XYZ’
2. Obtain the AND-OR implementation for F.
3. Add bubbles and inverters to transform AND-OR to NAND-NAND gates.
34
Example (cont.)
35
Two-Level NOR Gate Implementation -
Example
F(X,Y,Z) = m(0,6)
1. Express F’ in SOP form:
1. F’ = m(1,2,3,4,5,7)
= X’Y’Z + X’YZ’ + X’YZ + XY’Z’ + XY’Z + XYZ
2. F’ = XY’ + X’Y + Z
2. Take the complement of F’ to get F in the POS form:
F = (F’)' = (X'+Y)(X+Y')Z'
3. Obtain the OR-AND implementation for F.
4. Add bubbles and inverters to transform OR-AND
implementation to NOR-NOR implementation.
36
Example (cont.)
37
Combinational Logic Circuits
A
B ABC
C X = ABC + DE SOP
D
DE
E
38
Combinational Logic Circuits
A
B ABC
C X = ABC + DE X = ABC + DE AOI
D X = (ABC)(DE) DeMorgan
E DE X = (A + B + C)(D + E) POS
39
General Implementations (Cont.)
Given a two level implementation desired, use the previous
transfromations to get it into one of the below forms. Then
follow the steps to transform the function to the desired form:
For Type: Use:
AND-OR Circle 1's in the K-Map and minimize
(SOP Form) (Also use for NAND-NAND)
AND-NOR Circle 0's in the K-Map and minimize
(SOP complemented)
OR-AND Circle 0's in the K-Map and minimize
(POS Form) SOP. Use DeMorgan's to transform to
POS. (Also use for NOR-NOR)
OR-NAND Circle 1's in the K-Map and minimize
(POS complemented) SOP. Use DeMorgan's to transform to
POS.
40
Implementation Example
Implement the function in NOR-OR.
A 1 1 0 0
B
C 1
1 1 0
A 1 1 0 0 A
C C
F
B
41
Examples
Q.) A Karnaugh map is drawn from a truth table. Read the minimum
SOP expression and draw the circuit.
C C
AB 1
AB 1 1
AB
AB
42
Examples
Circuit: A
C X= AC + AB
A
B
Q.) Convert the above circuit to one that uses only NAND gates.
A
C X= AC + AB
A
B
43
Combinational Logic Circuit
44
Revision of Combinations Design
Logic circuits for digital systems may be either combinational or
sequential.
Specific functions
Adders, subtractors, comparators, decoders, encoders, and
multiplexers
The output at any instant of time, depends only on the levels present at
input terminals.
It does not use any memory. The previous state of input does not have any
effect on the present state of the circuit.
45
Combinational Arithmetic Circuits
1. Addition:
Half Adder (HA).
Full Adder (FA).
Carry Ripple Adders.
Carry Look-Ahead Adders.
2. Subtraction:
Half Subtractor.
Full Subtractor.
Borrow Ripple Subtractors.
Subtraction using adders.
3. Multiplication:
Combinational Array Multipliers.
46
Addition
X Y
Inputs Carry Sum
X Y C S
0 0
0 1
1 0
1 1 S C
47
Binary Half-Adder
AOI Logic
X Half S
Y Adder C-OUT
48
Addition
x y C-in C-out S
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1 X Y
C-out C-in
S 49
Full Adder
X Y
Full
C-out C-in
Adder
S 50
Full Adder
51
Full Adder using AND-OR
52
Full Adder
53
Full Adder using Half Adders
Taking a carry from the next lower order of magnitude, and sending a carry to
the next higher order of magnitude.
54
Full Adder using Half Adders
55
Full Subtractor = full adder, almost
0 0 1 1 1 1 1 0 0 Borrow
X 229 1 1 1 0 0 1 0 1
Y - 46 - 0 0 1 0 1 1 1 0
183 1 0 1 1 0 1 1 1
57
Half Subtractor
Subtracting a single-bit binary value Y from another X (I.e. X -Y ) produces a
difference bit D and a borrow out bit B-out.
This operation is called half subtraction and the circuit to realize it is called a half
subtractor.
X Difference
D
Y
X Half D
Y Subtractor B-OUT B-out
58
Full Subtractor
Subtracting two single-bit binary values, Y, B-in from Difference D X
a single-bit value X produces a difference bit D and
XY
a borrow out B-out bit. This is called full subtraction. B-in 00 01 11 10
0 2 6 4
0 1 1
Full Subtractor Truth Table 1 3 7 5
Inputs Outputs 1 1 1 B-in
X Y B-in D B-out Y
0 0 0 0 0 D = X’Y’(B-in) + XY’(B-in)’ + XY’(B-in)’ + XY(B-in)
D = X Y (B-in)
0 0 1 1 1
0 1 0 1 1 Borrow B-out X
0 1 1 0 1 XY
1 0 0 1 0 B-in 00 01 11 10
0 2 6 4
1 0 1 0 0 0 1
1 1 0 0 0 1 3 7 5
1 1 1 1 B-in
1 1 1 1 1
Y
S(X,Y, C-in) = (1,2,4,7)
B-out = X’Y + X’(B-in) + Y(B-in)
C-out(x, y, C-in) = (1,2,3,7)
59
Full Subtractor Circuit Using AND-OR
X’ X’Y’B-in
X Y’
X X’ B-in
X’
X’YB-in’ Difference D
Y
Y B-in’
Y Y’ X
Y
B-in B-in’ XY’B-in’
B-in B-in’ X
Y
B-in’ XYB-in
X Y X’ X’Y
Y
Full
B-out B-in X’
X’B-in
Subtractor B-out
B-in
Y
D
B-in YB-in
60
Full Subtractor Circuit Using XOR
Y Difference D
X Y B-in
Full X’ X’Y
B-out B-in
Subtractor Y
X’
X’B-in
B-out
D B-in
Y
B-in YB-in
61
End of the Class
62