Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A...

22
Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101

Transcript of Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A...

Page 1: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Logic System Design I

More on Decoders and Muxes

ECGR2181

Lecture Notes 2A

01001110010000110101001101010101

Page 2: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Making Larger Components

• Consider destination then use component given to work toward solution.

• Think about the functionality of the destination component

• Think about what the given parts can do

• Then, bring it all together

• Finally, once design is done make a couple of test cases to see if the design is valid. If not, repeat from start.

2A-2Logic System Design I

Page 3: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Making Large Muxes

• i.e., construct a 16-input mux from any number of 4-input muxes

2A-3Logic System Design I

16-i

nput

Mult

iple

xer

i0

i2

i1

i3i4

i6

i5

i7i8

i10

i9

i11

i12

i14

i13

i15

S0

S2

S1

S3

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

nput

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

???

Page 4: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Example Continued

T.T. Goal:

2A-4Logic System Design I

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

nput

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

i0

i2i1

i3

i4

i6i5

i7

i8

i10

i9

i11

i12

i14

i13

i15

S3 S2 S1 S0 Y Z?

0 0 0 0 i0

0 0 0 1 i1

0 0 1 0 i2

0 0 1 1 i3

0 1 0 0 i4

0 1 0 1 i5

0 1 1 0 i6

0 1 1 1 i7

1 0 0 0 i8

1 0 0 1 i9

1 0 1 0 i10

1 0 1 1 i11

1 1 0 0 i12

1 1 0 1 i13

1 1 1 0 i14

1 1 1 1 i15

Z3

Z2

Z1

Z0

S0

S1

S0

S1

S0

S1

S0

S1

Z0

Z1

Z2

Z3

Z0

Z1

Z2

Z3

Z0

Z1

Z2

Z3

Z0

Z1

Z2

Z3

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y Y

S2

S3

Z3

Z2

Z1

Z0

Page 5: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Signal Flow Illustrated

2A-5Logic System Design I

S3 S2 S1 S0 Y

0 0 0 0 i0

0 0 0 1 i1

0 0 1 0 i2

0 0 1 1 i3

0 1 0 0 i4

0 1 0 1 i5

0 1 1 0 i6

0 1 1 1 i7

1 0 0 0 i8

1 0 0 1 i9

1 0 1 0 i10

1 0 1 1 i11

1 1 0 0 i12

1 1 0 1 i13

1 1 1 0 i14

1 1 1 1 i15

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

nput

Mux

i0

i2

i1

i3

S0

S1

Y

i0

i2i1

i3

i4

i6i5

i7

i8

i10

i9

i11

i12

i14

i13

i15

Z3

Z2

Z1

Z0

S0

S1

S0

S1

S0

S1

S0

S1

Y

S2

S3

Z3

Z2

Z1

Z0

• If S=7, then Y will equal the value on i7

= i3

= i11

= i15

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

Page 6: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

2A-6Logic System Design I

Signal Flow Illustrated, again

S3 S2 S1 S0 Y

0 0 0 0 i0

0 0 0 1 i1

0 0 1 0 i2

0 0 1 1 i3

0 1 0 0 i4

0 1 0 1 i5

0 1 1 0 i6

0 1 1 1 i7

1 0 0 0 i8

1 0 0 1 i9

1 0 1 0 i10

1 0 1 1 i11

1 1 0 0 i12

1 1 0 1 i13

1 1 1 0 i14

1 1 1 1 i15

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

nput

Mux

i0

i2

i1

i3

S0

S1

Y

i0

i2i1

i3

i4

i6i5

i7

i8

i10

i9

i11

i12

i14

i13

i15

Z3

Z2

Z1

Z0

S0

S1

S0

S1

S0

S1

S0

S1

Y

S2

S3

Z3

Z1

Z0

Z2

• If S=9, then Y will equal the value on i9

= i1

= i5

= i13

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

Page 7: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

2A-7Logic System Design I

Enable Lines

T.T. Goal:i0

i2i1

i3

i4

i6i5

i7

i8

i10

i9

i11

i12

i14

i13

i15

G S3 S2 S1 S0 Y

0 x x x x 0

1 0 0 0 0 i0

1 0 0 0 1 i1

1 0 0 1 0 i2

1 0 0 1 1 i3

1 0 1 0 0 i4

1 0 1 0 1 i5

1 0 1 1 0 i6

1 0 1 1 1 i7

1 1 0 0 0 i8

1 1 0 0 1 i9

1 1 0 1 0 i10

1 1 0 1 1 i11

1 1 1 0 0 i12

1 1 1 0 1 i13

1 1 1 1 0 i14

1 1 1 1 1 i15

Z3

Z2

Z1

Z0

S0

S1

S0

S1

S0

S1

S0

S1

Y

S2

S3

