Unit5 Complete K2451
Unit5 Complete K2451
Unit5 Complete K2451
UNIT-5
LECTURE-Prepared by Dr KRISHAN KUMAR
As per order of University/AUTHORITY, It
is mandatory to Everybody/students/Faculty
members wear ID card in class room,
Authority may check you in class room,
inspection going on , as per Authority order
If you have not wear ID card then teacher
may register indiscipline case against student
-------------My dear student Please follow above
said instruction
Unit V
Introduction to Combinational Logic Circuits :
Adders, Subtractors, Comparators, Multiplexers and
De-multiplexers, multiplexer design, Decoders,
Encoder, Pairty Status
Topic need to be discussed in unit-4 are
1. Adder(HA and FA)
2. Subtractor(HS and FS)
3. Comparator design( 1 bit and 2-bit)
4. Multiplexer basics and design mux from any Boolean function up to three variables only and mux
tree
5. Demux- only 1:4 demux design
6. Decoder design from any Boolean function up to three variables only
7. Encoder- only 4:2 encoder
8. Parity circuit- only parity Generator
KEYWORDS
• Half Adder
• Full Adder
• Half Subtractor
• Full Subtractor
• Comparator
A half-adder is a combinational logic circuit that performs the addition of only
two bits (binary digits). Whereas, a full-adder is a combination circuit that
performs three bits (binary digits), where two are the significant bits and one is a
carry from previous execution.
A combinational logic circuit which is designed to add two binary digits is called
as a half adder. The half adder provides the output along with a carry value (if
any). The half adder circuit is designed by connecting an EX-OR gate and one
AND gate. It has two input terminals and two output terminals for sum and
carry.
The block diagram and circuit diagram of a half adder are shown in Figure-1.
Truth table of the half-adder −
Inputs Outputs
A B S (Sum) C (Carry)
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Subtractor
In the subtraction operation, each subtrahend bit (B) of
the number is subtracted from its corresponding
significant minuend bit (A) to obtain a difference bit.
Similar to adders, subtractors are also of two types −
•Half Subtractor
•Full Subtractor
Truth Table of Half Subtractor
Inputs Outputs
A B d (Difference) b
(Borrow)
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Characteristic Equation of Half Subtractor
• Difference, d=A⊕B=A′B+AB′
• Borrow, b=A′B
Full-Subtractor
Therefore, we can realize the full-subtractor using two XOR gates, two NOT gates, two AND gates, and
one OR gate.
Truth Table of Full-Subtractor
Inputs Outputs
A B bin d b (Borrow)
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
Characteristic Equations of Full Subtractor
The difference (d) of the full subtractor is the XOR of A, B, and bin. Therefore,
Difference, d=A⊕B⊕bin=A′B′bin+AB′b′in+A′Bb′in+ABbin
The borrow (b) of the full subtractor is given by,
Borrow, b=A′B′bin+A′Bb′in+A′Bbin+ABbin
Or
Borrow, b=A′B(bin+b′in)+(AB+A′B′)bin=A′B+(A⊕B)′bin
Question
The output of a full subtractor is same as
____________
a) Half adder
b) Full adder
c) Half subtractor
d) Decoder
Answer: b
The sum and difference output of a full adder
and a full subtractor are same.
If A, B and C are the input of a full adder and
a full subtractor then the output will be given
by (A XOR B XOR C), respectively.
Digital Comparator
A Digital Comparator is a combinational logic circuit that is used
for comparison of two binary values.
• A magnitude digital Comparator is a combinational circuit that
compares two digital or binary numbers in order to find out
whether one binary number is equal, less than, or greater than
the other binary number.
• Comparators are used in central processing units (CPUs) and
microcontrollers (MCUs).
• Examples of digital comparator include the CMOS 4063 and 4585 and
the TTL 7485 and 74682.
• An XNOR gate is a basic comparator, because its output is "1" only if
its two input bits are equal.
1-Bit Magnitude Comparator:
A comparator used to compare two bits is called a single-bit
comparator. It consists of two inputs each for two single-bit
numbers and three outputs to generate less than, equal to,
and greater than between two binary numbers.
The truth table for a 1-bit comparator is given below:
From the truth table logical expressions for each output
can be expressed as follows.
A>B: AB'
A<B: A'B
A=B: A'B' + AB
2-Bit Magnitude Comparator
A comparator used to compare two binary numbers each of two bits is
called a 2-bit Magnitude comparator. It consists of four inputs and three
outputs to generate less than, equal to, and greater than between two
binary numbers.
Multiplexer
Multiplexer means many into one. A
multiplexer is a circuit used to select and
route any one of the several input signals to a
single output.
------------------Example-------------
A television transmitter, which sends a
number of channels through a single cable,
uses FDM.
Multiplexers can handle two type of data i.e., analog and digital. For analog
application, multiplexer are built using relays and transistor switches. For
digital application, they are built from standard logic gates.
The multiplexer used for digital applications, also called digital multiplexer,
is a circuit with many input but only one output. By applying control
signals (also known as Select Signals), we can steer any input to the output.
Some of the common types of multiplexer are 2-to-1, 4-to-1, 8-to-1, 16-to-1
multiplexer.
Applications of Multiplexer
Truth Table –
D7 D6 D5 D4 D3 D2 D1 D0 X Y Z
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
As seen from the truth table, the output is 000 when D0
is active; 001 when D1 is active; 010 when D2 is active
and so on.
-------Implementation ---------------
From the truth table, the output line Z is active when
the input octal digit is 1, 3, 5 or 7. Similarly, Y is 1 when
input octal digit is 2, 3, 6 or 7 and X is 1 for input octal
digits 4, 5, 6 or 7. Hence, the Boolean functions would
be:
X = D4 + D5 + D6 + D7
Y = D2 +D3 + D6 + D7
Z = D1 + D3 + D5 + D7
One limitation of this encoder is that only one input can
be active at any given time. If more than one inputs are
active, then the output is undefined.
For example, if D6 and D3 are both active, then, our
output would be 111 which is the output for D7. To
overcome this, we use Priority Encoders.
Answer
Decimal-to-BCD encoder is the type of encoder that usually consists of
ten input lines and 4 output lines. Each input line corresponds to each
decimal digit and 4 outputs correspond to the BCD code which is
represented in 4 bits.
Decoder
The combinational circuit that change the binary information into 2n
output lines is known as Decoders. The binary information is passed in the
form of N input lines. The output lines define the 2n-bit code for the
binary information. In simple words, the Decoder performs the reverse
operation of the Encoder. At a time, only one input line is activated for
simplicity. The produced 2n-bit output code is equivalent to the binary
information.
2 to 4 line decoder
In the 2 to 4 line decoder, there is a total of three inputs, i.e., A0,
and A1 and E and four outputs, i.e., Y0, Y1, Y2, and Y3. For each
combination of inputs, when the enable 'E' is set to 1, one of these
four outputs will be 1.
The block diagram and the truth table of the 2 to 4 line decoder
Y3=E.A1.A0
Y2=E.A1.A0'
Y1=E.A1'.A0
Y0=E.A1'.A0'
Logical circuit of the above expressions is on next slide/ppt
Parity Bit
• The parity generating technique is one of the most widely used error detection techniques
for the data transmission.
• In digital systems, when binary data is transmitted and processed, data may be subjected to
noise so that such noise can alter 0s (of data bits) to 1s and 1s to 0s.
• parity bit is added to the word containing data in order to make number of 1s either even or
odd. Thus it is used to detect errors during the transmission of binary data .
• The message containing the data bits along with parity bit is transmitted from transmitter
node to receiver node. At the receiving end, the number of 1s in the message is counted and
if it doesn’t match with the transmitted one, then it means there is an error in the data.
A parity generator is a combinational logic circuit that generates the parity bit in the
transmitter. On the other hand, a circuit that checks the parity in the receiver is called
parity checker.
A combined circuit or devices of parity generators and parity checkers are
commonly used in digital systems to detect the single bit errors in the transmitted
data word.
Parity Bit Generator
There are two types of parity bit generators based on the type of parity bit
being generated. Even parity generator generates an even parity bit.
Similarly, odd parity generator generates an odd parity bit.