Beruflich Dokumente
Kultur Dokumente
Unit – 3
Combinational Logic Circuit
Dr. Anand J. Patel
Index
• Introduction
Design procedure of combinational logic
Adder
• Half Adder
• Full Adder
Subtractor
• Half Subtractor
• Full Subtractor
Code Conversion
• BCD – Excess-3 conversion
Introduction
Inputs Output
A B C X X = å (3, 5, 6, 7)
0 0 0 0 0
1 0 0 1 0 X
BC
2 0 1 0 0 A 00 01 11 10
3 0 1 1 1 0 0 0 1 0
4 1 0 0 0 1 0 1 1 1
5 1 0 1 1
6 1 1 0 1
7 1 1 1 1 X = AC + AB + BC
A B C
Adder
• We will start out simply, adding two single digit binary numbers
• Let’s make certain we can do this by hand before we construct the
circuit
• There are four possible combinations of single digit, two number
addition:
0 + 0 =0
0+1=1
1+0=1
1 + 1 = 10
Half Adder (2)
INPUTS OUTPUTS
A B SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Half Adder (3)
• From the truth table we can write the expression for Sum (S) and Carry (C) .
• For Sum (S) and Carry (C) summing the input combinations for which the output
is 1.
S = A’B + AB’
C = AB
• It is seen that the sum can be realized by EX-OR gate and Carry can be realized by
an AND gate.
•
Half Adder Circuit using A-O-I
• It is seen that the sum is realized by using two NOT gate, two AND gate and one
OR gate and Carry is realized by using AND gate.
Half Adder Circuit using NAND gate
• The Half adder circuit is achieved by using five number of NAND gates.
Half Adder Circuit using NOR gate
• The Half adder circuit is achieved by using five number of NOR gates.
Full Adder
• Definition: It adds three binary bits. The two binary bits are inputs(A,B) and one is
previous carry (C in).
• From the block diagram:
• There are three inputs which is indicated by A, B and Cin.
• There are two outputs which is indicated by Sum(S) and Carry (Cout).
Truth table for full adder
INPUTS OUTPUTS
A B CIN COUT S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Simplified expressions
Full-adder:
A B C S Carry
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
Carry= A.C+A.B+B.C
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
S=A.B’.C’ + A’.B’.C+A.B.C+A’.B.C’
Full Adder
• From the truth table we can write the expression for Sum and Carry.
• For sum (S) summing up the input combination for which the output is 1.
S=
• Similarly we can write the expression for Cout
• In this a three input EX-OR gate is used to realize the sum. To realize
carry, three 2 input AND gates and one 3 input OR gate is used.
Full Adder circuit using two Half Adders
• In this circuit two EX-OR gates, two AND gates and one OR is used.
Full Adder circuit using A-O-I
• Two signals come out of the full adder. One is the sum signal S0 and
other is the carry signal C1(Cin).
• Full adder are used to add A1 and B1, A2 and B2 & A3 and B3.
• In this case the carry signal from the previous stage is added .
• Carry from A3 is taken out .
• Thus S3 S2 S1 S0 is the sum and C4 (Cin) is the final carry.
4 bit parallel binary adder-IC 7483
• It has 4-bit binary inputs A3 A2 A1 A0 and B3 B2 B1 B0. There is
also carry input Cin from the previous stage. The output is the sum S3
S2 S1 S0 and the carry is Cout.
AUGEND SUM
DIGITS IN
BINARY
ADDED FORM
DIGITS
Half Subtractor
• In this circuit, one EX-OR gate, one NOT gate and One AND gate are
used.
• Difference is realized with the help of EX-OR gate & borrow is
realized with the help of NOT gate and AND gate.
Half subtractor using A-O-I
• Logic circuit for half subtractor can also be realized using the basic
gates i.e. A-O-I gates.
Full Subtractor
• A full subtractor
can also be realized
by using the
NAND gates only.
4- bit parallel binary subtractor
4- bit parallel binary subtractor
• There are many types of codes used in digital circuits. Many a times it
becomes necessary to convert data from one type of code to another
type of code. So there will be many types of code converters.
BCD to Excess-3 Code Converter Design procedure
1. Table4-2 is a Code-Conversion example, first, we can
list the relation of the BCD and Excess-3 codes in the
truth table.
Karnaugh map
2. For each symbol of the Excess-3 code, we use 1’s to
draw the map for simplifying Boolean function.
Circuit implementation
z = D’; y = CD + C’D’ = CD + (C + D)’
x = B’C + B’D + BC’D’ = B’(C + D) + B(C + D)’
w = A + BC + BD = A + B(C + D)
BCD Arithmetic
Given a BCD code, we use binary arithmetic to add the digits:
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
Note that the result is MORE THAN 9, so must be represented by two digits!
To correct the digit, subtract 10 by adding 6 modulo 16.
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
+0110 so add 6
carry = 1 0011 leaving 3 + cy
0001 | 0011 Final answer (two digits)
If the digit sum is > 9, add one to the next significant digit
Warning: Conversion or Coding?
• To distinguish them from binary 1000 and 1001, which also have a
1 in position Z8, we specify further that either Z4 or Z2 must have a
1.
C = K + Z8Z4 + Z8Z2
Implementation of BCD adder
• A decimal parallel
adder that adds n
decimal digits needs n
BCD adder stages.
And
4-bit by 3-bit binary multiplier
• For J multiplier bits and K multiplicand bits
we need (J X K) AND gates and (J − 1) K-bit
adders to produce a product of J+K bits.
A = A3A2A1A0 ; B = B3B2B1B0
xi=AiBi+Ai’Bi’ for i = 0, 1, 2, 3
(A = B) = x3x2x1x0
Magnitude comparator
• We inspect the relative magnitudes
of pairs of MSB. If equal, we
compare the next lower significant
pair of digits until a pair of unequal
digits is reached.
(A>B)=
A3B’3+x3A2B’2+x3x2A1B’1+x3x2x1A0B’0
(A<B)=
A’3B3+x3A’2B2+x3x2A’1B1+x3x2x1A’0B0
Decoders
• The decoder is called n-to-m-line decoder, where m≤2n .
• 3-to-8 line decoder: For each possible input combination, there are
seven outputs that are equal to 0 and only one that is equal to 1.
Implementation and truth table
Decoder with enable input
• Some decoders are constructed with NAND gates, it becomes more
economical to generate the decoder minterms in their
complemented form.
• As indicated by the truth table , only one output can be equal to 0
at any given time, all other outputs are equal to 1.
Demultiplexer
• A decoder with an enable input is referred to as a
decoder/demultiplexer.
• The truth table of demultiplexer is the same with decoder.
A B
D0
Demultiplexer D1
E
D2
D3
3-to-8 decoder with enable implement the 4-to-16
decoder
Implementation of a Full Adder with a Decoder
• From table 4-4, we obtain the functions for the combinational circuit in sum of minterms:
S(x, y, z) = ∑(1, 2, 4, 7)
C(x, y, z) = ∑(3, 5, 6, 7)
Application of decoder
• It is used to convert the binary count into decimal digit in decade
counter.
I0 Y
I1
Boolean function implementation
• A more efficient method for implementing a Boolean function of n
variables with a multiplexer that has n-1 selection inputs.
F(x, y, z) = (1,2,6,7)
4-input function with a multiplexer
F(A, B, C, D) = (1, 3, 4, 11, 12, 13, 14, 15)
Three-State Gates
• A multiplexer can be constructed with three-state gates.
Three-State Gates
• A multiplexer can be constructed with three-state gates—digital
circuits that exhibit three states.
• Two of the states are signals equivalent to logic 1 and logic 0 as in a
conventional gate.
• The third state is a high-impedance state in which:
(1) the logic behaves like an open circuit, which means that the output
appears to be disconnected,
(2) the circuit has no logic significance, and
(3) the circuit connected to the output of the three-state gate is not
affected by the inputs to the gate.
Multiplexers with three-state gates
Application of Multiplexer
• Data selection and routing
• Controlled sequencer