Professional Documents
Culture Documents
BIT102 SLM Library - SLM - Unit 08
BIT102 SLM Library - SLM - Unit 08
8.1 Introduction
In the previous unit we studied the basics of combinational circuits. We have
also studied some of the combinational circuits like adders, subtractors,
ripple carry adders and other related concepts. In this unit we study some
other combinational circuits. We study BCD adder and BCD subtractors,
Parity Checker/Generator, Multiplexer and Demultiplexer, encoders,
decoders. We also study BCD to Seven segment display decoder.
Objectives:
After studying this unit, you should be able to:
explain the working of BCD adders and subtractors
attribute the requirement of parity checker
describe the functions of multiplexers and demuliplexers
illustrate the function of encoder and decoder
describe the function of BCD to Seven segment Display Decoder/Driver
define the function of comparator and explain the operation of two bit
comparator.
The two BCD numbers along with input carry are added in the top 4 bit
binary adder1 to produce binary sum. When output carry is equal to zero
(i.e. when sum ≤ 9 and Cout=0), 0(zero) is added to the binary sum. When it
is equal to one (i.e. when sum > 9 or Cout=1), binary 0110 is added to the
binary sum through the bottom 4 bit binary adder 2. The output carry
generated from bottom binary adder 2 can be ignored because it supplies
information already available at the output carry terminal.
BCD Subtractor:
A BCD subtractor is a circuit that subtracts two BCD digits and produces
difference output digit which is also a BCD. This BCD subtractor does the
subtraction using either 9’s complement method or 10’s complement
method. So let us see the concept 9’s complement and 10’s complement
before explaining the operation of BCD subtractor.
Sikkim Manipal University B2072 Page No.: 194
Digital Electronics Unit 8
The first binary adder finds the 9’s complement of a negative number
(i.e. subtrahend). It does this by inverting each bit of BCD number and
adding decimal 10(1010) to it. Let us find 9’s complement of 2.
0010 : BCD for 2
1101 : inverting each bit
+ 1010 : Add 102(1010)
__________________
10111 : 9’s complement of 2.
(Carry ignored)
Sikkim Manipal University B2072 Page No.: 196
Digital Electronics Unit 8
Next two binary adders perform the BCD addition. The last adder finds the
9’s complement of the result if the carry is not generated; otherwise, it adds
carry to the result.
Subtraction using 10’s complement:
Subtraction using 10’s complement is obtained as follows:
1) Find 10’s complement of a negative number (i.e. subtrahend)
2) Add it the minuend. i.e., first number
3) If carry is generated, ignore the carry, otherwise, find the 10’s
complement of the result.
The figure 8.3 shows the logic diagram to perform BCD subtraction using
10’s complement method.
The first binary adder finds the 10’s complement of a negative number
(i.e. subtrahend). (i.e., 9’s complement +1). Next two 4 bit binary adders
perform the BCD addition. The last 4-bit binary adder finds the 10’s
complement of the result if the carry is not generated; otherwise, carry bit of
the result is ignored.
Self-Assessment Questions
1. BCD adder is a circuit that adds two BCD digits and produces sum
output digit which is also a BCD. (State true or false)
2. BCD subtractor does the subtraction using either _______ complement
method or __________ complement method.
3. _____________ of a number is formed by obtaining 9’s complement of
a number and adding 1 to the 9’s complement.
The figure 8.4 shows the block diagram of a 4 bit parity checker/generator.
The table 8.1 shows the parity genertor/checker bits for digital data.
Table 8.1: Parity genertor /checker bits for digital data
The figure 8.5 shows the logic diagram of even parity generator/checker.
The four bits in the message together with parity bit are transmitted to the
destination where they are applied to the parity checker circuit. The parity
checker circuit checks for possible errors in the transmission. Suppose even
parity is used at the transmitter, then the bits received should have even
number of 1’s. This is indicated by E=0. If error occurs during transmission,
then E=1 indicating error in the received message.
Similarly we can generate the circuit for odd parity generator /checker as
shown in figure 8.6.
Activity 1:
Generate an even parity generator/checker for the transmission of the
binary data 1010101?
Self-Assessment Questions
4. A _________ bit is an extra bit attached to a binary message to make
the total number of 1's either odd or even.
5. _______________ gates are useful for generating and checking a
parity bit that is used for detecting/correcting errors during transmission
of binary data over communication channels.
In the figure 8.7, the data select switch selects one of the available
inputs I1 to In and send it to the single output line Y. So, multiplexer acts like
a switch that has multiple inputs and single output (refer to figure 8.7 (b)).
Multiplexers are also known as data selectors because they can “select”
data of each input line. Generally, the selection of each input line in a
Inputs I0, I1, … In-1 are connected to the multiplexer on the longer parallel
side and output Y is connected on short parallel side. But people may use
rectangular symbol for convenience.
A digital multiplexer involves data input and output lines that take on
either 0 or 1. So naturally the select line also accepts binary 0 or 1 for
selecting the particular input line.
The figure 8.9 shows the general block diagram of a digital multiplexer.
2:1 Multiplexer:
The 2:1 multiplexer has two inputs and only one output. Since it has 21 = 2
inputs, it requires n=1 select line. The figure 8.10(a) shows the schematic
symbol of 2-to-1 multiplexer and the figure 8.10(b) shows the equivalent
switch of the multiplexer. One of the selected input lines can be connected
to the single output using the select line “Sel” input. This select input may be
represented as “S” for our convenience as is shown in the figure 8.10.
I0 and I1 are two input signals, S is the select line, and Y is the output signal.
When S=0, I0 is selected and connected to the output line (i.e. out line), so
whatever the data value available on I0 is steered on to the out line. Similarly
when S=1, I1 is available on out line. The operation of 2:1 Mux is
represented in the truth table shown in the table 8.3.
Table 8.3: Truth table for 2-to-1 Mux
Select input Data inputs Output
S I0 I1 Y
0 0
0 0 1 I0
1 0
1 1
0 0
1 0 1 I1
1 0
1 1
For a 2-to-1 multiplexer shown in figure 8.8, the Boolean equation for output
in terms of inputs can be written as follows:
4:1 Mux (4-to 1 mux): This Mux has 4 inputs and one output line. It selects
one of the input lines and connects it to the output line using 2 select lines.
The figure 8.12 shows the symbol of 4 to1.
The A, B, C and D are the data inputs and S0 and S1 are the select lines.
Depending on the conditions or binary values of select lines, one of the
inputs will be selected and that selected input data line is connected to the
output lines Y. So whatever the data present on the selected data input will
be available on the output line Y.
The truth table of 4- to-1 Mux is shown in the table 8.4.
Table 8.4: Truth table of 4 to 1 Mux
The output Y=A only when S0=0 and S1=0. This is represented in equation
as Similarly we can write the equation for other
inputs as well. So the final Boolean equation for a 4-to-1 multiplexer is:
8:1 Multiplexer: This Mux has 8 inputs and single output line. It selects one
of the input lines and connects it to the output. To select the input, it uses
3 select lines. The figure 8.14 shows the symbol of 8 to1.
A, B,C,D,E,F,G and H are the eight data inputs and S0, S1 and S2 are the
3 select lines. Depending on the binary values of select lines, one of the
data inputs will be selected and that selected input data line is connected to
the output lines Y. So whatever the data present on the selected data input
will be available on the output line. For example, if the selected data input
line has 0, then same data 0 will be available on the output line.
The truth table of 8 to1 Mux is shown in the table 8.5.
Table 8.5: Truth table of 8 to 1 Mux
distributes the data available on the single data input line to one of the
output lines, De multiplexer is also called data distributor.
A Demultiplexer functions exactly in the reverse of a multiplexer. A
demultiplexer accepts only one input and distributes it to one of many
outputs.
The figure 8.16 shows the general block diagram of a digital Demultiplexer.
A Demultiplexer single data input line has 2n number of output lines and n
number of “control” or select lines. Select lines are used to select the output
line to connect it to the input line. For example a 1 to 2 demux has 1 input
line, 2 output lines and 1 select line, here n=1. Similarly, 8 to 1 mux has
1 input line, 8 output lines and 3 select lines. Since 23=8, n=3 which means
only 3 select lines are enough to select 8 output lines.
Now we will study some of the digital Demultiplexers.
1:2 Demultiplexer
A 1:2 Demultiplexer or 1-to-2 demultiplexer has only one input and two
outputs. It has only one select line. Using this select line, it selects one of
the output lines and connects the input to this selected output line. So
whatever the data present at the input line will be available at the selected
output line.
When select line Sel or S=0, the output line Y0 is selected and the input data
line “D” is connected to output line Y0 and when S=1, it selects the output
line Y1 and input D is connected to Y1. So whatever the data (0 or 1) present
on data line D will be available on the selected output line.
1:4 Demultiplexers
A 1:4 Demultiplexer or 1 to 4 demultiplexer has only one input and four
outputs. It has only two select lines. Using these select lines, it selects one
of the output lines and connects the input to this selected output line. The
figure 8.18 shows the logic symbol of a 1 to 2 Demultiplexer. It truth table is
shown in the table 8.10.
When select line Select lines S1=0 and S0=0, the output line Y0 is selected
and the input data line “D” is connected to output line Y0 and when S1=0,
and S0=1, it selects the output line Y1 and input is connected to this Y1. So
whatever the data (0 or 1) that is present on the input line will be available
on the selected output line. Similarly depending on the condition of select
lines, other outputs will be selected and input data will be made available on
the selected output line.
The table 8.6 shows the truth table of 1- to- 4 Demultiplexer.
Table 8.6: Truth table for 1- to-4 Demultiplexer
Notice that there are 4 outputs (Y0, Y1, Y2 and Y4) and only one input D. The
input is transferred to the output corresponding to the decimal equivalent of
control inputs. For example, when S1S0 = 00, decimal equivalent is 0. So,
input (D) is transferred to Y0. The equations for the various outputs are
given as:
Y0 = S1’S0’D
Y1 = S1’S0D
Y2 = S1S0’D
Y3 = S1S0D
Where D is the data input, S0, S1 and S2 are the control inputs. Y0,Y1,…Y7
represent the outputs.
From the truth table, the output Y0 is HIGH only when either input I2 or I3 is
HIGH. So we can represent this using OR function as:
Y0 = I1 +I3
Here I0 input is not necessary because the binary code for it is always zero
when there are no other HIGH inputs.
The encoder has the limitation that only one input can be active at any given
time. If two inputs are simultaneously active, the output produces an
undefined combination. To prevent this we make use of the priority encoder.
Priority encoder:
A priority encoder is a digital circuit in which when two or more inputs are
activated at the same time, the input having the highest priority will take
precedence. An example of a single bit 4 to 2 priority encoder is shown in
figure 8.23. Its truth table is shown in the table 8.9.
D0, D1, D2, D3 are the four inputs and Y0, Y1 are the two outputs. Input D3
has the highest priority and D0 has the lowest priority. That means if D3 = 1
then Y1 Y0 = 11 irrespective of the other inputs. Similarly if D3 = 0 and D2 = 1
then Y1 Y0 = 10 irrespective of the other inputs.
Table 8.9: Truth table of 4 to 2 priority encoder
8.5.2 Decoder
A decoder is a logic circuit that accepts a set of encoded inputs that
represents a binary number and activates only the output that corresponds
to that input number. In other words, a decoder circuit looks at its inputs,
determines which binary number is present there, and activates the one
output that corresponds to that number and all other outputs remain
inactive. The functionality of a decoder is exactly the reverse of an encoder.
Decoder is much like a Demultiplexer but it does not have any data input.
The logic symbol of a general decoder is shown in figure 8.25 with N inputs
and M outputs.
Since there are N inputs whose value may 0 or 1, there are possible input
combinations or codes. For each of these input combinations, only one of
the M outputs will be active (HIGH) and all the other outputs are LOW. AND
gates are used in the decoder when HIGH output is required since when all
the input of an AND gates are “high” the output will also be “high”. So, AND
gate can be considered as the simple decoder. Sometimes decoders are
designed to produce active-LOW outputs, where only the selected output is
LOW while all others are HIGH. This active LOW is indicated by the
presence of small circles on the output lines in the decoder diagram. NAND
gates are used in the decoder when LOW output is required.
Also you can notice that some decoders do not utilize all of the possible
input codes but only certain ones. For example, a BCD-to-decimal decoder
has a four-bit input code and ten output lines that correspond to the ten
BCD code groups 0000 through 1001. Decoders of this type are often
designed so that if any of the unused codes are applied to the input, none of
the outputs will be activated.
Some decoders have one or more ENABLE inputs that are used to control
the operation of the decoder.
A digital decoder has multiple inputs and multiple outputs and it produces a
coded output from the coded inputs. Hence, input and output codes are
different i.e., if there is an n-bit input code then decoder produces 2n output
code.
Decoders are used in many applications like 7 segment display, multiplexing
of the data. Decoders are widely used in the memory system of a computer
for decoding of the memory address.
Now let us study some decoders.
A 2-to-4 Line Decoder: A 2-to-4 Line Decoder has 2 inputs and four ouputs.
It detects the binary code present at its inputs and decodes it and indicates
decoded information by activating one of the output lines. Figure 8.26 shows
the logic diagram of a 2-to-4 decoder. The table 8.10 shows the truth table
of a 2-to-4 decoder.
The figure 8.27 shows the logic diagram of 2-to-4 Line Decoder
A slightly more complex decoder would be the n-to-2n type binary decoders.
With n-to-2n binary decoders, maximum of ‘2n’ outputs are generated from
‘n’ coded inputs which carry information. For ‘n’ bit coded input, if there are
any unused combinations then number of outputs of the decoder can be
less than 2n. From the above discussion, we can say that a decoder can
produce a maximum of 2n outputs. In digital systems, apart from 2 to 4
decoder, various types of decoders like 3-to-8 decoder or BCD to decimal
decoder or 4-to-16 decoder are used. Two 2-to-4 decoders along with
enable signal can be used to construct a 3-to-8 decoders.
Activity 2:
Draw the logic diagram of BCD to Decimal Decoder.
Self-Assessment Questions
6. A multiplexer with 2n data input lines requires ________ number of
“control” or select lines to select the input line.
7. A 4: 1 Mux selects one of the input lines and connects it to the output
line using 2 select lines. (State true or false)
8. De multiplexer is also called _____________.
9. ____________ accepts an active level (i.e. HIGH) on one of its inputs
and converts it into coded output such as binary or BCD.
Self-Assessment Questions
10. LED stands for_____________________.
11. Which of the following is the BCD-to-7-segment decoder/driver
(a) IC 7446 (b) IC 7464 (c) IC 77446 (d) IC 6446
Using K map shown in figure 8.33, we can simplify the equations for all the
three conditions A>B, A=B and A < B as follows:
The figure 8.34 shows the logic diagram of a two bit comparator.
As shown in the figure, a 4 bit comparator has three outputs, A>B, A=B and
A < B.
Comparators are also available in the form of ICs (Integrated Circuits).
Examples of the comparator include the CMOS 4063 and 4585 and the
TTL 7485.
The figure 8.37(a) shows the pin diagram of IC 7485 which is a 4 bit
comparator. The input words are A3A2A1A0 and B3B2B1B0 where A3 and B3
are the most significant bits (MSBs) and A0 and B0 are Least significant bits
(LSBs). The figure 8.37(b) shows logic symbol of IC 7485. The table 8.13
shows the function table for IC 7485.
Figure 8.37: (a) Pin diagram of IC 7485 (b) Logic symbol of IC 7485.
Self-Assessment Questions
12. A ____________________is a combinational logic circuit which
compares the magnitude of two binary numbers and determines if one
number is greater than, less than, or equal to the other number.
13. IC 7485 which is a ________bit comparator.
Glossary:
BCD adder: A digital circuit that adds two BCD digits and produces sum
output digit which is also a BCD.
Parity generator: A circuit that generates parity bit.
Parity bit: An extra bit attached with a binary message to make the total
number of 1's either odd or even.
Multiplexing: The operation of sending one or more analog or digital
signals over a common transmission line at different times or speeds.
MUX: A device that performs the multiplexing.
Demultiplexer: A digital circuit that accepts only one input and distributes it
to one of many outputs.
Encoder: A combinational circuit that produces bit binary code
corresponding to the digital input.
Decoder: A logic circuit that accepts a set of encoded inputs and decodes
them and indicates the decoded information by activating corresponding
output.
Magnitude comparator: A combinational logic circuit which compares
magnitude of two binary numbers and determines if one number is greater
than, less than, or equal to the other number.
8.8 Summary
Let us recapitulate the important concepts discussed in this unit:
BCD adder is a circuit that adds two BCD digits and produces sum
output digit which is also a BCD.
A BCD subtractor is a circuit that subtracts two BCD digits and
produces difference output digit which is also a BCD.
10’s complement of a number is formed by obtaining 9’s complement of
a number and adding 1 to the 9’s complement.
A circuit that generates parity bit in the transmitter is called parity
generator and the circuit which checks parity in the receiver is called
parity checker.
The multiplexer, or “MUX” is a combinational logic circuit designed to
switch one of several input lines to a single common output line by the
application of a control signal or select line.
A demultiplexer accepts only one input and distributes it to one of many
outputs.
An encoder is a combinational circuit that produces an n bit binary code
corresponding to the digital input that represents some information such
as decimal number or octal number or character.
A decoder is a logic circuit that accepts a set of encoded inputs that
represents a binary number and activates only the output that
corresponds to that input number.
An integrated circuit (IC 7446/47) is the BCD to 7-segment
decoder/driver.
A magnitude comparator is a combinational logic circuit which
compares magnitude of two binary numbers and determines if one
number is greater than, less than, or equal to the other number.
8.10 Answers
Self-Assessment Questions
1. True
2. 9’s , 10’s
3. 10’s
4. Parity
5. Exclusive OR
6. n
7. True
8. Data distributor
9. Encoder
10. Light Emitting Diode
11. (a) IC 7446
12. Magnitude comparator
13. 4
Terminal Questions
1. BCD adder is a circuit that adds two BCD digits and produces sum
output digit which is also a BCD. Refer to section 8.2 for more details.
2. In digital system it is often required to reduce the probability of errors
during the transmission of digital data by using parity generator/checker.
Refer to section 8.3.
3. The multiplexer, or “MUX” is a combinational logic circuit designed to
switch one of several input lines to a single common output line by the
application of a control signal or select line. Refer to section 8.4.
4. A 1:4 Demultiplexer has only one input and four outputs. It has only two
select lines. Using these select lines, it selects one of the output lines
and connects the input to this selected output line. Refer to section 8.4.
5. An encoder is a combinational circuit that produces an n bit binary code
corresponding to the digital input that represents some information such
as decimal number or octal number or character. Refer to section 8.5.
6. A decoder is a logic circuit that accepts a set of encoded inputs that
represents a binary number and activates only the output that
corresponds to that input number. Refer to section 8.5.
7. An integrated circuit (IC 7446/47) is called BCD to 7-segment
decoder/driver. Refer to section 8.6.
8. A magnitude comparator is a combinational logic circuit which compares
magnitude of two binary numbers and determines if one number is
greater than, less than, or equal to the other number. Refer to
section 8.7.