CSE 140 Discussion Homework 4 Decoder Definition A

  • Slides: 16
Download presentation
CSE 140 Discussion Homework 4

CSE 140 Discussion Homework 4

Decoder Definition A digital module that converts a binary address to the assertion of

Decoder Definition A digital module that converts a binary address to the assertion of the addressed device. E (enable) n inputs n= 3 I 0 0 I 1 1 I 2 2 0 1 2 3 4 5 6 7 y 0 y 1 . . 2 n outputs 2 3= 8 y 7 yi = 1 if E = 1 & (In, In-1, …, I 0 ) = i yi = 0, otherwise 2

Decoder Application • {Decoder, OR} is a universal set – Any Boolean function can

Decoder Application • {Decoder, OR} is a universal set – Any Boolean function can be implemented with a set of decoders and OR gates. • If the function is described in the sum-ofproducts (minterms) form: – Decoder produces the minterms. – OR gate produces the sum from the minterms. – Ignore the don’t-cares. 3

Problem 1: Example Implement 3 -variable functions with a 3: 8 decoder and OR

Problem 1: Example Implement 3 -variable functions with a 3: 8 decoder and OR gates. i)f 1(a, b, c) = Σm(1, 2, 4) + Σd(0, 5), ii)f 2(a, b, c) = Σm(2, 3) + Σd(1, 4), iii)f 3(a, b, c) = Σm(0, 5, 6) y 1 y 2 y 4 E=1 c b a I 0 I 1 I 2 0 1 2 3 4 5 6 7 y 0. . y 7 f 1 y 2 y 3 f 2 y 0 y 5 y 6 f 3 4

What if the function has more than three variables? 4 variables: Implement a 4:

What if the function has more than three variables? 4 variables: Implement a 4: 16 decoder using 3: 8 decoders. d c b I 0 I 1 I 2 a 0 1 2 3 4 5 6 7 y 0. y 7 y 8. y 15 5

What if the function has more than three variables? 6 variables: Implement a 6:

What if the function has more than three variables? 6 variables: Implement a 6: 64 decoder using 3: 8 decoders. E I 2, I 1, I 0 I 5, I 4, I 3 I 2, I 1, I 0 … I 2, I 1, I 0 E D 0 D 1 y 0 y 7 y 8 y 15 … y 56 D 7 y 63 6

Encoder Definition A digital module that converts the assertion of a device to the

Encoder Definition A digital module that converts the assertion of a device to the binary address of the device. E 8 inputs 3 outputs I 0 Only one input can be asserted I 7 0 1 2 3 4 5 6 7 0 1 2 y 0 y 1 y 2 A (yn-1, . . , y 0 ) = I if E = 1 & one i s. t. Ii = 1 (yn-1, . . , y 0 ) = 0, otherwise. A = 1 if E = 1 & one i s. t. Ii = 1 A = 0, otherwise. 7

Priority Encoder E I 0 More than one input can be asserted 0 1

Priority Encoder E I 0 More than one input can be asserted 0 1 2 3 4 5 6 7 0 1 2 y 0 y 1 y 2 I 7 Eo Gs (yn-1, . . , y 0 ) = I if E = 1 & Ii = 1 & Ik = 0 for all k > i (yn-1, . . , y 0 ) = 0, otherwise. Eo = 1 if E = 1 & Ii = 0 for all i Gs = 1 if E = 1 & i s. t. Ii = 1 8 E

Problem 2: Example E I 31 -24 y 32, y 31, y 30 Eo

Problem 2: Example E I 31 -24 y 32, y 31, y 30 Eo Gs I 25 -16 y 22, y 21, y 20 Eo Gs I 15 -8 y 12, y 11, y 10 Eo Gs I 7 -0 y 02, y 01, y 00 Eo Gs 9

Multiplexer Definition A digital module that selects one of data inputs according to the

Multiplexer Definition A digital module that selects one of data inputs according to the binary address of the selector. E (Data input) D 2 n-1 -D 0 y Sn-1, 0 (Selector or Address) y = Di where i = (Sn-1, . . , S 0) if E = 1 y = 0, otherwise 10

Multiplexer Application • {Mux} is a universal set. – Any Boolean function can be

Multiplexer Application • {Mux} is a universal set. – Any Boolean function can be implemented with a set of multiplexers. – Use Shannon’s expansion to decompose the function into smaller ones – simplify the decomposed functions using K-maps – Feed the smaller functions to data inputs of the mux and use the expansion variable as the selector. 11

Problem 3: Example Implement f (a, b, c) = Σm (0, 2, 6) +

Problem 3: Example Implement f (a, b, c) = Σm (0, 2, 6) + Σd(1) using an 8 -input Mux. id 0 1 2 abc 000 001 010 f 1 1 3 4 5 6 7 011 100 101 110 111 0 0 0 1 0 En 0 1 2 3 4 5 6 7 S 2 S 1 S 0 y a b c 12

What if the we have to use smaller muxes? Implement f (a, b, c)

What if the we have to use smaller muxes? Implement f (a, b, c) = Σm (0, 2, 6) + Σd(1) using an 4 -input Mux. E ab 00 01 10 c=0 1 1 0 c=1 0 0 D(c) D 0 = 1 D 1 = c’ D 2 = 0 11 1 0 D 3 = c’ 0 1 y 2 3 S 1 S 0 a b 13

What if the we have to use smaller muxes? Implement f (a, b, c)

What if the we have to use smaller muxes? Implement f (a, b, c) = Σm (0, 2, 6) + Σd(1) using an 2 -input Mux. E abc 0 1 0 01 0 10 1 1 11 0 0 D(b, c) D 0 D 1 0 y 1 a 14

What if the we have to use smaller muxes? Implement f (a, b, c)

What if the we have to use smaller muxes? Implement f (a, b, c) = Σm (0, 2, 6) + Σd(1) using an 2 -input Mux. abc 0 1 0 01 0 10 1 1 11 0 0 D(b, c) D 0 = c’ D 1 = bc’ E D 0 (b, c) = c’ c=0 c=1 1 1 0 b=1 D 1 (b, c) = bc’ c=0 c=1 0 0 b=1 D 0 0 D 1 1 y a 15

What if the we have to use smaller muxes? Implement f (a, b, c)

What if the we have to use smaller muxes? Implement f (a, b, c) = Σm (0, 2, 6) + Σd(1) using an 2 -input Mux. E D 1 (b, c) = bc’ bc 0 1 0 0 1 1 0 0 D(c) D 0 = 0 D 1 = c’ c’ E D 0 0 D 1 1 0 y 1 a b 16