Combinational Circuit
Combinational Circuit
Organization
Digital Logic
Ver. 1.1
Chapter 1, 2, 3 by Berger
Chapter 3 by Null
2
Logical Gates
• The Gate is the basic element of all digital systems
– Three types of gates form the “atomic” elements
A
C is TRUE if and only if (A is TRUE AND
AND C C = A·B
B B is TRUE)
A
OR C C=A+ B C is TRUE iff (A is TRUE OR B is TRUE)
B
NEGATION SYMBOL
3
A B AB A+B ~A
Notation 0 0 0 0 1
0 1 0 1 1
1 0 0 1 0
1 1 1 1 0
A
AND C C = A·B C = AB; C = A⌃ B; C = A & B
B
A
OR C C=A+ B C = A⌄ B; C = A | B
B
NEGATION SYMBOL
4
When you open your computer box, what
do you see?
Integrated Circuits
• Integrated Circuits (IC) are built from gates
6
Circuit Packages
• (a) is a Dual Inline Package (DIP). A popular format for 40 years for low
and medium level of integration. Used in the 7400/5400 series of
Transistor-Transistor Logic (TTL) devices.
• Memory is often in SIP (Single Inline Package).
• (b) is a through-hole package with more leads than a DIP. Used for higher
level integration.
• (c ) is a surface mount device. Trickier to solder, but more robust and
compact. 7
NAND Gate Example
A B ~(AB)
0 0 1 PIN 1
0 1 1
1 0 1
1 1 0
To 0 V
(Ground)
Pin 1
Pin 7
on/off switch
A B C
+
C = A AND B
Battery Symbol
- Light bulb (load)
A
AND C C = A·B 9
B
Positive and negative logic
B
C
A
A· B C= A· B + A ·B
B
C=A + B
Physical Connection
F=A A F
NOT A F or 0 1
1 0
F = A’
A B F
A 0 0 1
NAND F F = AB 0 1 1
B 1 0 1
1 1 0
A B F
A 0 0 1
NOR F F=A+B 0 1 0
B 1 0 0
1 1 0
A B F
A 0 0 0
XOR F F=A B 0 1 1
B 1 0 1
1 1 0 12
Boolean Arithmetic is different
Same
• Commutative Different
AB = BA; A+B = B+A • Inverse
• Associative A*(~A) = 0 = False
(AB)C = A(BC) A+(~A) = 1 =True
(A+B)+C = A+(B+C) • AA = A; A+A = A
• Identity • Distributive!
A+0=A; A*1=A A+(BC) = (A+B)(A+C)
• Distributive • No precedence of AND over
A(B+C) = (AB) + (AC) OR!
Basic Identities of Boolean Algebra
Basic Postulates
A•B=B•A A+B=B+A Commutative Laws
A • (B + C) = (A • B) + (A • C) A + (B • C) = (A + B) • (A + C) Distributive Laws
1•A=A 0+A=A Identity Elements
A• A =0 A+ A =1 Inverse Elements
Other Identities
0•A=0 1+A=1
A•A=A A+A=A
A • (B • C) = (A • B) • C A + (B + C) = (A + B) + C Associative Laws
A•B= A + B A +B= A• B DeMorgan's Theorem
Mathematical Logic
15
Tautology
16
Dual
17
From Circuit to Boolean Equation
• We can easily interpret the function of a given circuit
A
A· B
B
C
A
(A · B) + (A · B)
A· B
B
C = A + B = A XOR B
18
How to build a circuit with a given logic?
Designing a Digital System
• We can use the concept of a Truth Table as a design tool
A 000
D0
a B
D0
001
D1
D1
C
010
D2
D2
b D3
011
D3
100
D4 D4
101
D5 D5
110
D6 D6
c 111
D7 D7
3 X 8 line decoder
Figure 11.15 Decoder with 3 Inputs and 23 = 8 Outputs
• Suppose that we want to design a digital system, such as the above “line
decoder” (used for line selection)
abc = 000 à D0 =1 abc = 100 à D4 =1
abc = 001 à D1 =1 abc = 101 à D5 =1
abc = 010 à D2= 1 abc = 110 à D6= 1
abc = 011 à D3= 1 abc = 111 à D7= 1
Design a Circuit
• Designing a digital system starts from designing a chip, which consists of a
number of gates (simple or combinational)
• Gates are composed of, Inputs, Outputs and Logic Gates (the three atomic
gates, AND, OR, NOT)
• How to start?
1. Based on the purpose of the system, decide the number of inputs and the
number of outputs (inputs and outputs are binary: on / off)
– Figure out how many bits needed for input and output
2. Draw a truth table for each input combination and output combination
– For example, how many combinations for three bits of input? Derive a Boolean
equation for each output
3. Connect inputs to outputs using logic gates
4. Test if your circuit matches with the design – the logic in truth table
21
Design a 3 x 8 Line Decoder
1. Decide the number of inputs and the number of outputs (inputs and outputs are
binary)
– Three bits for input, eight bits for output
A A 000 D0
D0
B
001
D1 D1
C
010
D2 D2
011
D3
B D3
100
D4 D4
101
D5 D5
110
D6 D6
C 111
D7
D7
23
Design a 3 x 8 Line Decoder
3. Derive a Boolean equation for each output
a b c D0 D1 D2 D3 D4 D5 D6 D7
D0 =
D1 =
D2=
0 0 0 1 0 0 0 0 0 0 0
D3 =
0 0 1 0 1 0 0 0 0 0 0
D4 =
D5 = 0 1 0 0 0 1 0 0 0 0 0
D6 =
D7 =
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
24
Design a 3 x 8 Line Decoder
• Obtain Boolean equation for each output
D0 = ~a ~b ~c
D1 = ~a ~b c
D2 = ~a b ~c
D3 = ~a b c
D4 = a ~b ~c
D5 = a ~b c
D6 = a b ~c (use ~ instead of overbar, easier to type…)
D7 = a b c
25
Design a 3 x 8 Line Decoder
4. Connect inputs to outputs using logic gates
A 000
D0 = ~a ~b ~c D0
B
D1 = ~a ~b c
001
D1
D2 = ~a b ~c
C
D3 = ~a b c 010
D2
D4 = a ~b ~c
D5 = a ~b c 011
D3
D6 = a b ~c
100
D7 = a b c D4
101
D5
110
D6
26
111
D7
Design a 3 x 8 Line Decoder
5. Test! (Use Logisim)
A 000
abc = 000 à D0 =1 D0
abc = 001 à D1 =1 B
100
D4
101
D5
110
D6
27
111
D7
Another Example
1 0 1 1 X = (~A~B~C)+(A~B~C)+(A~B~C)+(A~B~C)+ (A~BC)+(AB~C)
1 1 0 1
X = (~A~B~C)+(A~B~C )+(A~BC)+(A~B~C)+(AB~C)+(A~B~C)
1 1 1 0
30
Karnaugh Maps – 2
• For each output, you have to build one k-map
• For the 3 x 8 line decoder, we need eight k-maps
• Rules for building a Karnaugh Map of a truth table
– Rule 1: # cells = # of possible combinations of input variables
• The number of cells = 2(NUMBER OF INPUT VARIABLES)
• For example,
– 3 input variables: A, B, C = 23 = 8 cells
– 4 input variables: A, B, C, D = 24 = 16 cells
– 5 input variables: A, B, C, D, E = 25 = 32 cells
– Rule 2: The horizontal and vertical axes are labeled such that only one
variable changes from complemented to un-complemented ( or vice
versa) as you go across or down
– The first and last cells in a row or in a column are considered to
be adjacent to each other
31
Karnaugh Maps – 3
K-Map for 3 input variables
K-Map for 4 input variables
AB AB AB AB
AB AB AB AB
CD
C
CD
C
CD
CD
K-Map for 5 input variables
33
Design a 3 x 8 Line Decoder
3. Derive a Boolean equation for each output
a b c D0
K-Map for 3 input variables
0 0 0 1
a b a b ab a b
0 0 1 0
c 1
c 0 1 0 0
0 1 1 0
Focus only one output (D0) at a time
1 0 0 0
1. Fill out the cells which have 1 only
1 0 1 0
(others are zero)
2. Read the cell with 1: D0 = a b c 1 1 0 0
Note: ab is not equal to a b 1 1 1 0
~(ab) = (~a) + (~b)
34
Design a 3 x 8 Line Decoder
• Do it for each output
a b c D1
K-Map for 3 input variables
0 0 0 0
a b a b ab a b
0 0 1 1
c
c 1
0 1 0 0
0 1 1 0
D1 = ~a ~b c
1 0 0 0
1 0 1 0
(I will use ~ instead of )
1 1 0 0
1 1 1 0
35
K-Map Examples
AB AB AB AB
CD 1 1 1
CD 1
CD 1
AB AB AB AB
CD 1 1
This K-Map first appears to have two loops. The diagonal are not
adjacent,
but by first rotating the map around the vertical axis and then around
CD a
horizontal axis, we can cluster the four terms into a single 2 by 2
CD loop.
36
K-Map Examples – 2
AB AB AB AB
CD 1 1 1 1 This K-Map can really be simplified.
X = ~C
CD 1 1 1 1
CD
CD
AB AB AB AB
CD 1 1 1 1 Here we have two loops. The blue loop wraps around the top and
bottom edges, enclosing 8 terms, and the red loop encloses one column
of 4 terms. The equation is
CD 1
X = ~D + ~A*B
CD 1
CD 1 1 1 1
37
Simplification using K-Map
A B C x
AB AB AB AB
0 0 0 1 C 1 1 1
0 0 1 0 C 1
0 1 0 0
0 1 1 0
1 0 0 1 x = B*C + A*B + A*C
1 0 1 1 Simplified equation
1 1 0 1
1 1 1 0
Designing the Hardware
A *A B *B C *C
B*C
AND
x = B*C + A*B + A*C
A*B
OR
AND X
A*C
AND
Prove Algebraically
Step 1: x = A*B*C + A*B*C + A*B*C + A*B*C //From Truth Table
Step 2: x = A*B*C + A*B*C + A*B(C + C) // First Law of Distribution
Step 3: x = A*B*C + A*B*C + A*B // Law of Complementation
Step 4: x = A*B*C + A(B*C + B) // First Law of Distribution
Step 5: x = A*B*C + A[(B+C)*(B + B)] // Second Law of Distribution
Step 6: x = A*B*C + A(B+C) // Law of Complementation
Step 7: x = A*B*C + A*B + A*C // First Law of Distribution
Step 8: x = B(A*C + A) + A*C // First Law of Distribution
Step 9: x = B[(A+A)*(C + A)] + A*C // Second Law of Distribution
Step 10:x = B(C + A) + A*C // First Law of Distribution
CD
1 x
CD x 1
CD
x 1
• X can be 0 or 1
• Choose so the expression can be as simple as possible.
• What’s the Boolean equation? 43
K-Map with “don’t care” Condition
A B AB AB AB
CD
1
CD
1 1
CD 1 1
CD
0 1
• X can be 0 or 1
• Choose so the expression can be as simple as possible.
• What’s the Boolean equation? 44
Read-Only Memory (ROM)
• Memory that is implemented with combinational circuits
– Combinational circuits are often referred to as “memoryless” circuits because
their output depends only on their current input and no history of prior inputs is
retained
45
Read-Only Memory (ROM)
11.8
47
More Examples of Combinational Circuit
48
Simple Multiplexer (MUX)
• The MUX circuit allows one of two (or more) logical signals to be selected
Multiplexers
(a) Truth table for a full-adder. (b) Logic diagram for a full-
adder. 55
ALU: Arithmetic Logic Units
A 1-bit ALU 56
From 1-bit ALU to 8-bit ALU
Eight 1-bit ALU slices connected to make an 8-bit ALU. The enables and
invert signals are not shown for simplicity.
57
Summary
• Digital computer is a binary system
• Bit, byte, word, long are the examples of data units in a computer
• Gate is a fundamental building block of all digital systems
• Logic gates are expressed with Boolean equation
• K-maps are used to derive Boolean equations from a truth table
• Design a digital system (combinational circuit)
– Draw truth table
– Draw K-maps to derive Boolean equations
– Draw a circuit diagram based on the equations
• Decoder, Multiplexer, ALU, comparators are the examples of digital
systems
58