Top Banner
ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6 th Edition, by Roth and Kinney, and were used with permission from Cengage Learning.
46

ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Dec 21, 2015

Download

Documents

Theodore Kelly
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

ECE 331 – Digital System Design

Multiplexers and Demultiplexers,and

Encoders and Decoders

(Lecture #15)

The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6th Edition, by Roth and Kinney,

and were used with permission from Cengage Learning.

Page 2: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 2

Material to be covered …

Supplemental

Chapter 9: Sections 1 – 4

Page 3: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 3

Multiplexers

Page 4: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 4

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.

Page 5: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 5

Multiplexers

Z = A′.I0 + A.I1

Datainputs

Controlinput

Page 6: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 6

Multiplexers

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

A B F

0 0 I0

0 1 I1

1 0 I2

1 1 I3

MSB LSB

Page 7: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 7

Multiplexers

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

MSB LSB

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

Page 8: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 8

Multiplexers

Page 9: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 9

8-to-1 Multiplexer in VHDL

Page 10: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 10

8-to-1 Multiplexer in VHDL

Page 11: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 11

Multiplexers

Exercise:

Design an 8-to-1 multiplexer using 4-to-1 and 2-to-1 multiplexers only.

Page 12: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 12

Multiplexers

Exercise:

Design a 16-to-1 multiplexer using 4-to-1 multiplexers only.

Page 13: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 13

Multiplexer (Bus)

Page 14: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 14

Demultiplexers

Page 15: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 15

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.

Page 16: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 16

Demultiplexers

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

W = A'.B'.I

X = A.B'.I

Y = A'.B.I

Z = A.B.I

Out0

In

S1 S0

I

WXY

Z

A B

Out1

Out2

Out3

Page 17: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 17

Decoders

Page 18: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 18

Decoders A decoder has

N inputs 2N outputs

A decoder selects one of 2N 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?

Page 19: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 19

Decoders

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

Active-high outputs

BWXY

Z

I0

I1A

Out0

Out1

Out2

Out3

W = A'.B'

X = A.B'

Y = A'.B

Z = A.Bmsb

Page 20: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 20

Decoders

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

Active-low outputs

W = (A'.B')'

X = (A.B')'

Y = (A'.B)'

Z = (A.B)'msb

BWXY

Z

I0

I1A

Out0

Out1

Out2

Out3

Page 21: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 21

Decodersmsb

Page 22: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 22

3-to-8 Decoder in VHDL

Page 23: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 23

3-to-8 Decoder in VHDL

Page 24: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 24

Decoder with Enable

En A B W X Y Z

1 0 0 1 0 0 0

1 0 1 0 1 0 0

1 1 0 0 0 1 0

1 1 1 0 0 0 1

0 x x 0 0 0 0

enabled

disabled

high-levelenable

Enable

B WXY

Z

I0

I1A

Out0

Out1

Out2

Out3En

Page 25: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 25

Decoder with Enable

En A B W X Y Z

0 0 0 1 0 0 0

0 0 1 0 1 0 0

0 1 0 0 0 1 0

0 1 1 0 0 0 1

1 x x 0 0 0 0

enabled

disabled

Enable

B WXY

Z

I0

I1A

Out0

Out1

Out2

Out3En

low-levelenable

Page 26: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 26

2-to-4 Decoder with Enable in VHDL

Page 27: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 27

Decoders

Exercise:

Design a 4-to-16 decoder using2-to-4 decoders only.

Page 28: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 28

Encoders

Page 29: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 29

Encoders An encoder has

2N inputs N outputs

An encoder outputs the binary value of the selected (or active) input.

An encoder performs the inverse operation of a decoder.

Issues What if more than one input is active? What if no inputs are active?

Page 30: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 30

Encoders

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

D

ZY

I0

I1C

B I2

I3A

Out0

Out1

Page 31: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 31

Priority Encoders

If more than one input is active, the higher-order input has priority over the lower-order input.

The higher value is encoded on the output

A valid indicator, d, is included to indicate whether or not the output is valid.

Output is invalid when no inputs are active d = 0

Output is valid when at least one input is active d = 1

Why is the valid indicator needed?

Page 32: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 32

Priority Encoders

Valid bit

msb

Page 33: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

33

LIBRARY ieee ;USE ieee.std_logic_1164.all ;

ENTITY priority ISPORT ( w : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ;

y : OUT STD_LOGIC_VECTOR(1 DOWNTO 0) ;z : OUT STD_LOGIC ) ;

END priority ;

ARCHITECTURE Behavior OF priority ISBEGIN

y <= "11" WHEN w(3) = '1' ELSE "10" WHEN w(2) = '1' ELSE"01" WHEN w(1) = '1' ELSE"00" ;

z <= '0' WHEN w = "0000" ELSE '1' ;END Behavior ;

VHDL: 4-to-2 Priority Encoder

4 input bits

2 output bitsvalid indicator

Active-high inputs and outputs

Page 34: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 34

Designing logic circuits using multiplexers

Page 35: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 35

Using an n-input Multiplexer Use an n-input multiplexer to realize a logic circuit for

a function with n minterms. m = 2n, where m = # of variables in the function

Each minterm of the function can be mapped to an input of the multiplexer.

For each row in the truth table, for the function, where the output is 1, set the corresponding input of the multiplexer to 1. That is, for each minterm in the minterm expansion of the

function, set the corresponding input of the multiplexer to 1.

Set the remaining inputs of the multiplexer to 0.

Page 36: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 36

Using an n-input Mux

Example:

Using an 8-to-1 multiplexer, design a logic circuit to realize the following Boolean function

F(A,B,C) = m(2, 3, 5, 6, 7)

Page 37: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 37

Using an n-input Mux

Example:

Using an 8-to-1 multiplexer, design a logic circuit to realize the following Boolean function

F(A,B,C) = m(1, 2, 4)

Page 38: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 38

Using an (n / 2)-input Multiplexer Use an (n / 2)-input multiplexer to realize a logic

circuit for a function with n minterms. m = 2n, where m = # of variables in the function

Group the rows of the truth table, for the function, into (n / 2) pairs of rows. Each pair of rows represents a product term of (m – 1)

variables. Each pair of rows can be mapped to a multiplexer input.

Determine the logical function of each pair of rows in terms of the mth variable. If the mth variable, for example, is x, then the possible

values are x, x', 0, and 1.

Page 39: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 39

Using an (n / 2)-input Mux

Example: F(x,y,z) = m(1, 2, 6, 7)

Page 40: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 40

Using an (n / 2)-input Mux

Example: F(A,B,C,D) = m(1,3,4,11,12–15)

Page 41: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 41

Using an (n / 4)-input Mux

The design of a logic circuit using an (n / 2)-input multiplexer can be easily extended to the use of

an (n / 4)-input multiplexer.

Page 42: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 42

Designing logic circuits using decoders

Page 43: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 43

Using an n-output Decoder Use an n-output decoder to realize a logic circuit for a

function with n minterms. Each minterm of the function can be mapped to an

output of the decoder. For each row in the truth table, for the function, where

the output is 1, sum (or “OR”) the corresponding outputs of the decoder. That is, for each minterm in the minterm expansion of the

function, OR the corresponding outputs of the decoder.

Leave remaining outputs of the decoder unconnected.

Page 44: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 44

Using an n-output Decoder

Example:

Using a 3-to-8 decoder, design a logic circuit to realize the following Boolean function

F(A,B,C) = m(2, 3, 5, 6, 7)

Page 45: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 45

Using an n-output Decoder

Example:

Using two 2-to-4 decoders, design a logic circuit to realize the following Boolean function

F(A,B,C) = m(0, 1, 4, 6, 7)

Page 46: ECE 331 – Digital System Design Multiplexers and Demultiplexers, and Encoders and Decoders (Lecture #15) The slides included herein were taken from the.

Fall 2010 ECE 331 - Digital System Design 46

Questions?