Combinational Circuit Design Guide
Combinational Circuit Design Guide
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Example : Design a combinational logic circuit with three inputs , the output is at logic 1
when more than one inputs are at logic 1.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
6.2 Adder
The Basic operation in digital computer is binary addition. The circuit which
perform the addition of binary bits are called as Adder.
The logic circuit which perform the addition of two bit is called Half adder and three bit
is called Full adder.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
The Full Adder can be implement using Two Half Adders and OR gates
Logic Diagram
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
2.3 Subtractor
Subtractor is the logic circuit which is used to subtract two binary number (digit)
and provides Difference and Borrow as a output. In digital electronics we have two
types of subtractor, Half Subtractor and Full Subtractor.
Logic Diagram
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
In practical situations it is required to add two data each containing more than
one bit. Two binary numbers each of n bits can be added by means of a full adder
circuit. Consider the example that two 4-bit binary numbers B 4B 3B 2B 1 and A 4A 3A 2A
1 are to be added with a carry input C 1. This can be done by cascading four full adder
circuits. The least significant bits A 1, B 1, and C 1 are added to the produce sum output
S1 and carry output C 2. Carry output C 2 is then added to the next significant bits A2 and
B2 producing sum output S 2 and carry output C 3. C 3 is then added to A3 and B3 and so
on. Thus finally producing the four-bit sum output S 4S 3S 2S 1 and final carry output
Cout.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
The subtraction operation can be performed using 1’s and 2’s complement addition, so
we can design Full subtractor using Full Adder.
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
The addition and subtraction operations can be perform using a common adder
circuit, where a EX-OR gate is connected in the second input along with the mode
selection bit M. if M=0 the circuit act as a adder, M=1 then substractor. If M=0 then
output of the EX-OR gate is B act as adder, if M=1 then B’ act as a subtractor.
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
The Boolean function for the carry output of each stage can be
From the above functions it can be seen that C 4 does not have to wait for C3 and
C2. All the carries are propagating at the same time.
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
The result 0001 0001 is valid BCD number but it is incorrect. Add 6 to get correct
number.
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
6.6 Decoder
Decoder is a combinational circuit.
2 to 4 Decoder
It has 2 inputs and 22 = 4 outputs.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Circuit Diagram
Truth Table
Logic Diagram
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Truth Table
Logic Diagram
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
3 to 8 Decoder
It has 3 inputs and 23 = 8 outputs.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Logic Diagram
6.7 Encoders
Encoders is a combinational circuit which takes 2N inputs and gives out N outputs, the
enable pin should be kept 1 for enabling the circuit.
4 to 2 Encoder
It has 22 inputs and 2 outputs.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Truth Table
A Priority Encoder works opposite of the decoder circuit. If more than one input is
active, the higher order input has priority.
4 to 2 Priority Encoders
D0-D3 - inputs
A1,A0 – outputs
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Truth Table
K-map simplification
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Logic Diagram
3 to 8 Priority Encoder
Multiplexer is a combinational circuit that selects binary information from one of many
inputs and directs it into single output.
Mutliplexer has 2n inputs, n select line (control input) and one output
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
2 to 1 Multiplexer
Circuit diagram
4 to 1 MUX
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
8 to1 MUX
8 to1 MUX has 23 = 8 inputs, 3 select line and one output
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Each minterm of the function can be mapped to a data input of the multiplexer.
For each row in the truth table, where the output is 1, set the corresponding data input
of the mux to [Link] the remaining inputs of the mux to 0.
F(x,y,z) = Σm(1, 2, 6, 7)
Truth Table
Multiplexer Implementation
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
1-to-2 demultiplexer
has 22 outputs , 2 select lines, one input.
Logic diagram
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
1-to-4 Demultiplexer
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Logic Diagram
1-to-8 Demultiplexer
3-select lines
8-outputs
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Logic Diagram
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
In the above figure, the highest significant bit A of the selection inputs are connected to
the enable inputs such that it is complemented before connecting to one DEMUX and to
the other it is directly [Link] this configuration, when A is set to zero, one of the
output lines from Y0 to Y3 is selected based on the combination of select lines B and C.
Similarly, when A is set to one, based on the select lines one of the output lines from Y4
to Y7 will be selected.
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Numbers are usually coded in one form or another so as to represent or use it as required. For
instance, a number ‘nine’ is coded in decimal using symbol (9)d. Same is coded in natural-
binary as (1001)b. While digital computers all deal with binary numbers, there are situations
wherein natural-binary representation of numbers in in-convenient or in-efficient and some other
(binary) code must be used to process the numbers.
One of these other code is gray-code, in which any two numbers in sequence differ only by one
bit change. This code is used in K-map reduction technique. The advantage is that when
numbers are changing frequently, the logic gates are turning ON and OFF frequently and so are
the transistors switching which characterizes power consumption of the circuit; since only one
bit is changing from number to number, switching is reduced and hence is the power
consumption.
Let’s discuss the conversion of various codes from one form to other.
6.10.1 BINARY-TO-GRAY
The table that follows shows natural-binary numbers (upto 4-bit) and corresponding gray codes.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Looking at gray-code (G3G2G1G0), we find that any two subsequent numbers differ in
only one bit-change.
The same table is used as truth-table for designing a logic circuitry that converts a given
4-bit natural binary number into gray number. For this circuit, B3 B2 B1 B0 are inputs
while G3 G2 G1 G0 are outputs.
And G3 = B3
So that’s a simple three EX-OR gate circuit that converts a 4-bit input binary number
into its equivalent 4-bit gray code. It can be extended to convert more than 4-bit binary
numbers.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
6.10.2 Gray-to-Binary
Truth-table:
And B3 = G3
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
6.11 Comparators
A comparator will evaluate two binary strings and output a 1 if the two strings are
exactly the same.
The Exclusive-NOR (Equality gate) is used to perform the comparison.
One Exclusive-NOR is used per pair of Binary bits and the outputs of all
Exclusive-NORS are ANDed together.
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Expansion inputs are provided on the 7483 so that word sizes larger then 4-bits
may be compared.
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
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
2-bit magnitude comparator
hange E hange E
XC di XC di
F- t F- t
PD
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
PD
or
or
!
!
W
W
O
O
N
N
Y
Y
U
U
B
B
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a