Digital. PPT - Chapter 4
Digital. PPT - Chapter 4
INSTITUTE OF TECHNOLOGY
Department of Electrical and Computer Engineering
Complete logic circuit for a full adder (each half adder is enclosed by a
shaded area)
CONT…
• Arrangement of two half adder to form one full adder
PARALLEL BINARY ADDERS
• The Full Adder is capable of adding only two single digit binary
number along with a carry input. But in practical we need to add
binary numbers which are much longer than just one bit.
• Two or more full adders are connected to form parallel binary
adders
• To add two n-bit binary numbers we need to use the n-bit parallel
adder.
• It uses a number of full adders in cascade. The carry output of the
previous full adder is connected to carry input of the next full adder.
• The carry output of each adder is connected to the carry input of the
next higher-order adder.
CONT…
A B D (A-B) B
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Full Subtraction
• The disadvantage of a half subtractor is overcome by full subtractor.
• The full subtractor is a combinational circuit with three inputs A,B
,Bin and two output D and Bout'. A is the 'minuend', B is
'subtrahend', C is the 'borrow' produced by the previous stage, D is
the difference output and C' is the borrow output.
A B Bin D Bout
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
M=0 for adder and M=1 for subtractor
Four bit adder-subtractor
Comparators
• The basic function of comparator is to compare the magnitude of
two binary quantities to determine the relationship of those
quantities.
• The simplest form a comparator circuit determines whether two
numbers are equal or not.
• The outcome of the comparison is specified by three binary
variables that indicate whether A > B, A = B, or A < B.
EQUALITY
• The equality of the two numbers A and B is displayed in a
combinational circuit by an output binary variable that we designate
by the symbol ( A = B ) .
• This binary variable is equal to “1” if the input numbers ,A and B,
are equal, and is equal to “0” otherwise.
• The quality of each pair of bits can expressed logically with an
exclusive-NOR function .
CONT…
• To compare binary numbers containing two bits each:
• The binary variable (A = B) is equal to “1” only if all pairs of digit of the
two number are equal
INEQUALITY
• To determine whether A is greater or less than B, we inspect the relative
magnitudes of pairs of significant digits, starting from the MSB position.
If the two digits of a pair are equal, we compare the next lower significant
pair of digits,
CONT…
• The comparison continues until a pair of unequal digits is reached. If
the corresponding digit of A is “1”and that of B is “0”, we conclude
that A > B. If the corresponding digit of A is “0” and that of B is “1”,
we have A < B.
• To determine an inequality of binary numbers A and B, you
first examine the highest order bit in each number:
If A3=1 and B3=0, then number A is greater than number B.
If A3=0 and B3=1, then number A is less than number B.
If A3=B3, you must examine the next lower bit position for an
equality.
CONT…
• Logic symbol for four bit comparator with in equality indication
Example: determine A=B, A >B and A <B for the input number:
A=0011 And B=0110
DECODERS
• Discrete quantities of information are represented in digital systems by
binary codes.
• A binary code of n bits is capable of representing up to 2n distinct elements
of coded information.
• A decoder is a combinational circuit that converts binary information from
n input lines to a maximum of 2n unique output lines. If the m-bit coded
information has unused combinations, the decoder may have fewer than 2n
output
• A decoder detects the presence of a specified combination of bits (code)
on its inputs and indicates the presence of that code by a specified output
level.
• In its general form, a decoder has n input lines to handle n bits and forms
one to 2n output lines to indicate the presence of one or more n-bit
combinations.
• The decoders presented here are called n-to-m-line decoders, where m≤2n
Their purpose is to generate the 2n (or fewer) minterms of n input variable
CONT…
The Basic Binary Decoder
• Suppose we need to determine when a binary 1001 occurs on the
inputs of a digital circuit.
CONT…
Three Bit Decoder(three-to Eight line decoder)
• Three to eight line decoder CONT…
CONT…
The 4-bit Decoder :
• In order to decode all possible combinations of four bits, 16
decoding gates are required (24=16).
• This type of decoder is commonly called either: A 4-line-to-16-line
decoder, or A 1-of-16 decoder
• Decoding functions and truth table for a 4-line-to-16-
line decoder with active-LOW outputs.
• Each of the decoding function can be implemented by NAND gates
to provide active LOW output and AND gates to provide active
HIGH output
CONT…
• Pin diagram and logic symbol for the
74HC154 four bit decoder
CONT…
CONT…
4x16 decoder constructed using two 3x8 decoder:
• When w = 0,the top decoder is enabled and the other is disabled.
The bottom decoder outputs all 0's, and the top eight outputs
generate minterm 0000 to 0111.
• When w = 1,the enable conditions are reversed: The bottom decoder
outputs generate minterm 1000 to 1111, while the outputs of the top
decoder are all 0s.
CONT…
The BCD-to-decimal Decoder
• The BCD-to-decimal converts each BCD code into one of ten
possible decimal digit indications.
• Called 4- line-to-10-line decoder or 1-of- 10 decoder.
CONT…
The BCD-to-7-segment Decoder
• The BCD-to-7-segment decoder accepts the BCD code on its inputs
and provides outputs to drive 7-segment display devices to produce
a decimal readout.
CONT…
BCD-to-7-segment decoder
ENCODERS
• An encoder is a combinational logic circuit that essentially performs
a “reverse” decoder function.
• An encoder accepts an active level on one of its inputs representing a
digit, such as a decimal or octal digit, and converts it to a coded
output such as BCD or binary.
• An encoder has 2n (or fewer) input lines and n output lines.
• Encoders can also be devised to encode various symbols and
alphabetic characters.
• The process of converting from familiar symbols or numbers to a
codded format is called encoding.
CONT…
The Decimal-to-BCD Encoder
• This types of encoder has ten inputs-one for each decimal digit-and
four outputs corresponding to the BCD code. This is a basic 10-line-
to-4 line encoder.
• It has 10 inputs and 4 outputs corresponding to the
BCD code.
A3 = 8+9
A2 = 4+5+6+7
A1 = 2+3+6+7
A0 = 1+3+5+7+9
CONT…
Logical symbol for decimal to
BCD convertor
NOTE: A 0-digit input is not needed because the BCD outputs are all
LOW when there are no HIGH input.
Octal-to-binary Encode
• X=D4+D5+D6+D7
• Y=D2+D3+D6+D7
• Z= D1+D3+D5+D7
• The encoder can be implemented with three OR gates
Priority Encoder
• This is a special type of encoder. Priority is given to the input lines.
If two or more input line are 1 at the same time, then the input line
with highest priority will be considered.
• For example consider octal to binary encoder, if D3 and D6 are 1
simultaneously, the output of the encoder will be 111 because all
three outputs are equal to 1. The output 111 does not represent
either binary 3 or binary 6.
• To resolve this ambiguity, encoder circuits must establish an input
priority to ensure that only one input is encoded. If we establish a
higher priority for inputs with higher subscript numbers, and if
both D3 and D6 are 1 at the same time, the output will be 110
because D6 has higher priority than D3.
Multiplexers
• A MUX is a device that allows digital information from several sources to
be routed onto a single line for data transmission over that line to a
common destination.
• The basic MUX has several data-input lines and a single output line.
• It also has data-select inputs, which permit digital data on any one of the
inputs to be switched to the output line.
• The selector lines determine which input is connected to the output, and
also to increase the amount of data that can be sent over a network within
certain time. It is also called a data selector.
• Normally, there are 2n input lines and n selection lines whose bit
combinations determine which input is selected.
CONT…
• Multiplexer handle two type of data that is analog and digital. For
analog application, multiplexer are built of relays and transistor
switches. For digital application, they are built from standard logic
gates.
• Multiplexers are classified into four types:
2-1 multiplexer ( 1select line)
4-1 multiplexer (2 select lines)
8-1 multiplexer (3 select lines)
16-1 multiplexer (4 select lines)
Demultiplexers
• A Demultiplexer performs the reverse operation of a multiplexer i.e.
it receives one input and distributes it over several outputs.
• It has only one input, n outputs, m select input. At a time only
one output line is selected by the select lines and the input is
transmitted to the selected output line.
• It also known as data distributor.