Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 140 Lecture 12 Combinational Standard Modules CK Cheng CSE Dept. UC San Diego 1.

Similar presentations


Presentation on theme: "CSE 140 Lecture 12 Combinational Standard Modules CK Cheng CSE Dept. UC San Diego 1."— Presentation transcript:

1 CSE 140 Lecture 12 Combinational Standard Modules CK Cheng CSE Dept. UC San Diego 1

2 Part III. Standard Modules Interconnect Modules: 1. Decoder, 2. Encoder 3. Multiplexer, 4. Demultiplexer 2

3 Multiplexer Definition Logic Diagram Application 3

4 iClicker: Multiplexer Definition A.A device that interleaves two or more activities B.A communications device that combines several signals for transmission over a single medium C.A logic circuit that sends one of several inputs out over a single output channel. D.The circuit that uses a common communications channel for sending two or more messages or signals. E.All of the above 4

5 3. Mux (Multiplexer) Definition: A digital module that selects one of data inputs according to the binary address of the selector. Description If E = 1 y = D i where i = (S n-1,.., S 0 ) Else y = 0 E y D 2 n -1 -D 0 (Data input) S n-1,0 (Selector or Address) 5

6 Multiplexer (Mux): Definition Selects between one of N inputs to connect to the output. log 2 N-bit select input – control input 6 E: Enable y: Output S: Selector or Address D0D0 D1D1 0 1 Data input

7 7 PI Q: What is the output of the following MUX? A.0 B.1 C.Can’t say E =1 y S=1 0 1 0 1

8 Multiplexer (Mux): Definition Selects between one of N inputs to connect to the output. log 2 N-bit select input – control input Example: 2:1 Mux 8

9 Multiplexer Definition: Example En y S1S1 S0S0 D0D0 D1D1 D2D2 D3D3 0 1 2 3 9 S1S1 S0S0 y

10 Multiplexer Definition: Example E y S1S1 S0S0 D0D0 D1D1 D2D2 D3D3 0 1 2 3 E=1: If D 0 = 0 and S 1 S 0 = 00 => y = 0 If D 0 = 1 and S 1 S 0 = 00 => y = 1 10

11 Multiplexer: Logic Diagram Logic gates –Sum-of-products form Tristates –For an N-input mux, use N tristates –Turn on exactly one to select the appropriate input 11

12 Multiplexer Application Mux for a Boolean function with truth table as input 12

13 Multiplexer: Application 13

14 Multiplexer Application: universal set {Mux} We use selector to decompose the function into smaller functions (less number of variables), which follows Shannon’s expansion. We simplify the decomposed functions using K-map, which follows consensus theorem. 14

15 Multiplexer Application: universal set {Mux} Example 1: Given f (a,b,c) = Σm (0,1,7) + Σd(2), implement with an 8-input Mux. Id a b c f 0 0 0 0 1 1 0 0 1 1 2 0 1 0 - 3 0 1 1 0 4 1 0 0 0 5 1 0 1 0 6 1 1 0 0 7 1 1 1 1 15

16 Multiplexer Application: universal set {Mux} Example 1: Given f (a,b,c) = Σm (0,1,7) + Σd(2), implement with an 8-input Mux. Id a b c f 0 0 0 0 1 1 0 0 1 1 2 0 1 0 - 3 0 1 1 0 4 1 0 0 0 5 1 0 1 0 6 1 1 0 0 7 1 1 1 1 En y 1 1 0 0 0 0 0 1 a b c S2S2 S1S1 S0S0 0123456701234567 16

17 E y a b S1S1 S0S0 0 1 2 3 Example 2: Given f (a,b,c) = Σm (0,1,7) + Σd(2), implement with 4-input Muxes. 17 a0011a0011 b0101b0101 c = 0 c = 1 D (c) D 0 (c) = D 1 (c) = D 2 (c) = D 3 (c) =

18 a0011a0011 b0101b0101 c = 0 1 - 0 c = 1 1 0 1 D (c) D 0 (c) =1 D 1 (c) =0 D 2 (c) =0 D 3 (c) =c E y 1 0 c a b S1S1 S0S0 0 0 1 2 3 Example 2: Given f (a,b,c) = Σm (0,1,7) + Σd(2), implement with 4-input Muxes. 18

19 a01a01 00 01 10 11 1 1 - 0 0 0 0 1 D (b,c) D 0 (b,c) D 1 (b,c) E 0 1 a y Example 3: Given f (a,b,c) = Σm (0,1,7) + Σd(2), implement with 2- input Muxes. 19

20 a01a01 00 01 10 11 1 1 - 0 0 0 0 1 D (b,c) D 0 (b,c) D 1 (b,c) E b’b’ 0 1 a y D 0 (b,c) = b’D 1 (b,c) = bc 1- 1 0 c b 0 0 1 c b Example 3: Given f (a,b,c) = Σm (0,1,7) + Σd(2), implement with 2- input Muxes. 20 D 1 (b,c)

21 b01b01 c = 0 0 c = 1 0 1 l 1 (0) = 0 l 1 (c) = c E b’b’ 0 1 a y Example 3: Given f (a,b,c) = Σm (0,1,7) + Σd(2), implement with 2- input Muxes. 21

22 D 1 (b,c) b01b01 c = 0 0 c = 1 0 1 l 1 (0) = 0 l 1 (c) = c E E b’b’ 0 1 a b y 0 1 0 c Example 3: Given f (a,b,c) = Σm (0,1,7) + Σd(2), implement with 2- input Muxes. 22

23 4. Demultiplexers E x Control Input 23

24 4. Demultiplexers E x y 2 n -1 -y 0 S(n-1,0) Control Input y i = x if i = (S n-1,.., S 0 ) & E=1 y i = 0 otherwise 24

25 25 Shifters Logical shifter: shifts value to left or right and fills empty spaces with 0’s –Ex: 11001 >> 2 = 00110 –Ex: 11001 << 2 = 00100 Arithmetic shifter: same as logical shifter, but on right shift, fills empty spaces with the old most significant bit (msb). –Ex: 11001 >>> 2 = 11110 –Ex: 11001 <<< 2 = 00100 Rotator: rotates bits in a circle, such that bits shifted off one end are shifted into the other end –Ex: 11001 ROR 2 = 01110 –Ex: 11001 ROL 2 = 00111

26 Shifter Can be implemented with a mux s d yiyi E 1 0 3 2 1 0 x i+1 x i-1 xixi s d xnxn x0x0 x -1 x n-1 y n -1 y0y0 E s / n l / r y i = x i-1 if E = 1, s = 1, and d = L = x i+1 if E = 1, s = 1, and d = R = x i if E = 1, s = 0 = 0 if E = 0

27 27 Shifter Design

28 Barrel Shifter O or 1 shift O or 2 shift O or 4 shift x s0s0 s1s1 s2s2 y 0 1 shift

29 29 Shifters as Multipliers and Dividers A left shift by N bits multiplies a number by 2 N –Ex: 00001 << 2 = 00100 (1 × 2 2 = 4) –Ex: 11101 << 2 = 10100 (-3 × 2 2 = -12) The arithmetic right shift by N divides a number by 2 N –Ex: 01000 >>> 2 = 00010 (8 ÷ 2 2 = 2) –Ex: 10000 >>> 2 = 11100 (-16 ÷ 2 2 = -4)


Download ppt "CSE 140 Lecture 12 Combinational Standard Modules CK Cheng CSE Dept. UC San Diego 1."

Similar presentations


Ads by Google