Functions of Combinational Logic Gates
Functions of Combinational Logic Gates
A
Inputs H.A. Outputs
B
Fig. 5.1
A
C(carry)
B (C= AB)
S (sum)
(S= AB+ AB)
Fig. 5.2
Aand B are inputs. The carry (c) output is produced with an AND
gate. The Sum (s)output is produced with an Exclusive OR gate.
The truth table for HA is as follows.
FUNCTIONSOF COMBINATIONAL LOGIC 169
Table 5.1
Inputs
outputs
A B
(S= AB+ AB) (C= AB)
0 0
1 1
1 0
1 1
1
4 B
C= AB
B
B- AB
AB
1
s=(B AB) (A-AB)
A-AB
Fig. 5.3
= B AB+ A-AB
170 EECTRONICS-ll
-BAB+A-AB
=B(A +B) +A(A +B)
= BA + BB+ AA +AB
= AB+ BA
Full Adder (FA)
Full adder is alogic circuit that can add three bits at atime.
are hree inputs. Sum and carry are outputs. The additional There
used here is for handling input carries. input
When we want to add two binary numbers, each having
twO Or
more bits, the LSBs can be added by using a HA. The carry resulted
from the addition of LSBs is carried over to the next column and
added to the two bits in that colum.
The block diagram or symbol is
A S
B F.A.
out
in
Fig. 5.4
A B C in
AND
(AB+AC+BC)
|AND OR
Carry out
JAND
Sum S = A BC,
Hx-OR
Fig. 5.5
Outputs
Inputs
B Cin Sum S Carry Cout
A
0 0
1
0
1 0
0
1
0
1
1
0
1
1
172 ELECTRONICS-II
Here A, B, C are the three inputs. (C represents any carry
generated by the previous stage). Sum and carry (out) are the outputs.
the next stage.
Cot IS the carry output to be added in to
Sum S=ABOC
ABC
= ABC + ABC + ABC +
Carry output C.
out
=ABC + ABC + ABC + ABC
= ABC+ ABC + AB(C+C)
- ABC+ ABC+ AB [+C=1]
= ABC+ A (BC + B)
= ABC + A (B+C)
H.A.
Cout
B C
Fig. 5.6
Parallel binary adders
A single full adder is capable of adding three one bit numbers or
two one bit numbers and an input carry, But when we have to add
binary numbers with two bit, an additional full adder is to be used.
UNCTIONS OF COMBINATIONL LOGIC 173
Example
+ 0 1
1 00
A BC A BC A BC. in
A BC in
C COut C Out
C
S S, S, S,
Fig. 5.7
174 ET
The numhers being added are writen as A, A, A A and 9,
f the
B
B Vumhers form the least significarnt bits (1.SBs)entered tu 4tt
numhers are represented hy A, and B T hese are in to
first full adder FA Here whatever the carry takes plae te
transfermed to the FA2) Carry output of cach FA s
carT input of the next higher-order adder. The next hipher
A. and B. are presented to the FA(2) and so on. Other
oerations are repeated in all full adders. Thisresults in surn bts
S.. S, andS, The output carry fron the left most full. adder
the most significant sum bit. The final surn appears as a 5digin s
besSRIE
S. S. S
For example, when we want to add two 4-b1t numbers 1011 and
T101. the LSB of twonumbers 1and 1are entered in to the firt fut)
adder FA(l). The sum output S, is 0 and the carry output C. is 1
Cary output is transferred to the second full adder FA(2) as a thurd
input.
Inaddition to this input, the second column bits of
land 0 are entered in to second the two number
FA(2) as inputs. The sumn of these S
Is 0 and the carry output 1is
This carry 1.0andl(third column transferred to third full adder FA(3
full adder FA(3). The sum inputs) is connected to the third
output S, is 0 and the carry output I s
transferred to the fourth FA(4).
bits of the two numbers 1and 1This carry l and the most sign1ficant
are entered in to the fourth full
FA(4). Then it results the sum output adder
S, as l
becomes the mostsignificant sum bitS,. So the and the carry output
resultant sumis 1100
0
Carry from right column
S, S, S Ss
+Cary lorm nght column becomes a
sum bit.
COMBINATIONAL LOGIC 175
FUNCIONS OF
Where this full
Ans:In asimple
adder and parallel adder systemis applicable?
ovide the
voting systemthat can be uscdto simultaneously
number "yes' votes and the number of 'no" votes.
omparators
Acomparator is a logic circuit, uscd to comparc the
two binary numbers. A comparator circuit magnitudes
determines whether
tumbers are equal or not,
uality
An exclusive NOR (X-NOR) gate is used as a basic
comparator.
cause its Output iS a l only if its two input bits are equal. 1.e., the
aMput is a Iit and only if the input bits
coincide.
Basic comparator operation is as follows.
1
D
1
are equal)
1
Fig. 5.8
For example :Consider two four bit binary number A, A, A,A,
i B, B, B, B, They are cqual if and only if A, =B,, A, = B, A, =
nd A, = B,.Thus equality holds when A, coincides with B,, A,
Vitcides wih B,, A, coincides wilh B, and A, coincides with B,.
e implementation of this logic.
176 ELECTRONICS-Il
Fig. 5.9
Problem
For binary inputs 01 and 10to the inputs of comparator, determine
the output by following logic levels.
A,=1: 0
B,=0
Low indicates
A, =0: not equal
B, =1
A, A, =01
B,B, = 10
Fig. 5.10
5. What are the comparator outputs when A, A, A, A, = l001and
B,B, B, B, = 1010
177
HIMTONR OF COMUNATONAL LOGN
Ans:
(OMP
Fg.5.11
A<B outputis HIGH andthe other outputs A>Band A=Bare
LOW.
Decoder
idoat
A
decoder is a logic circuit, which identifies various combinatiOns
of input values andgenerates an outputcorresponding to cach of the
input combinations.
For example consider a 2 to 4 decider. It has two inputs (say A
and B)and four output lines.
Table 5.3
Inputs Output
() () 1 0 )
() () ()
) ()
() )
Table 5.4
Decimal Binary inputs
digit A,|A, A Decoding Active low outputs
|A function 0|1|2345\67}89|10 1112|13|14|15
000
1|A, A, A, A| 1|0|1 1|1||
1
2 0 A,A, A, A| 11|0| 1
3
1A, A, A1
4 0
5 1
01A,A, A 1
6 1|0A, A, A, A|1|1
7 0 1 |A, A, A, A 1|1|1| 1|1|1
8 00A, A, A, Ag 1 01|1
9 1A, A, A, A, 1|1|1| 1 1
10 1 o A, A, A, 1| 1|0 1 1
11 0 1A, A, A, A| 1| 1|1 1
12 00A, A, A, Ao| 1| 1 |0
13 A, A, A, Ao 1|10
1
14 1 A, A, A, Ao
15 1A, A,A, A 1 |0
For the above active low outputs 16 NAND gates are required.
(Active low means 1 for 0 and 0 for 1)
BCD to Decimal decoder
6 Construct a decoder for 4 inputs and 10 output lines (0 to 9)
using AND gates.
Ans: If AND gates are used output is active high. (1 for 1 and 0
for 0)
180 ELECTRONICS-II
First of alldraw the truth table
Table 5.5
Address Selected
A, A, A, A, line
0
0 1 1
0 1 2
1 1 3
0 1 4
1 0 1
0 1 0 6
1 7
0 0
1 0 0 1
A, A, A A0 Line
Fig. 5.13
181
FUNCTIONS OF COMBINATIONAL LOGIC
fthatline. An invalid code provides 0 output. The circuit given
elowis called as 4to 10 line decoder or 1 of 10 decoder. Because a
-bit address selects 1 of 10 output lines at atime.
Note: To select 1 of 16output lines, 6 more AND gates would be
added.)
Note: Inthe abOve figure, an Active high output is produced. ror
active lowoutputs NAND gates are to be used).
BCD to 7-segment Decoder
IC 74471s often found useful for displaving the decimal numerals
sing LEDs. It converts a BCD nibble (4 bits) in to an output that can
irive a seven - segment LED display.
Seven segment LED display is made of seven Light Emitting
Diodes. Table 5.6
Segments
Digit activated
a
a, b, c, d, e, f
1 b, c
K a, b, g, e, d
K 3
4
a, b, g, c, d
b, c, f, g
a,c, d, f, g
6 c, d, e, f,g
d
a, b, c
a, b, c, d, e, f, g
9 a, b, c, f, g.
Fig. 5.14
Each segment of LED that emits light when current flows through
Anexternal driving circuit is required to provide a LOW or HIGH
evel voltage for the activation of a given segment. When a level
forward
oltage is applied to a segment input, that particular LED is
iased and current flows through it.
he 74LS47 BCD - to -7 segment Decodor
7
7447 is an IC device that decodes BCD input and drives a
(shown
egment LED display. Here all of the outputs are active LOW
y the bubbles).
182 ELECTRONICS-Il
BIRBO b BI/RBO
BCD ab
inputs
LT LT
RBI a RBI
GND
Fig.5.15
A, A, A A,
Fig. 5.16
nhno
GIg
euisa
sandui 2=2
22 = 4
2'= 8
Fig. 5.17
The BCD (8421= 2 22 2' 29) code is as shown in the table given
below.
Table 5.7
BCD
Decimal
A, A, A, A
0 0
1
2 0
3
4
5
7 0
FUNCTIONS OF COMBINATIONAL LOGIC 185
(LSB)
A,
2
3
4
5
6
7
(MSB)
Fig. 5.18
If input line 7 becomes HIGH (all other lines are LOW) then A,.,
, and A, produces a HIGH on its outputs. A, become LOW. Now
CD output will be A, A, A, A, = 0111 for decimal 7.