LOGIC AND
SEQUENTIAL
CIRCUIT DESIGN
Spring 2024
Chapter 4 – COMBINATIONAL
LOGIC
2
Combinational Circuits
• Two classes of logic circuits:
• Combinational Circuits
• Sequential Circuits
• A Combinational circuit consists of logic gates
• Output depends only on input
• A Sequential circuit consists of logic gates and memory
• Output depends on current inputs and previous ones (stored in
memory)
• Memory defines the state of the circuit.
Combinational Circuits
• Output is function of input only i.e. no feedback
Combinational m outputs
n inputs •
•
•
•
• Circuits •
When input changes, output may change (after a delay)
Classification of Combinational Logic
• Arithmetic & logical functions (adder, subtractor,
comparator)
• Data transmission(decoder, encoder, multiplexer, de-
multiplexer)
• Code converters( BCD, grey code,7-segment)
Combinational Circuits
• Analysis A
B
F1
?
• Given a circuit, find out its function
C
A
B
C
A
• Function may be expressed as:
B
A
C
B
F2
?
C
• Boolean function
• Truth table
• Design
• Given a desired function, determine its circuit
• Function may be expressed as:
• Boolean function
• Truth table ?
Analysis Procedure
• Boolean Expression Approach
A
B
F1
C T2=ABC
A T1=A+B+C T3=AB'C'+A'BC'+A'B'C
B
C
A F’2=(A’+B’)(A’+C’)(B’+C’)
B
A
F2
C
F2=AB+AC+BC
B
C F1=AB'C'+A'BC'+A'B'C+ABC
F2=AB+AC+BC
Analysis Procedure
• Truth Table Approach
A =0 0 A B C F1 F2
B =0 0
F1 0 0 0 0 0
C =0
A =0 0
B =0 0
C =0
1
A =0 0
B =0
A =0 0 0
F2
C =0
B =0 0
C =0
Analysis Procedure
• Truth Table Approach
A =0 0
1 A B C F1 F2
B =0
F1 0 0 0 0 0
C =1
A =0 1 0 0 1 1 0
B =0 1
C =1
0 1
A =0
B =0
A =0 0 0
F2
C =1
B =0 0
C =1
F1=AB'C'+A'BC'+A'B'C+ABC
F2=AB+AC+BC
Analysis Procedure
• Truth Table Approach
A =0 0
1 A B C F1 F2
B =1
F1 0 0 0 0 0
C =0
A =0 1 0 0 1 1 0
B =1 1
0 1 0 1 0
C =0
0 1
A =0
B =1
A =0 0 0
F2
C =0
B =1 0
C
=0
F1=AB'C'+A'BC'+A'B'C+ABC
F2=AB+AC+BC
Analysis Procedure
• Truth Table Approach
A =0 0
B =1 0 A B C F1 F2
F1
C =1 0 0 0 0 0
A =0 1 0 0 1 1 0
B =1 0
C =1 0 1 0 1 0
0
A =0 0 0 1 1 0 1
B =1
A =0 0 1
F2
C =1
B =1 1
C =1
F1=AB'C'+A'BC'+A'B'C+ABC
F2=AB+AC+BC
Analysis Procedure
• Truth Table Approach
A =1 0 A B C F1 F2
B =0 1
F1 0 0 0 0 0
C =0
A =1 1 0 0 1 1 0
B =0 1
0 1 0 1 0
C =0
1 0 1 1 0 1
A =1 0
B =0 1 0 0 1 0
A =1 0 0
F2
C =0
B =0 0
C
=0
F1=AB'C'+A'BC'+A'B'C+ABC
F2=AB+AC+BC
Analysis Procedure
• Truth Table Approach
A =1 0 F1 F2
B =0 0 A B C
F1
C =1 0 0 0 0 0
A =1 1 0 0 1 1 0
B =0 0
C =1 0 1 0 1 0
0
A =1 0 0 1 1 0 1
B =0 1 0 0 1 0
A =1 1 1 1 0 1 0 1
F2
C =1
B =0 0
C
=1
F1=AB'C'+A'BC'+A'B'C+ABC
F2=AB+AC+BC
Analysis Procedure
• Truth Table Approach
A =1 0
B =1 0 A B C F1 F2
F1
C =0 0 0 0 0 0
A =1 1 0 0 1 1 0
B =1 0
C =0 0 1 0 1 0
0
A =1 1 0 1 1 0 1
B =1 1 0 0 1 0
A =1 0 1
F2
1 0 1 0 1
C =0
1 1 0 0 1
B =1 0
C
=0
F1=AB'C'+A'BC'+A'B'C+ABC
F2=AB+AC+BC
Analysis Procedure
• Truth Table Approach
A B C F1 F2
0 0 0 0 0
A =1 1 1 0 0 1 1 0
B =1
F1 0 1 0 1 0
C =1
A =1 1 0
0 1 1 0 1
B =1
1 0 0 1 0
C =1 0
1 1 0 1 0 1
A =1
B =1 1 1 0 0 1
A =1 1 1 1 1 1 1 1
F2
C =1
B =1 1 B B
C =1
0 1 0 1 0 0 1 0
A 1 0 1 0 A 0 1 1 1
C C
F1=AB'C'+A'BC'+A'B'C+ABC F2=AB+AC+BC
Design Procedure
• Given a problem statement:
• Determine the number of inputs and outputs
• Derive the truth table
• Simplify the Boolean expression for each output
• Produce the required circuit
Example:
Design a circuit to convert a Binary coded Decimal
“BCD” code to “Excess 3” code
➢ 4-bits ➢ 4-bits
➢ 0-9 values
? ➢ Value+3
Design Procedure
• BCD-to-Excess 3 Converter
A B C D w x y z C C
0 0 0 0 0 0 1 1 1 1 1
0 0 0 1 0 1 0 0 1 1 1 1
0 0 1 0 0 1 0 1 x x x x
B x x x x
B
0 0 1 1 0 1 1 0 A 1 1 x x
A 1 x x
0 1 0 0 0 1 1 1 D D
0 1 0 1 1 0 0 0
0 1 1 0 1 0 0 1 w = A+BC+BD x = B’C+B’D+BC’D’
0 1 1 1 1 0 1 0
1 0 0 0 1 0 1 1 C C
1 0 0 1 1 1 0 0 1 1 1 1
1 0 1 0 x x x x 1 1 1 1
1 0 1 1 x x x x x x x x
B x x x x
B
1 1 0 0 x x x x A 1 x x
A 1 x x
1 1 0 1 x x x x D D
1 1 1 0 x x x x
1 1 1 1 x x x x y = C’D’+CD z = D’
Design Procedure
• BCD-to-Excess 3 Converter
A B C D w x y z
0 0 0 0 0 0 1 1 A
w
0 0 0 1 0 1 0 0
0 0 1 0 0 1 0 1
0 0 1 1 0 1 1 0
0 1 0 0 0 1 1 1
0 1 0 1 1 0 0 0 x
B
0 1 1 0 1 0 0 1
0 1 1 1 1 0 1 0
1 0 0 0 1 0 1 1
1 0 0 1 1 1 0 0 C y
1 0 1 0 x x x x
1 0 1 1 x x x x
1 1 0 0 x x x x D z
1 1 0 1 x x x x w = A + B(C+D) y = (C+D)’ + CD
1 1 1 0 x x x x
1 1 1 1 x x x x
x = B’(C+D) + B(C+D)’ z = D’
Seven-Segment converter
• Seven-Segment Display
• A seven-segment display is digital readout found in
electronic devices like clocks, TVs, etc.
• Made of seven light-emitting diodes (LED) segments; each
segment is controlled separately.
Seven-Segment converter a
w x y z abcdefg
w a
0 0 0 0 1111110 b
0 0 0 1 0110000 x c f b
d g
0
0
0
0
1
1
0
1
1101101
1111001
y ? e
z f
0 1 0 0 0110011 g e c
0 1 0 1 1011011
0 1 1 0 1011111 BCD code
0 1 1 1 1110000
1 0 0 0 1111111
y d
1 0 0 1 1111011 1 1 1
1 0 1 0 xxxxxxx 1 1 1
x x x x
x
1 0 1 1 xxxxxxx w
1 1 0 0 xxxxxxx 1 1 x x
1 1 0 1 xxxxxxx z
1 1 1 0 xxxxxxx a = w + y + xz + x’z’ b=...
c=...
1 1 1 1 xxxxxxx
d=...
x S
y
HA
C
Binary Adder x
+ y
• Half Adder ───
• Adds 1-bit plus 1-bit C S
• Produces Sum and Carry
x y C S
0 0 0 0
0 1 0 1
1 0 0 1 x S
1 1 1 0
C
y
Binary Adder
x S
y FA
• Full Adder z C
• Adds 1-bit plus 1-bit plus 1-bit
x
• Produces Sum and Carry
+ y
y
x y z C S + z
0 1 0 1
0 0 0 0 0 ───
x 1 0 1 0 C S
0 0 1 0 1
z
0 1 0 0 1 S = xy'z'+x'yz'+x'y'z+xyz = x y z
0 1 1 1 0 y
1 0 0 0 1 0 0 1 0
1 0 1 1 0 x 0 1 1 1
1 1 0 1 0 z
1 1 1 1 1 C = xy + xz + yz
Binary Adder
• Full Adder
S = xy'z'+x'yz'+x'y'z+xyz = x y z
x
y C = xy + xz + yz
z
x
x y x
z S y
x z S
y x
z x
x y
y y y
z x
x z C
y z
y
z x C
z
z
y
z
Full Adder = 2 Half Adders
Manipulating the Equations:
S = ( X Y ) Z
C = XY + XZ + YZ = XY + Z(X Y )
Full Adder – for using Half-adders
Manipulating the Equations:
S = ( X Y ) Z
C = XY + XZ + YZ
= XY + XYZ + XY’Z + X’YZ + XYZ
= XY + XYZ + XY’Z + X’YZ
= XY( 1 + Z) + Z(XY’ + X’Y)
= XY + Z(X Y )
Binary Adder
x3x2x1x0 y3y2y1y0 c3 c2 c1 .
Carry + x3 x2 x1 x0
Propagate + y3 y2 y1 y0
Cy Binary Adder C0 Addition ────────
Cy S3 S2 S1 S0
S3S2S1S0
x3 x2 x1 x0
y3 y2 y1 y0
0
FA FA FA FA
C4 C3 C2 C1
S3 S2 S1 S0
Bigger Adders
• How to build an adder for n-bit numbers?
• Example: 4-Bit Adder
• Inputs ?
• Outputs ?
• What is the size of the truth table?
• How many functions to optimize?
Bigger Adders
• How to build an adder for n-bit numbers?
• Example: 4-Bit Adder
• Inputs ? 9 inputs
• Outputs ? 5 outputs
• What is the size of the truth table? 512 rows! (29 )
• How many functions to optimize? 5 functions (S+ Last Carry)
Binary Adder
1 0 0 0 Carry in
0101
+ 0110
1011
• To add n-bit numbers:
• Use n Full-Adders in Cascade.
• The carries propagates as in addition by hand.
This adder is called ripple carry adder
Binary Subtractor
• Half Subtractor
A logic circuit which is used for subtracting one single
bit binary number from another single bit binary number
is called half subtractor.
Binary Subtractor
• Half Subtractor
INPUT OUTPUT
S.No
A B DIFF BORR
1. 0 0 0 0
2. 0 1 1 1
3. 1 0 1 0
4. 1 1 0 0
Binary Subtractor
• Full Subtractor
The Full subtractor is a combinational circuit which is
used to perform subtraction of three bits.
Binary Subtractor
• Full Subtractor
INPUT OUTPUT
S.No
A B C DIFF BORR
1. 0 0 0 0 0
2. 0 0 1 1 1
3. 0 1 0 1 1
4. 0 1 1 0 1
5. 1 0 0 1 0
6. 1 0 1 0 0
7. 1 1 0 0 0
8. 1 1 1 1 1
Binary Subtractor (Your Practice)
• Derive simplified Boolean expressions for Half
Subtractor and Full Subtractor.
Subtraction (2’s Complement)
• How to build a subtractor using 2’s complement?
Subtraction (2’s Complement)
• How to build a subtractor using 2’s complement?
S = A + ( -B)
Adder/Subtractor
• How to build a circuit that performs both addition and
subtraction?
Adder/Subtractor
0 : Add
1: subtract
Using full adders and XOR we can build an Adder/Subtractor!