Z3

Z2

Z1

Z0

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

nput

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

G S1 S0 Y

0 x x 0

1 0 0 i0

1 0 1 i1

1 1 0 i2

1 1 1 i3

G

G

G

G

G

Page 8: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

2A-8Logic System Design I

Enable Lines, Continued 16-input Mux, w/ 2 enable inputs {1 active-high (G0) & 1 active-low (G1)}

i0

i2i1

i3

i4

i6i5

i7

i8

i10

i9

i11

i12

i14

i13

i15

G1 G0 S3 S2 S1 S0 Y

x 0 x x x x 0

1 x x x x x 0

0 1 0 0 0 0 i0

0 1 0 0 0 1 i1

0 1 0 0 1 0 i2

0 1 0 0 1 1 i3

0 1 0 1 0 0 i4

0 1 0 1 0 1 i5

0 1 0 1 1 0 i6

0 1 0 1 1 1 i7

0 1 1 0 0 0 i8

0 1 1 0 0 1 i9

0 1 1 0 1 0 i10

0 1 1 0 1 1 i11

0 1 1 1 0 0 i12

0 1 1 1 0 1 i13

0 1 1 1 1 0 i14

0 1 1 1 1 1 i15

Z3

Z2

Z1

Z0

S0

S1

S0

S1

S0

S1

S0

S1

Y

S2

S3

Z3

Z2

Z1

Z0

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

nput

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

= 0

Disabled State

Enabled State

For devices with multiple Enable inputs, all Enables must be asserted for the device operate as per it’s

definition.

Page 9: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

2A-9Logic System Design I

Enable Lines, Continued

i0

i2i1

i3

i4

i6i5

i7

i8

i10

i9

i11

i12

i14

i13

i15

G1 G0 S3 S2 S1 S0 Y

x 0 x x x x 0

1 x x x x x 0

0 1 0 0 0 0 i0

0 1 0 0 0 1 i1

0 1 0 0 1 0 i2

0 1 0 0 1 1 i3

0 1 0 1 0 0 i4

0 1 0 1 0 1 i5

0 1 0 1 1 0 i6

0 1 0 1 1 1 i7

0 1 1 0 0 0 i8

0 1 1 0 0 1 i9

0 1 1 0 1 0 i10

0 1 1 0 1 1 i11

0 1 1 1 0 0 i12

0 1 1 1 0 1 i13

0 1 1 1 1 0 i14

0 1 1 1 1 1 i15

Z3

Z2

Z1

Z0

S0

S1

S0

S1

S0

S1

S0

S1

Y

S2

S3

Z3

Z2

Z1

Z0

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

nput

Mux

i0

i2

i1

i3

S0

S1

Y

G4

-inp

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

G0

G0

G0

G0

G1

16-input Mux, w/ 2 enable inputs {1 active-high (G0) & 1 active-low (G1)}

Page 10: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

The New Mux

Here is a the TT & symbol for our shinny new 16-input Mux, with 2 enable lines

2A-10Logic System Design I

G1 G0 S3 S2 S1 S0 Y

x 0 x x x x 0

1 x x x x x 0

0 1 0 0 0 0 i0

0 1 0 0 0 1 i1

0 1 0 0 1 0 i2

0 1 0 0 1 1 i3

0 1 0 1 0 0 i4

0 1 0 1 0 1 i5

0 1 0 1 1 0 i6

0 1 0 1 1 1 i7

0 1 1 0 0 0 i8

0 1 1 0 0 1 i9

0 1 1 0 1 0 i10

0 1 1 0 1 1 i11

0 1 1 1 0 0 i12

0 1 1 1 0 1 i13

0 1 1 1 1 0 i14

0 1 1 1 1 1 i15

16-i

nput

Mult

iple

xer

i0

i2

i1

i3i4

i6

i5

i7i8

i10

i9

i11

i12

i14

i13

i15

S0

S2

S1

S3

Y

G0

G1

Page 11: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Mux Implementation of Combinational Logic

• Make an inverter out of a 4-input Mux

2A-11Logic System Design I

G S1 S0 Y

0 x x 0

1 0 0 i0

1 0 1 i1

1 1 0 i2

1 1 1 i3

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

Vcc

G1’G1

G1

G1’

• Start with the Mux, keep an eye on the TT.

• Configure the inputs such that …• when G1 = ‘0’ the output will equal ‘1’• and, when G1 = ‘1’ the output will equal

‘0’• Enable the Mux always.

• Never leave unused inputs unconnected.

Page 12: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

• More complex design … F(a,b,c)• For a 8-input mux the output can be described as

Y = i0(S2’S1’S0’) + i1(S2’S1’S0) + i2(S2’S1S0’) + i3(S2’S1S0) + …

