Lecture7 Fall24
Lecture7 Fall24
M. ZAIN UDDIN 1
Digital Logic Design
M. ZAIN UDDIN 3
Comparators
The function of a comparator is to compare the magnitudes of two
binary numbers to determine the relationship between them. In the
simplest form, a comparator can test for equality using XNOR gates.
How could you test two 4-bit numbers for equality?
COMP
A0 0
A1 A
A2
A3 3
Cascading A>B A>B
A=B A=B Outputs
inputs
A<B A<B
B0 0
B1 A
The IC shown is the
B2
B3 3 4-bit 74LS85.
Comparators
IC comparators can be expanded using the cascading inputs as
shown. The lowest order comparator has a HIGH on the A = B input.
LSBs MSBs
A0 COMP A4 COMP
A1 0 A5 0
A2 A A6 A
A3 A7
3 3
A>B A>B A>B A>B
+5.0 V A=B A=B A=B A=B Outputs
A<B A<B A<B A<B
B0 0 B4 0
B1 A B5 A
B2 B6
B3 3 B7 3
Multiplexer (Data Selectors)
The term Multiplexer means many into one.
Multiplexing is the process of transmitting a large number of information over a single
line.
A Digital Multiplexer (MUX) is a combinational Circuit that select one digital
information from several sources and transmits the selected information on a single
output line.
A Multiplexer is also called a Data Selector.
The Multiplexer has several data input line and a single output line.
Mux (Con.t)
MUX directs one of the inputs to its output line by using a control bit word
(selection line) to its select lines.
Multiplexer contains the followings:
data inputs
selection inputs
a single output
Selection input determines the input that should be connected to the output.
The multiplexer acts like an electronic switch that selects one from different.
8-1 Multiplexer Circuit
De-Multiplexer
The De-Multiplexer is a combinational logic circuit that performs
the reverse operation of multiplexer (Several output lines, one input
line).
De -Multiplexer means one to many. A De-Multiplexer is a circuit
with one input and many output. By applying control signal, we can
steer any input to the output. Few types of De -Multiplexer are 1-to 2,
1-to-4, 1-to-8 and 1-to 16 De -Multiplexer .
De-Multiplexer is the process of taking information from one input
and transmitting the same over one of several outputs.
Switching-network logic blocks
Multiplexer (MUX)
◦ Routes one of many inputs to a single output
◦ Also called a selector
Demultiplexer (DEMUX)
◦ Routes a single input to one of many outputs
◦ Also called a decoder
multiplexer demultiplexer
We construct these
devices from:
• logic gates
• networks of tran-
sistor switches
control control
The “WHY” slide
Multiplexers/Demultiplexers
◦ If you had the ability to select which input to operate, the same part of a circuit can be
used multiple times. So if you have a lot of inputs and all of them are supposed to go
through same complex logic functions, you can save a lot of space on your circuit board
by using a multiplexer.
◦ Then you will also need a demultiplexer to decode the output coming out in serial into
separate output ports.
“WHY”: Sharing complex logic
functions
Share an adder: Select inputs; route sum
A0 A1 B0 B1
A B
single adder
Sum
Z0 Z1
Multiplexers (con't)
2:1 mux:Z = S'In0 + SIn1
4:1 mux:Z = S0'S1'In0 + S0'S1In1 + S0S1'In2 + S0S1In3
8:1 mux:Z = S0'S1'S2'In0 + S0'S1S2In1 + ...
I0 2:1 I0 I0
I1 mux Z I1 4:1 I1
I2 mux Z I2
I3 I3 8:1
S0 I4 Z
mux
I5
S0 S1 I6
I7
S0 S1 S2
Cascading multiplexers
Can form large multiplexers from smaller ones
◦ Many implementation options
8:1 mux 8:1 mux
I0 I0 2:1
I1 4:1 I1 mux
I2 mux
I3 I2 2:1
2:1 Z I3
mux mux 4:1
I4 mux Z
I5 4:1 I4 2:1
I6 mux I5 mux
I7
I6 2:1
I7 mux
S0 S1 S2
S0 S1 S2
Multiplexers as general-purpose
logic
A 2n:1 mux can implement any function of n variables
◦ A lookup table
◦ A 2n – 1:1 mux also can implement any function of n variables
A B C F 1 0
0 0 0 1 C' 0 1
0 0 1 0 1 2 C' 0
0 1 0 1 C' 0 3 F C' 1 F
0 1 1 0 8:1 MUX
0 4 0 2 4:1 MUX
1 0 0 0 0 0 5 1 3
1 0 1 0 1 6 S1 S0
1 1 0 1 1 1 7
1 1 1 1 S2 S1 S0 A B
A B C
Multiplexers as general-purpose
logic
M. ZAIN UDDIN 27
Multiplexers as general-purpose
logic
M. ZAIN UDDIN 28
Multiplexers as general-purpose
logic
M. ZAIN UDDIN 29