Professional Documents
Culture Documents
Ch#3 Logic Design
Ch#3 Logic Design
Logic Design
MSI logic
Binary arithmetic
Multiplexers
De-multiplexers
Encoders
Decoders
Half adders and full adders
look ahead carry
1
What is MSI?
2
Logic Device Classification
Combinational Small Scale Integration (SSI)
Circuit output is a function only Integrated circuit uses only a few gates
of the current inputs eg., AND (20 or less). Typically provides only basic
gates, decoders gate functions
Example of addition
4
• Binary subtraction: (borrow, difference bits)
5
Representation of Negative
Numbers
• Signed-Magnitude System/Representation:
– MSB: sign bit, 0: plus, 1: minus
010101012 = +8510 110101012 = -8510
011111112 = +12710111111112 = -12710
000000002 = +010 100000002 = -010
6
Multiplexers
7
What is a Multiplexer (MUX)?
• A MUX is a digital switch that
has multiple inputs (sources) Multiplexer
Block Diagram
and a single output
(destination).
• The select lines determine 2N 1
MUX
Inputs Output
which input is connected to the (sources) (destination)
output.
• MUX Types
N
2-to-1 (1 select line)
Select
4-to-1 (2 select lines) Lines
8-to-1 (3 select lines)
8
16-to-1 (4 select lines)
Multiplexers
A multiplexer has
N control inputs
2N data inputs
1 output
A multiplexer routes (or connects) the selected
data input to the output.
The value of the control inputs determines
the data input that is selected.
9
2-to-1 Multiplexer (MUX)
Data
inputs
Z = A′.I0 + A.I1
Control
input
10
4-to-1 Multiplexer (MUX)
A B F
0 0 I0
0 1 I1
1 0 I2
1 1 I3
MSB LSB
MUX
D1
Y
D2
D3
B A
B A Y
0 0 D0
0 1 D1
1 0 D2
1 1 D3
12
4-to-1 Multiplexer Waveforms
D0
D1
Input
Data
D2
D3
A Select
Line
B
Output
Y Data 13
D0 D1 D2 D3 D0 D1 D2 D3
8-to-1 Multiplexer (MUX)
A B C F
0 0 0 I0
0 0 1 I1
0 1 0 I2
0 1 1 I3
1 0 0 I4
1 0 1 I5
1 1 0 I6
1 1 1 I7
MSB LSB
Z = A′.B'.C'.I0 + A'.B'.C.I1 + A'.B.C'.I2 + A'.B.C.I3 +
A.B'.C'.I4+ A.B'.C.I5 + A.B.C'.I6 + A.B.C.I7
14
8-to-1 Multiplexer (MUX)
15
Typical Application of a MUX
Multiple Sources Selector Single Destination
MP3 Player
Docking Station
D0
Laptop
D1
MUX
Sound Card Y
D2
D3
17
What is a Demultiplexer (DEMUX)?
• A DEMUX is a digital switch
Demultiplexer
with a single input (source) Block Diagram
and a multiple outputs
(destinations).
• The select lines determine 1 2N
DEMUX
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)
18
1-to-16 (4 select lines)
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.
19
1x4 De-multiplexer
Out0 W W = A'.B'.I
Out1 X X = A'.B.I
I In Out2 Y
Out3 Z Y =A.B'.I
S1 S0 Z = A.B.I
A B
A B W X Y Z
0 0 I 0 0 0
0 1 0 I 0 0
1 0 0 0 I 0
1 1 0 0 0 I
20
Typical Application of a DEMUX
Single Source Selector Multiple Destinations
B/W Laser
Printer
Fax
Machine
D0
DEMUX
X D1
D2 Color Inkjet
Printer
D3
B A Selected Destination
0 0 B/W Laser Printer Pen
Plotter
0 1 Fax Machine
1 0 Color Inkjet Printer
1 1 Pen Plotter
21
Decoders
22
Decoder background
23
Decoder definition
24
Decoders
A decoder has
N inputs
2N outputs
N
A decoder selects one of 2 outputs by
decoding the binary value on the N inputs.
The decoder generates all of the minterms of
the N input variables.
Exactly one output will be active for each
combination of the inputs.
What does “active” mean?
25
n-to-m-line decoders
26
n-to-m-line decoders
27
2 to 4 line Decoders
W = A'.B'
Out0 W
B I0 Out1 X X = A.B'
A I1 Out2 Y Y = A'.B
Out3 Z
msb Z = A.B
Active-high outputs
A B W X Y Z
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
28
2 to 4 line Decoders
W = (A'.B')'
Out0 W
B I0 Out1 X X = (A.B')'
A I1 Out2 Y Y = (A'.B)'
Out3 Z
msb Z = (A.B)'
Active-low outputs
A B W X Y Z
0 0 0 1 1 1
0 1 1 0 1 1
1 0 1 1 0 1
1 1 1 1 1 0
29
3 to 8 line Decoders
msb
30
Decoder with Enable
Out0 W
B I0
high-level Out1 X
enable A I1
Out2 Y
Out3 Z
Enable En
En A B W X Y Z
1 0 0 1 0 0 0
1 0 1 0 1 0 0
enabled
1 1 0 0 0 1 0
1 1 1 0 0 0 1
disabled 0 x x 0 0 0 0
31
Decoder with Enable
Out0 W
B I0
low-level Out1 X
enable A I1
Out2 Y
Out3 Z
Enable En
En A B W X Y Z
0 0 0 1 0 0 0
0 0 1 0 1 0 0
enabled
0 1 0 0 0 1 0
0 1 1 0 0 0 1
disabled 1 x x 0 0 0 0
32
Encoders
33
• Encoding – An encoder is a digital function
that performs the inverse operation of a
decoder. An encoder has 2n inputs and n
output lines that indicate which single bit of the
input is active.
34
Encoders
An encoder has
2N inputs
N outputs
An encoder outputs the binary value of the selected
(or active) input.
35
4 to 2 line Encoders
D I0
C I1 Out0 Z
Out1 Y
B I2
A I3
A B C D Y Z
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
36
Octal to binary Encoder
37
38