… + i4(S2S1’S0’) + i5(S2S1’S0) + i6(S2S1S0’) + i7(S2S1S0)

1. Connect the inputs of the function (a,b,c) to the select lines of the mux … with a connected to S3

Y = i0(a’b’c’) + i1(a’b’c) + i2(a’bc’) + i3(a’bc) + i4(ab’c’) + i5(ab’c) + i6(abc’) + i7(abc)

2A-12Logic System Design I

Mux Implementation of Boolean Expression

Continued

Page 13: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

2A-13Logic System Design I

8-i

nput

Mult

iple

xer

i0

i2

i1

i3i4

i6

i5

i7

S0

S2

S1

Y

G0

G1

2. Connect the inputs to the mux (i7 – i0) to one or zero depending upon the value in the truth table

• For F(a,b,c) = m(0,2,5,7) ... i0=1; i1=0; i2=1; i3=0; i4=0; i5=1; i6=0; i7=1

• F(a,b,c) = 1(a’b’c’) + 0(a’b’c) + 1(a’bc’) + 0(a’bc) + 0(ab’c’) + 1(ab’c) + 0(abc’) + 1(abc)

• F(a,b,c) = a’b’c’ + a’bc’ + ab’c + abc

• F(a,b,c) = m0 + m2 + m5 + m7

Mux Implementation of Boolean Expression (cont.)

• Begin by connecting the system inputs (a,b,c) to the select lines as described above

Vcc

• Connect the minterms where the function equals ‘1’ to Vcc

• Connect the remaining mux inputs to gnd

• Connect the enable lines to the appropriate Vcc or gnd to always enable the mux

c

a

b

F

• Connect the output of the mux to the output of the system (F)

Page 14: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

More Mux Implementation of Comb. Logic

• Implement F(x,y,z) = Σm(3,4,6,7) using a 4-input mux

2A-14Logic System Design I

4-i

np

ut

Mux

i0

i2

i1

i3

S0

S1

Y

G

x y z F

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 1

1 1 1 1

xy

• Connect the most significant two inputs to the select lines• Pairs of minterms (where x & y remain constant) are then considered

• For xy = 00, the output F is independent of z … i0 should be connected to gnd.

• For xy = 01, the output F is dependent on z … when z = 0, F = 0 and when z = 1 F = 1; thus i1 = z

zz

• For xy = 10, the output F is dependent on z … when z = 0, F = 1 and when z = 1 F = 0; thus i2 = z’

• For xy = 11, the output F is independent of z … F = 1 for both cases of z … i3 should be connected to Vcc

Vcc

• Enable mux and connect the output of the mux to F

F

Page 15: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

More on Decoders

• Recap:• When enabled: the input combination value (i) is the subscript of the output that

is asserted. Otherwise, the output is zero. Where i is i1 & i0 concatenated.

• When not enabled all outputs are zero.

• Making larger decoders:• A decoder is used to select the appropriate output decoder

2A-15Logic System Design I2

x4

deco

der y0

y2

y1

y3G

i0i1

G i1 i0 y3 y2 y1 y0

0 x x 0 0 0 0

1 0 0 0 0 0 1

1 0 1 0 0 1 0

1 1 0 0 1 0 0

1 1 1 1 0 0 0

Page 16: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Expanding Decoders

3x8 Decoder using only 2x4 decoders

2A-16Logic System Design I

G i2 i1 i0 y7 y6 y5 y4 y3 y2 y1 y0

0 x x x 0 0 0 0 0 0 0 0

1 0 0 0 0 0 0 0 0 0 0 1

1 0 0 1 0 0 0 0 0 0 1 0

1 0 1 0 0 0 0 0 0 1 0 0

1 0 1 1 0 0 0 0 1 0 0 0

1 1 0 0 0 0 0 1 0 0 0 0

1 1 0 1 0 0 1 0 0 0 0 0

1 1 1 0 0 1 0 0 0 0 0 0

1 1 1 1 1 0 0 0 0 0 0 0

2x4

deco

der y0

y2

y1

y3G

i0i1

2x4

deco

der y0

y2

y1

y3G

i0i1

3x8

deco

der

y0

y2

y1

y3

G

i0i1i2

y4

y6

y5

y7

???

2x4

deco

der y0

y2

y1

y3G

i0i1

2x4

deco

der y0

y2

y1

y3G

i0i1

2x4

deco

der y0

y2

y1

y3G

i0i1

Page 17: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

3x8 Decoder

2A-17Logic System Design I

2x4

deco

der y0

y2

y1

y3G

i0i1

2x4

deco

der y0

y2

y1

y3G

i0i1

y0

y1y2

y3

y4

y5y6

y7

G i2 i1 i0 y7 y6 y5 y4 y3 y2 y1 y0

0 x x x 0 0 0 0 0 0 0 0

