Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Chapter 3:

Logic Design
MSI logic
Binary arithmetic
Multiplexers
 De-multiplexers
Encoders
Decoders
Half adders and full adders
look ahead carry

1
What is MSI?

• It refers to a Medium Scale Integration (MSI)


• An integrated circuit(IC) uses 20-200 gates to
provide common higher level functions such as
decoding, multiplexing, counting etc.
.

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

Sequential Medium Scale Integration (MSI)


Circuit output is a function only IC uses 20-200 gates to provide common
of the current inputs and higher level functions such as decoding,
previous inputs i.e. the circuit multiplexing, counting etc.
has memory. Eg. counters
Large Scale Integration (LSI)
Very Large Scale Integration (VLSI) Ics have 200-200K gates ( 400K
IC with over 106 transistors or transistors) or more to realise still higher
more which realises the highest functions such as small memories and
level of logic functionality. microprocessors, PLDs etc.
Examples: Pentium level Device delay (and cost) goes
processors (50 mil xsistors!),
FPGAs etc. up with complexity
3
• Binary addition: (carry, sum bits)

Example of addition

4
• Binary subtraction: (borrow, difference bits)

Minuend X 229 11100101


Subtrahend Y 46 00101110
_____________-_________________
Difference X-Y 183 10110111

– Use binary subtraction to compare numbers. If X-


Y produces a borrow out at the most significant
bit, then X is less than Y.

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

Z = A′.B'.I0 + A'.B.I1 + A.B'.I2 + A.B.I3


11
4-to-1 Multiplexer (MUX)
D0

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

Surround Sound System

Digital B A Selected Source


Satellite
0 0 MP3
0 1 Laptop
1 0 Satellite
Digital
1 1 Cable TV
Cable TV
16
Demultiplexers

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

• Given a n-bit binary number there are 2n things


it can represent or lines that can be activated
• Activated can mean pulling the signal high
(Active High) or pulling the signal low (Active
Low)

23
Decoder definition

• Decoding is the conversion of an n-bit input


code to an m-bit output code with n ≤ m ≤ 2n,
such that each valid code work produces a
unique output code.
• Decoding in performed by a logic circuit called
a decoder.

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

• Circuit has n inputs and m outputs and m ≤ 2n


• Start with n=1 and m=2
• This a 1-to-2 Line decoder – exactly one of the
output lines will be active.

26
n-to-m-line decoders

• A decoder when n=2 and m=4


• A 2-to-4 line decoder
• Note that only one output is ever active

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

You might also like