Unit 2: Combinational Circuit: Lesson 1: Half and Full Adder Circuit
Unit 2: Combinational Circuit: Lesson 1: Half and Full Adder Circuit
Unit 2: Combinational Circuit: Lesson 1: Half and Full Adder Circuit
When two digits are added together, the result consists of two parts,
known as the SUM and the CARRY. Since there are only four possible
combinations of two binary digits, one combination produces a carry.
This can be shown as
0 1 0 1
+0 +0 +1 +1
Carry Sum Carry Sum Carry Sum Carry Sum
0 0 0 1 0 1 1 0
The Half Adder The truth table for the addition of two binary variables A and B can be
shown below.
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Table 2.1 : Half adder truth table.
From the truth table it is clear that the SUM is only produced when A is
at 1 and B is 0 or when A is 0 and B is 1. A CARRY is produced only
Digital Systems and Computer Organization
when both A and B are at a logical 1. Hence the Boolean expression for
the SUM and CARRY output from the above truth table will be written
as follows :
Thus the logic circuit for a Thus the logic circuit for a half adder will have two inputs, A and B and
half adder will have two two outputs, SUM and CARRY as shown in Fig. 2.1.
inputs, A and B, and two
outputs, SUM and CARRY.
A
SUM
CARRY
A ⊕ B= A •B +A • B
A
SUM
B
CARRY
42
Combinational Circuit
01 0 1
+11 +1 +1
Carry Sum Carry Sum
0 1 1 0
1
Carry Sum
1 0
↓
=1 0 0
A B C S Carry out
(Carry in) (Sum)
0 0 0 0 0
0 0 1 1 0 B
C FA
1 0 0 1 0 CARRY
1 0 1 0 1
1 1 0 0 1 A
1 1 1 1 1
There are eight possible cases for three inputs and for each case the
desired output values are listed. For example, consider the case A = 1, B
= 0 and C = 1. The full adder (abbreviated FA) must add these bits to
produce a sum of 0 and a carry out of 1.
Since there are two output, we will design the circuitry for each output
individually, starting with the s output. The truth table 2.2 shows that
43
Digital Systems and Computer Organization
S = A ( B ⊕ C ) + A ( B ⊕ C )
S =A X + AX = A ⊕ X
S = A ⊕ [B ⊕ C] (1)
Consider now the output carry out in the truth table 2.2. We can write
the sum-of -products expression for carry out as follows :
This expression cannot be simplified further. Expressions (1) and (2) can
The expression for CARRY be implemented as shown in Fig. 2.3. The complete circuit with inputs
A, B and C and outputs S and carry out represents the full adder.
44
Combinational Circuit
A
SUM
CARRY OUT
A full adder circuit can be constructed using two half adders. Two of the
three inputs are connected to the first half adder which produces a partial
sum and partial carry output. The partial sum is fed to the second half
adder along with the third of the original inputs. This causes the final
sum to be produced and also another partial carry.
This partial carry combines with the other partial carry and gives the
final carry output. The three inputs to such a full adder, A,B and C are
completely interchangeable.
45
Digital Systems and Computer Organization
1.3. Exercise
i) 1
ii) 2
iii) 3
iv) 4.
46
Combinational Circuit
So far, the circuits that have been dealt with have only been capable of
performing the additions for one digit positions of a binary number.
However there will generally be more than just one digit in the numbers
to be operated upon. There are two basic methods of using the logic
circuits to add multidigit numbers. One method is using what is called a
Serial system, the other is a Parallel system.
Parallel addition is the second of the two basic methods by which binary
numbers may be added using logic circuits. In a parallel addition system
In a parallel addition system all the bits of multidigit numbers are added simultaneously, hence the
all the bits of multidigit
name parallel addition Fig. 2.5 shows a 4-bit parallel adder system. One
numbers are added
full adder is provided for every bit to be added. Consequently, the time
simultaneously.
taken for an addition is much less than that for a serial addition of the
same numbers. If the data is held in two registers A and B, then the
complete contents of these registers are applied simultaneously to the
respective A and B inputs of the full adders. The SUM output of each
adder is routed to the appropriate bit of the SUM register. The time
taken for the complete addition is slightly longer than that for a single bit
addition due to the propagation time of the carry from the least
significant to the most significant bit. When the data is presented to the
adders, the least significant bit of both A and B produce a CARRY bit,
either 0 or 1, which occurs a finite time, the population time, after the
initial presentation of the data to the adder. This carry information is
passed to the CARRY input of the next stage. The output from this
second stage will not be valid until the CARRY input information is
established. The same argument applies for all the subsequent stages of
the addition.
47
Digital Systems and Computer Organization
The overall speed advantage of parallel addition over the serial method
has already been mentioned. However, there is a disadvantage in that a
In parallel adder a great great deal of logic is required, especially if the numbers to be added
deal of logic is required contain a lot of bits. A compromise is usually arrived at between the
speed advantage of the parallel system and the circuit cost advantage of
the serial system. The compromise is often in the form of a bit-parallel,
word-serial approach.
A Register
MSB LSB
A4 A3 A2 A1
B Register
MSB LSB
A4 A3 A2 A1
CARRY IN
A B Ci A B Ci A B Ci A B Ci
CARRY IN
MSB LSB
SUM Register
The timing diagram for the 4-bit parallel adder is shown below :
48
Combinational Circuit
Data to 1
Adder
0
Co1 1
1
Co2
0
1
Co3
0
1
Co4
0
1
Valid SUM
0
td td td td
ta
Fig. 2.6 : The timing diagram for the 4-bit parallel adder.
td is the propagation delay time o each full adder, i.e. the time taken to
generate a valid output from each stage. ta is the time taken to generate a
The timing diagram for the valid SUM output from all stages from the time data is first applied to
4-bit parallel adder. the adder.
49
Digital Systems and Computer Organization
A Register
MSB LSB
CARRY IN
A Ci A Ci A Ci A Ci
Co S B Co S B Co S B Co S B
CARRY OUT
MSB LSB
The eight sum outputs represent the resultant sum of the two 8-bit
numbers. C8 is the carry out of the last position (MSB) of the second
adder. C8 can be used as a carry into another adder stage if larger binary
numbers are to be handled.
Problem
Determine the logic levels at the inputs and outputs of the 8-bit adder
when 7310 is added to 13810.
50
Combinational Circuit
Solution
138 = 10001010
73 = 01001001
These two binary values will be applied to the A and B inputs; that is,
the A inputs will be 10001010 from left to right, and the B inputs will be
01001001 from left to right. The adder will produce the binary sum of
the two numbers :
[A] = 10001010
[B] = 01001001
[S] = 11010011
The sum outputs will read 11010011 from left to right. There is no carry
into the C8 bit, and so it will be a 0.
1. Add the BCD code groups for each decimal digit position; use
ordinary binary addition.
BCD ADDER 2. For those positions where the sum is 9 or less, the sum is in proper
BCD form and no correction is needed.
3. When the sum of two digits is greater than 9, a correction of 0110
should be added to that sum to produce the proper BCD result. This
will produce a carry to be added to the next decimal position.
1. Add two 4-bit BCD code groups, using straight binary addition.
2. Determine if the sum of this addition is greater than 1001 (decimal
9); if it is, add 0110 (6) to his sum and generate a carry to the next
decimal position.
The first requirement is easily met by using a 4-bit binary parallel adder
such as the 74LS83 IC. For example, if the two BCD code groups
represented by, A3A2A1A0 and B3B2B1B0 , respectively, are applied to a
4-bit parallel adder, the adder will perform the following operation :
51
Digital Systems and Computer Organization
The sum outputs S4S3S2S1S0 can range anywhere from 00000 to 10010.
The circuitry for a BCD adder must include the logic needed to detect
whenever the sum is greater than 01001, so that the correction can be
added in. These cases where the sum is greater than 01001 are listed in
Table 2.3. Let’s define X. as a logic output that will go HIGH only when
the sum is greater than 01001. If we examine these cases, it can be
reasoned that X will be HIGH for either of the following conditions.
S4 S3 S2 S1 S0
0 1 0 1 0 (10)
0 1 0 1 1 (11)
0 1 1 0 0 (12)
0 1 1 0 1 (13)
0 1 1 1 0 (14)
0 1 1 1 1 (15)
1 0 0 0 0 (16)
1 0 0 0 1 (17)
1 0 0 1 0 (18)
Table 2.3.
X = S4 + S2 (S2 + S1)
52
Combinational Circuit
BCD
B3 B2 B1 B0 code
group
C4 4- bit
C0
Parallel Adder (74LS83) carry from
lower position
adder
BCD
S4 S3 S2 S1 S0 A3 A2 A1 A0 code
group
Carry to next
BCD adder
X
C4 4- bit C0=0
Not used
Parallel Adder (74LS83)
E3 E2 E 1 E 0
BCD sum
Fig. 2.8 : A BCD adder contains two 4-bit adders and c0orrection-
deterctor circuit.
The circuit consists of three basic parts. The two code groups A3A2A1A0
and B3B2B1B0 are added together in the upper 4-bit adder to produce the
sum S4S3S2S1S0. The logic gates implement the expression for X. The
BCD adder circuit consists
lower 4-bit adder will add the correction 0110 to the sum bits only when
of three basic parts.
X = 1, producing the final BCD sum output represented by ∑3∑2∑1∑0 .
X is also the carry output that is produced when the sum is greater than
01001. Of course, when X = 0, there is no carry and no addition of 0110.
In such case, ∑3∑2∑1∑0 = S3S2S1S0.
To help in the understanding of the BCD adder, the reader should try
several cases by following them through the circuit. The following cases
would be particularly instructive.
Inputs
Outputs
53
Digital Systems and Computer Organization
2.6. Exercise
i) 1
ii) 2
iii) 4
iv) 16.
54
Combinational Circuit
Lesson 3 : Multiplexer
3.1. Learning Objectives
I0
I1
I2
Z
Output
IN
DATA
Inputs
SELECT
Inputs
The wide arrow indicates that they may actually be more than one signal
line. The multiplexer acts like a rotary switch connecting one of several
The selection of which input inputs to a single output. The selection of which input to connect to the
to connect to the output is
output is determined by additional inputs called SELECTOR control
determined by additional
inputs called SELECTOR. lines. For example, output Z will equal data input I0 for some particular
SELECT input code, Z will equal I1 for another particular SELECT
input code; and so on. Thus, a multiplexer selects 1 out of N input data
sources and transmits the selected data to a single output chancel. This is
called multiplexing.
55
Digital Systems and Computer Organization
Fig. 2.9 shows the logic circuitry for a two-input multiplexer with data
Two -Input Multiplexer inputs I0 and I1 and SELECT input S.
I0
1
I1
2
S
SELECT input
S Output
0 Z = I0
1 Z = I1
The logic level applied to the S input determines which AND gate is
enabled so that its data input passes through the OR gate to output Z.
Looking at it another way, the Boolean expression for the output is
Z = I0S + I1 S
Z = I0 • 1 + I 1 • 0 = I 0 [ Gate 1 enabled]
Z = I0 • 0 + I 1 • 1 = I 1 [ Gate 2 enabled]
showing that output Z will be identical to input signal I1. The two input
multiplexer is referred to as a 2-to-1 mux.
56
Combinational Circuit
select one of the four inputs, there must be four unique combinations of
the select lines. This requires two select lines providing the four unique
combinations 00, 01, 10, 11. A select line combination of 00 would
select input I0 select-line combination 01 would select input I1 and so on.
The table in the figure gives the outputs Z as a function of the select line
inputs. The Boolean expression for the output is,
I0
I1
I2
I3
S1 S0
S1 S0 Z
0 0 I0
0 1 I1
1 0 I2
1 1 I3
57
Digital Systems and Computer Organization
I0
I1 4-to-1
Z
I2 MUX
I3
S1 S0
Fig. 2.11 : 4-to-1 Multiplexer representation.
Since the multiplexer function is so useful, many TTL chips exist that
perform the equivalent operation of the circuit as shown in Fig. 4 (4-to-1
Mux figure). For example, the 74153 contains two 4-to-1 multiplexers,
the 74151 contains one 8-to-1 multiplexer and the 74157 contains four 2-
to-1 multiplexer.
Fig. 2.12 shows the logic diagram for the 74151 eight-input multiplexer.
I0 I1 I2 I3 I4 I5 I6 I7
E E
58
Combinational Circuit
Inputs Outputs
E S2 S1 S0 Z Z
1 X X X 1 0
0 0 0 0 I0 I0
0 0 0 1 I1 I1
0 0 1 0 I2 I2
0 0 1 1 I3 I3
0 1 0 0 I4 I4
0 1 0 1 I5 I5
0 1 1 0 I6 I6
0 1 1 1 I7 I7
Table 2.4
This multiplexer has an enable input,E and provides both the normal
This multiplexer has an and inverted outputs. WhenE=0, the select inputs S2S1S0 will select one
enable input,E and
data input (from I0 through I7) for passage to output Z. WhenE=1, the
provides both the normal
and inverted outputs.
multiplexer is disabled so that Z = 0 regardless of the select input code.
This operation is summarizer in the truth table.
Problem 1
I7
.
.
.
Data
.
in
.
. 74151 Z
. MUX
I0
S3 E
S2
S2
S1 S1
S0 S0
X
I7
.
.
Data .
in .
.
. 74151 Z
. MUX
I0
E
S2
S1
S0
59
Digital Systems and Computer Organization
Solution
60
Combinational Circuit
+Vcc
1Kohm
E I0 I1 I2 I3 I4 I5 I6 I7
A S0
Input 74151 MUX
logic B
variables S1
C S2
C B A Z
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
Table 2.5.
Fig. 2.14 shows an eight input multiplexer used to implement the logic
circuit that satisfies the given truth table 2.5. The input variables A,B,C
are connected to S0, S1, S2 respectively. According to the truth table, Z is
supposed to be LOW when CBA = 000. Thus multiplexer input I0 should
be connected LOW. Likewise, Z is suppose to be LOW for CBA = 001,
100, 101 and 110 so that inputs I1, I4, I5, and I6 should also be connected
LOW. The other sets of CBA conditions must produce Z = 1, and so
multiplexer inputs I2, I3 and I7 are connected permanently HIGH.
61
Digital Systems and Computer Organization
3.7. Exercise
i) 4
ii) 5
iii) 6
iv) 7.
a) Define multiplexing.
b) What is the function of a multiplexer’s select inputs?
c) What are the uses of multiplexer?
62
Combinational Circuit
Lesson 4 : Demultiplexer
4.1. Learning Objectives
DATA input
ON
SELECT inputs
The single data input line I is connected to all four AND gates, but only
one of these gates will be enabled by the SELECT input lines. For
example with S1S0=00 only AND gate O will be enabled and data input I
will appear at output O . Other SELECT codes cause input I to reach the
other outputs.
63
Digital Systems and Computer Organization
0 O0
S1 1 O1
S0
2 O2
3 O3
I
DATA input
O0 = IS1S0
Algebraic expression of a 1-
to-4 demultiplexer O1 = IS1 S0
O2 = I S1S0
O3 = I S 1 S0
Fig. 2.17 shows the logic diagram for a demultiplexer that distrubutes
one input line to eight output lines. The single data input line I is
connected to all eight AND gates, but only one of these gates will be
enabled by the SELECT input lines. For example, with S2S1S0 = 000,
only AND gate 0 will be enabled, and data input I will appear at output
64
Combinational Circuit
O0. Other SELECT codes cause input I to reach the other outputs. The
truth Table 2.7 summarizes the operation.
0 O0
S2 1 O1
S1 O2
2
S0 O3
3
4 O4
5 O5
6 O6
7 O7
I
Data input
Table 2.7
Demultiplexer Applications
65
Digital Systems and Computer Organization
Serial-to-Parallel Conversion
When data communication between two computers take place over long
distance than both parallel-to-serial and serial-to parallel conversion
methods are needed. Here multiplexer performs parallel-to-serial
conversion and demulliplexer performs serial-to-parallel conversion.
Demulliplexer performs serial- Consider a situation in which two 16-bit computers must communicate.
to-parallel conversion.
Multiplexer is used to select a single bit of the input word and a
demultiplexer is used to connect that data to the proper bit of the output
word. The inter word can be transmitted and received by sequencing the
select lines from 0 through 15. This technique is called multiplexing and
demultiplexing.
4.3. Exercise
i) 3
ii) 4
iii) 6
iv) 8.
66
Combinational Circuit
Lesson 5 : Decoder
5.1. Learning Objectives
Digital circuits often “communicate” with the outside world via seven-
segment displays such as those found in your calculator. These displays
consist of seven individual LEDS and form the decimal characters 0
through 9 and some times hex characters A through F. By controlling
the current through each LED, some segments will be lighted and others
will be dark so that the desired character pattern will be generated.
5.3. DECODERS
A0 O0
A1 O1
A2 O2 M
N Decoder output
intput
AN-1 OM-1
2N input codes Only one output is high
for each input code
Some decoders do not utilize all of the 2N possible input codes but only
certain ones. For example, a BCD-to-decimal decoder has a 4-bit input
67
Digital Systems and Computer Organization
code and ten output lines that correspond to the ten BCD code groups
0000 through 1001. If any of the unused codes are applied to the input
none of the outputs will be activated.
Fig. 2.19 shows the circuitry for a decoder with three inputs and 23=8
3 to 8 Line Decoder outputs. It uses all AND gates, and so the outputs are active-HIGH. Note
that for a given input code, the only output which is active (HIGH) is the
one corresponding to the decimal equivalent of the binary input code
(e.g.; output O6 goes HIGH only when CBA=1102=610).
0 O0
A O1
1
(LSB)
B O2
2
C O3
3
(MSB)
4 O4
5 O5
6 O6
7 O7
C B A O0 O1 O2 O3 O4 O5 O6 O7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Table 2.8.
68
Combinational Circuit
ENABLE Inputs
Some decoders have one or more ENABLE inputs that are used to
Some decoders have one or control the operation of the decoder. For example, refer to the decoder in
more ENABLE inputs that Fig. 2.20 and visualize having a common ENABLE line connected to a
are used to control the
fourth input of each gate.
operation of the decoder.
E1 E2 E3
(MSB)
A2 A1 A0
O7 O6 O5 O4 O3 O2 O1 O0
With this ENABLE line held HIGH the decoder will function normally
and the A,B, C inputs code will determine which output is HIGH. With
ENABLE held LOW, however, all the outputs will be forced to the
LOW state regardless of the levels at the A, B, C inputs. Thus, the
decoder is ENABLED only if ENABLE is HIGH.
Fig. 2.21 shows the logic diagram for the 74LS138 decoder, it has
NAND-gate out-puts, so that its outputs are active-LOW. Another
indication is the labeling of the outputs as07, 06, 05, and so on; overbar
indicates active-LOW outputs.
69
Digital Systems and Computer Organization
E1 E2 E3
A2 A1 A0
74LS138
1-of-8 decoder
O7 O6 O5 O4 O3 O2 O1 O0
Fig. 2.21 : logic diagram for the 74LS138 decoder
Table 2.9
The input code is applied at A2, A1, and A0, where A2 is the MSB. With
three inputs and eight outputs, this is a 3-to-8 decoder or, equivalently, a
1-of-8 decoder.
InputsE1,E2 andE3 are separate enable inputs that are combined in the
AND gate. In order to enable the output NAND gates to respond to the
input code at A2A1A0, this AND gate output has to be HIGH. This will
occur only whenE1=E2= 0 and E3=1. E1 and E2 are active LOW,E3
is active HIGH. If one or more of the enable inputs is in its inactive state,
the AND output will be LOW, which will force all NAND outputs to
their inactive HIGH state regardless of the input code. This operation is
summarized in the truth Table 2.9. Recall that x represents the “don’t
care” condition.
70
Combinational Circuit
levels. These input levels are often provided by the outputs of a counter
or register.
Decoders are widely used in Decoders are widely used in the memory system of a computer. Decoder
the memory system of a responds to the address code input from the central processor to activate
computer. the memory storage location specified by the address code.
Fig. 2.22 shows the segment patterns that are used to display the various
digits. For example, to display a “6,” the segments c, d, e , f, and g are
made bright while segments a and b are dark.
f b
g
e c
(a)
(b)
Fig. 2.22 : (a) Seven-segment arrangement; (b) active segments for each
digit.
71
Digital Systems and Computer Organization
+Vcc
Common
anode
a connections
D
b
BCD-to
C c
7-segment
BCD
Input Decoder d
B e
f
A 7446 or 7447 g
(a)
(b)
To illustrate the operation of this circuit, let us suppose that the BCD
input is D = 0, C =1, B = 0, A =1, which is BCD for 5. With these inputs
the decoder/driver outputs a, f, g, c and d will be driven LOW
(connected to ground), allowing current to flow through the a, f, g, c and
d LED segments and thereby displaying the number 5. the b and e
outputs will be HIGH (open), so that LED segments b and e cannot
conduct.
72
Combinational Circuit
5.8. Exercise
i) enable inputs
ii) select inputs
iii) output lines
iv) none of above.
73
Digital Systems and Computer Organization
LCD display
a a a
Incident
ambient b
f b light c b
g
d
e
e c c
f
g
d
Backplane Backplane
(a) (b)
Fig. 2.24 : Liquid crystal display (a) basic arrangement; (b) applying a
voltage between segment and back plane.
74
Combinational Circuit
and g in Fig. 2.24 are OFF and will reflect incident light so that they
appear invisible against their background. When an appropriate ac
voltage is applied between a segment and the backplane, the segment is
activated (ON). Segments a, b, and c in Fig. 2.24 are ON and will not
reflect the incident light, and thus they appear dark against their
background.
Control
5V
40 Hz signal 0 Segment
Backplane
A 40-Hz square wave is applied to the backplane and the Other input to
the EX-OR is a CONTROL input that will control whether the segment
is ON or OFF.
When the CONTROL input is LOW, the EX-OR output will be exactly
the same as the 40-Hz square wave, so that the signals applied to the
segment and backplane are equal. Since there is no difference in voltage,
the segment will be OFF. When the CONTROL input is HIGH, the EX-
OR or output will be the INVERSE of the 40-Hz square wave, so that the
signal applied to the segment is out of phase with the signal applied to
the backplane. As a result, the segment voltage will alternately be
at + 5V and at -5V relative to the backplane. This ac voltage will turn
ON the segment.
75
Digital Systems and Computer Organization
D c
C BCD-TO-
d
7-Segment LCD display
B
Decoder
e
A
40 Hz
Backplane
6.3. Exercise
i) AND gate
ii) OR gate
iii) NOR gate
iv) XOR gate.
76
Combinational Circuit
Lesson 7 : Encoders
Most decoders accept an input code and produce a HIGH (or LOW) at
one and only one output line. In other words, we can say that a decoder
identifies, recognizes or detects a particular code. The opposite of this
decoding process is called encoding and is performed by a logic circuit
called an encoder. An encoder has a number of input lines, only one of
An encoder has a number of which is activated at a given time, and produces an N-bit output code,
input lines, only one of depending on which input is activated.
which is activated at a given
time.
A0 O0
A1 O1
A2 O2
A3 O3
M inputs N - bit
only one
ENCODER outputs code
HIGH at a time
AM-1 ON-1
Fig. 2.27 is the general diagram for an encoder with M inputs and N
outputs. Here the inputs are active - HIGH, which means they are
normally LOW.
77
Digital Systems and Computer Organization
O0
LSB
O1
A0
A1
A2
8 A3
Inputs A4 O2
A5 MSB
A6
A7
Inputs Outputs
A0 A 1 A 2 A 3 A 4 A 5 A 6 A 7 O2 O1 O0
× 1 1 1 1 1 1 1 0 0 0
× 0 1 1 1 1 1 1 0 0 1
× 1 0 1 1 1 1 1 0 1 0
× 1 1 0 1 1 1 1 0 1 1
× 1 1 1 0 1 1 1 1 0 0
× 1 1 1 1 0 1 1 1 0 1
× 1 1 1 1 1 0 1 1 1 0
× 1 1 1 1 1 1 0 1 1 1
Table 2.10.
By following through the logic, you can verify that a LOW at any single
input will produce the output binary code corresponding to that input.
For stance, a LOW at A3 (while all other inputs are HIGH) will produce
O2 = 0, O1 = 1, and O0 = 1, which is the binary code for 3. Notice that
A0 is not connected to the logic gates because the encoder outputs will
normally be at 000 when none of the inputs A 1 to A 9 is LOW. For
proper operation, only one input should be active at one time.
78
Combinational Circuit
For example, when both A 3 and A 5 are LOW, the output code will be
101 (5). Similarly, when A 6 , A 2 , and A 0 are all LOW, the output code
is 110 (6). The 74148, and 74HC148 are all octal-to-binary priority
encoders.
Fig. 2.29 shows the logic symbol and truth table for the 74147
(74LS147, 74HC147), which functions as a decimal-to-BCD priority
encoder. It has nine active-LOW inputs representing the decimal digits 1
through 9, and produces the inverted BCD code corresponding to the
highest-numbered activated input.
A1
MSB
A2 O3
74147 O2
Nine Inverted
Inputs Decimal-to-BCD BCD
priority encoder O1
A8 O0
A9
Table 2.11.
Let’s examine the truth Table 2.11 to see how this IC works. The first
line in the table shows all inputs in their inactive HIGH state. For this
condition the outputs are 1111, which is the inverse of 0000, the BCD
code for 0. The second line in the table indicates that a LOW at A 9
regardless of the states of the other inputs, will produce an output code
of 0110, which is the inverse of 1001, the BCD code for 9. The third line
shows that a LOW at A 8 , provided that A 9 is HIGH, will produce an
79
Digital Systems and Computer Organization
output code of 0111, the inverse of 1000, the BCD code for 8. In a
similar manner, the remaining lines in the Table 2.11 show that a LOW
at any input, provided that all higher-numbered inputs are HIGH, will
produce the inverse of the BCD code for that input.
The 74147 outputs will be normally HIGH when none of the inputs are
activated. This corresponds to the decimal 0 input condition. There is no
A 0 input, since the encoder assumes the decimal 0 input state when all
other inputs are HIGH. The 74147 inverted BCD outputs can be
converted to normal BCD by putting each one through an INVERTER.
7.4. Exercise
80