Professional Documents
Culture Documents
Combinational Circuits
Objectives
• Introduction
• Analysis arrangement
• Half Adder/Full Adder
• Half Subtractor/Full Subtractor
• BCD to Excess-3 Converter
Step 2
• Mark it’s input and output
• Get the function on each starting gate with the nearest
gate to the input follows to the output
• Draw TT
• Get the function of the circuit – Half Adder
Combinational Gates – Design
Arrangement
Design arrangement
1. What is the problem
Example: Build a full adder which can add two bit.
2. Determine and mark input and output for the circuit
Example: Two input and two output is mark as below:
3. Draw TT
Combinational Gates – Half
Adder
Design arrangement
4. Get simplest Boolean function. Use K-Map
Think of
Z as a
carry in
• Truth Table
Answer either positive or negative
Negative answer is represented by borrow (B) from the next
MSB bit
Output B and D, can also be represented by two’s complement
Combinational Gates – Half
Subtractor
• From TT
• Circuit
Combinational Gates – Full
Subtractor
• Subtraction of two binary numbers need three input
Full subtractor
• K-map
Combinational Gates – Full
Subtractor
• Other method, use algebra manipulation
Combinational Gates – Full
Subtractor
With that formula, we get
e= A’CD’ + B’C’D’
A
C
F2
?
Function may be expressed as:
B
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 ABC
A A+B+C
B AB'C'+A'BC'+A'B'C
C
A
B (A’+B’)(A’+C’)(B’+C’)
A
F2
C
F1=AB'C'+A'BC'+A'B'C+ABC
B F2=AB+AC+BC
AB+AC+BC
C
Analysis Procedure
Truth Table Approach
A =0
0 0
B =0
F1 A B C F1 F2
C =0
0 0 0 0 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
B =0 1 A B C F1 F2
F1
C =1
0 0 0 0 0
A =0 1
B =0 1 0 0 1 1 0
C =1
1
A =0 0
B =0
A =0 0 0
F2
C =1
B =0 0
C =1
Analysis Procedure
Truth Table Approach
A =0 0
B =1 1 A B C F1 F2
F1
C =0
0 0 0 0 0
A =0 1
B =1 1 0 0 1 1 0
C =0
1 0 1 0 1 0
A =0 0
B =1
A =0 0 0
F2
C =0
B =1 0
C =0
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
B =1 0 0 0 1 1 0
C =1
0 0 1 0 1 0
A =0 0 0 1 1 0 1
B =1
A =0 0 1
F2
C =1
B =1 1
C =1
Analysis Procedure
Truth Table Approach
A =1 0
B =0 1 A B C F1 F2
F1
C =0
0 0 0 0 0
A =1 1
B =0 1 0 0 1 1 0
C =0
1 0 1 0 1 0
A =1 0 0 1 1 0 1
B =0
1 0 0 1 0
A =1 0 0
F2
C =0
B =0 0
C =0
Analysis Procedure
Truth Table Approach
A =1 0
B =0 0 A B C F1 F2
F1
C =1
0 0 0 0 0
A =1 1
B =0 0 0 0 1 1 0
C =1
0 0 1 0 1 0
A =1 0 0 1 1 0 1
B =0
1 0 0 1 0
A =1 1 1
C =1
F2 1 0 1 0 1
B =0 0
C =1
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
B =1 0 0 0 1 1 0
C =0
0 0 1 0 1 0
A =1 1 0 1 1 0 1
B =1
1 0 0 1 0
A =1 0 1
C =0
F2 1 0 1 0 1
1 1 0 0 1
B =1 0
C =0
Analysis Procedure
Truth Table Approach
A =1 1
B =1 1 A B C F1 F2
F1
C =1
0 0 0 0 0
A =1 1
B =1 0 0 0 1 1 0
C =1
0 0 1 0 1 0
A =1 1 0 1 1 0 1
B =1
1 0 0 1 0
A =1 1 1
C =1
F2 1 0 1 0 1
1 1 0 0 1
B =1 1
C =1 1 1 1 1 1
F1=AB'C'+A'BC'+A'B'C+ABC B B
0 1 0 1 0 0 1 0
A 1 0 1 0 A 0 1 1 1
C C F =AB+AC+BC
Digital Logic Design
Combinational Circuits with MSI
Objectives
• Binary Parallel Adder
• BCD Adder
• Magnitude Comparator
• Design of 4-bit magnitude comparator
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!
• How many functions to optimize? 5 functions
Binary Parallel Adder
To add n-bit numbers:
• Use n Full-Adders in parallel
• The carries propagates as in addition by hand
• Use Z in the circuit as a Cin
1 0 0 0
0101
0110
1011
Binary Parallel Adder
To add n-bit numbers:
• Use n Full-Adders in parallel
• The carries propagates as in addition by hand
S = A + ( -B)
Adder/Subtractor
How to build a circuit that performs both
addition and subtraction?
Adder/Subtractor
0 : Add
1: subtract
F
Z1Z0
Z3Z2 00 01 11 10
00 0 0 0 0
01 0 0 0 0
11 1 1 1 1
10 0 0 1 1
F = Z3Z2 + Z3Z1 + CO
Adding two BCD numbers –
Circuit
B3 B2B1B0 A3A2A1A0
Correction
Step 4-bit Binary
Adder
S3 S2 S1 S0
Adding two BCD numbers -
Steps
The two 4-bit BCD inputs are added by the 4-bit binary
adder to produce the sum Z3Z2Z1Z0 and a Carry Out
(Cout)
When Cout =0, the correction step executes by adding 0000
to Z3Z2Z1Z0, and the output remains the same
When Cout =1, the correction step adds 0110 to Z3Z2Z1Z0
to generate the corrected output
The output carry is the same as Cout
If additional decimal digits need to be added, the BCD adder
can be cascaded, with the output carry of one phase
connected to the input of the other
Binary Multiplication
Similar to decimal multiplication
Multiplying 2 bits will generate a 1 if both bits are equal to 1, and
will be 0 otherwise. Resembles an AND operation
Multiplying two 2-bit numbers is done as follows:
B1 B0
x A1 A0
----------------
This operation is an
A0B1 A0B0 addition, requires an
A1B1 A1B0 + ADDER
----------------------------------
C3 C2 C1 C0
Binary Multiplication
Therefore, for multiplying two 2-bit numbers, AND
gates and ADDERS will be sufficient
Half Adders
Magnitude Comparator
Definition: A magnitude comparator is a combinational circuit that compares
two numbers A & B to determine whether:
A > B, or
A = B, or
A<B n-bit input n-bit magnitude GT
A comparator
Inputs
First n-bit number A
EQ
Second n-bit number B
n-bit input
Outputs B LE
3 output signals (GT, EQ, LT), where:
GT = 1 IFF A > B
EQ = 1 IFF A = B
LT = 1 IFF A < B
Note: Exactly One of these 3 outputs equals 1, while the other 2 outputs are
0`s
Example 1: Magnitude Comparator (4-bit)
A = B, or EQ
4-bit input
A<B
B LE
Example 1: Magnitude Comparator (4-bit)
Solution:
Inputs: 8-bits (A = 4-bits , B = 4-bits)
A and B are two 4-bit numbers 4-bit input 4-bit magnitude GT
Let A = A3A2A1A0 , and A comparator
Let B = B3B2B1B0 EQ
4-bit input
Inputs have 28 (256) possible
B
combinations (size of truth table LE
and K-map?)
Not easy to design using conventional
techniques
The circuit possesses certain amount of regularity
⇒ can be designed algorithmically.
Example 1: Magnitude Comparator (4-bit)
Designing EQ:
GT = 1 if A > B:
• If A3 > B3 A3 = 1 and B3 = 0
• If A3 = B3 and A2 > B2
• If A3 = B3 and A2 = B2 and A1 > A1
• If A3 = B3 and A2 = B2 and A1 = B1 and A0 > B0
Therefore,
GT = A3B3‘ + X3 A2 B2‘ + X3 X2 A1 B1‘ + X3 X2 X1A0 B0‘
Similarly, LT = A3’B3 + X3 A2‘B2 + X3 X2 A1’B1 + X3 X2 X1A0’ B0
Example 1: Magnitude Comparator (4-bit)
EQ = X3 X2 X1 X0
GT = A3B3’
+ X3A2B2’
+ X3X2A1B1’
+ X3X2X1A0B0’
LT = B3A3’
+ X3B2A2’
+ X3X2B1A1’
+ X3X2X1B0A0’