Demux, Encoder, Decoder, ALU
Demux, Encoder, Decoder, ALU
Demux, Encoder, Decoder, ALU
2
What is a Demultiplexer
(DEMUX)?
• A DEMUX is a digital switch Demultiplexer
with a single input (source) Block Diagram
and a multiple outputs
(destinations).
DEMUX
• The select lines determine 1 2N
Input Outputs
which output the input is (source) (destinations)
connected to.
• DEMUX Types N
1-to-2 (1 select line)
Select
1-to-4 (2 select lines)
Lines
1-to-8 (3 select lines)
1-to-16 (4 select lines)
3
Demultiplexers
A demultiplexer has
N control inputs
1 data input
2N outputs
A demultiplexer routes (or connects) the data input
to the selected output.
The value of the control inputs determines the
output that is selected.
A demultiplexer performs the opposite function of a
multiplexer.
1 to 4 channel Demux
Demultiplexers: Implemtation
G Out0
Out1
1:2 demux
1-to-4 De-Multiplexer (DEMUX)
D0
DEMUX
D1
X
D2
D3
B A
B A D0 D1 D2 D3
0 0 X 0 0 0
0 1 0 X 0 0
1 0 0 0 X 0
1 1 0 0 0 X
Demux Tree
Encoders
Binary Encoders
Binary encoders convert its 2n
inputs to an n-bit output. I0 outputs
O0
2n
Only one high value is inputs
n
presented as input. The result is On – 1
a binary-encoded output of size I 2n – 1
n.
Binary Encoder
Binary encoders are useful for
compressing data.
Lecture Digital Systems
I0 I1 I2 I3 Y1 Y0
1 0 0 0 0 0 I0
Binary Y0
0 1 0 0 0 1 I1
I2
Encoder
0 0 1 0 1 0 Y1
I3 4-to-2
0 0 0 1 1 1
4 inputs 2 outputs
Lecture Digital Systems
I1 Y0 = I 1 + I 3 + I 5 + I 7
I2
I3 Y1 = I 2 + I 3 + I 6 + I 7
I4
I5
I6
I7 Y2 = I 4 + I 5 + I 6 + I 7
I0 Y0
Binary
Encoder Y1
I7
8-to-3 Y2
8 inputs 3 outputs
Priority Encoder
I0 I1 I2 I3 I4 I5 I6 I7 Y2 Y1 Y0 Idle
0 0 0 0 0 0 0 0 X X X 1
1 0 0 0 0 0 0 0 0 0 0 0
X 1 0 0 0 0 0 0 0 0 1 0
X X 1 0 0 0 0 0 0 1 0 0
X X X 1 0 0 0 0 0 1 1 0
X X X X 1 0 0 0 1 0 0 0
X X X X X 1 0 0 1 0 1 0
X X X X X X 1 0 1 1 0 0
X X X X X X X 1 1 1 1 0
Lecture Digital Systems
Binary Decoders
A binary decoder can be
considered as a black box I0 O0
with n input lines and 2n n
output lines. inputs 2n
Only one output line is set to In – 1 outputs
1 for a given input.
O2n – 1
Enable E
Binary Decoder
Lecture Digital Systems
Binary Decoders
Binary decoders convert an n-bit input to a single output. It uses
its n-bit input to determine which of the 2n outputs will be
uniquely activated.
Binary decoders can be developed using AND or OR Gates.
Later on, binary decoders can be implemented in logic circuits.
F0
X
Binary
F1
Decoder
F2
Y 2-to-4 F3
2 inputs 4 outputs
Enable
The truth table shows that for any given input combination,
exactly one output will turn to 1.
The enable must be set to 1 to get an output.
Lecture Digital Systems
3-to-8 Decoder
Try to understand the logic circuit of X Y Z F0 F1 F2 F3 F4 F5 F6 F7
3-to-8 binary decoder below. 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
X F0
Y Decoder
3-to-8
Z
F7
3 inputs 8 outputs
Enable
ALU (Arithmetic Logic Unit )
• The IC 74181 is a 4-bit Arithmetic Logic Unit
(ALU) which can perform all the possible 16
logic operations on two variables and a variety
of arithmetic operations.
• Features
– ■ Provides 16 arithmetic operations: add, subtract,
compare, double, plus twelve other arithmetic
operations
– ■ Provides all 16 logic operations of two variables:
exclusive-OR, compare, AND, NAND, OR, NOR, plus
ten other logic operations
– ■ Full lookahead for high speed arithmetic operation
on long words
IC 74181 ALU