1 0 0 0 0 0 0 0 0 0 0 1

1 0 0 1 0 0 0 0 0 0 1 0

1 0 1 0 0 0 0 0 0 1 0 0

1 0 1 1 0 0 0 0 1 0 0 0

1 1 0 0 0 0 0 1 0 0 0 0

1 1 0 1 0 0 1 0 0 0 0 0

1 1 1 0 0 1 0 0 0 0 0 0

1 1 1 1 1 0 0 0 0 0 0 0

• Connect the outputs as shown

• Connect the least significant inputs to the inputs of the output decoders

i1i0

i1i0

• Each combination of i1 & i0 will produce two asserted outputs; thus, we need to enable the decoder with the desired output and disable the others …

2x4

deco

der y0

y2

y1

y3G

i0i1

• Connect the first level decoder shown based on the remaining inputs. In this case, i2 of the new decoder. When i2 = 0, the top decoder is enabled. When i2 = 1 the bottom decoder is enabled.

z0 z0z1

z1

i2

• Connect the enable for the new decoder to the enable of the first level mux.

G

NOTE: Unused inputs must connect to something … unused outputs are left hanging.

Page 18: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

4x12 Decoder (non-std.)

Decode binary word to 1-of-12 code (12 outputs)

2A-18Logic System Design I

G G0_L i3 i2 i1 i0 y11 y10 y9 y8 y7 y6 Y5 y4 y3 y2 y1 y0

x 1 X x x x 0 0 0 0 0 0 0 0 0 0 0 0

0 x X x x x 0 0 0 0 0 0 0 0 0 0 0 0

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0

1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0

1 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0

1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0

1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0

1 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0

1 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0

1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0

1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0

1 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0

1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0

Page 19: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

4-to-12 Decoder (non-std.)

2A-19Logic System Design I

2x4

deco

der y0

y2

y1

y3G

i0i1

2x4

deco

der y0

y2

y1

y3G

i0i1

y0

y1y2

y3

y4

y5y6

y7

i1i0

i1i0

2x4

deco

der y0

y2

y1

y3G

i0i1

z0

z0

z1

z1

i2i3

2x4

deco

der y0

y2

y1

y3G

i0i1

y8

y9y10

y11

i1i0

z2

z2

G0_L

2x4

deco

der y0

y2

y1

y3G

i0i1G1

Vcc

Gint

Gint

Page 20: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

4-to-16 Decoder

• 4x16 Decoder with an active-high enable

2A-20Logic System Design I

2x4

deco

der y0

y2

y1

y3G

i0i1

2x4

deco

der y0

y2

y1

y3G

i0i1

y0

y1y2

y3

y4

y5y6

y7

i1i0

i1i0

2x4

deco

der y0

y2

y1

y3G

i0i1

z0

z1i2i3

2x4

deco

der y0

y2

y1

y3G

i0i1

y8

y9y10

y11

i1i0

z2

z0

z1

z2

z3G

2x4

deco

der y0

y2

y1

y3G

i0i1

Y12

y13y14

y15

i1i0

z3

4x1

6 d

eco

der

y0

y2

y1

y3

G

i0i1

y4

y6

y5

y7

y8

y10

y9

y11

y12

y14

y13

y15

i2i3

Page 21: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Demultiplexer (demux)

• A demux performs the reverse operation from the mux

• The demux routes one input to 1-of-n outputs based on the select-line input combination

• System description for 4 output demux (2 select-lines)

• y0 = i·s1’·s0’

• y1 = i·s1’·s0

• y2 = i·s1·s0’

• y3 = i·s1·s0

• Recall from the decoder a description could be given as follows:

• y0 = G·s1’·s0’

• y1 = G·s1’·s0

• y2 = G·s1·s0’

• y3 = G·s1·s0

2A-21Logic System Design I

Page 22: Logic System Design I More on Decoders and Muxes ECGR2181 Lecture Notes 2A 01001110010000110101001101010101.

Demux (concluded)

2A-22Logic System Design I

• You can see, from the previous expressions, that the demux could be implemented with a decoder that has an enable

• Just connect I to G of the decoder and you have a demux.

•Warning: Most CAD tools rely on the user knowing this fact … … the libraries do not contain any demuxes, just decoders.

2x4

deco

der y0

y2

y1

y3G

i0i1

y0

y1

s0

s1

y2

i y3

2x4

deco

der y0

y2

y1

y3G

i0i1

y0

y1

00

y2

i y32

x4

deco

der y0

y2

y1

y3G

i0i1

y0

y1

10

y2

i y3

2x4

deco

der y0

y2

y1

y3G

i0i1

y0

y1

01

y2

i y3

2x4

deco

der y0

y2

y1

y3G

i0i1

y0

y1

11

y2

i y3