Presentation is loading. Please wait.

Presentation is loading. Please wait.

4-to-1 Multiplexer: Module Instantiation Discussion D7.2 Example 5.

Similar presentations


Presentation on theme: "4-to-1 Multiplexer: Module Instantiation Discussion D7.2 Example 5."— Presentation transcript:

1 4-to-1 Multiplexer: Module Instantiation Discussion D7.2 Example 5

2 4-to-1 Multiplexer Module Instantiation Logic Equation for a 4-to-1 MUX

3 2 x 1 MUX y = a & ~s | b & s

4 4-to-1 Multiplexer z 4 x 1 MUX s0s1 c0 c1 c2 c3 z s1s0 0 0 c0 0 1 c1 1 0 c2 1 1 c3

5 Multiplexers z 4 x 1 MUX s0s1 c0 c1 c2 c3 z s1s0 0 0 c0 0 1 c1 1 0 c2 1 1 c3 0 A multiplexer is a digital switch

6 Multiplexers z 4 x 1 MUX s0s1 c0 c1 c2 c3 z s1s0 0 0 c0 0 1 c1 1 0 c2 1 1 c3 0 1

7 Multiplexers z 4 x 1 MUX s0s1 c0 c1 c2 c3 z s1s0 0 0 c0 0 1 c1 1 0 c2 1 1 c3 1 0

8 Multiplexers z 4 x 1 MUX s0s1 c0 c1 c2 c3 z s1s0 0 0 c0 0 1 c1 1 0 c2 1 1 c3 1

9 Creating a 4 x 1 MUX from 2 x 1 MUXs

10 // Example 5a: 4-to-1 MUX using module instantiation module mux41 ( input wire [3:0] c, input wire [1:0] s, output wire z ); // Internal signals wire v;// output of mux M1 wire w;// output of mux M2 // Module instantiations mux21a M1 (.a(c[0]),.b(c[1]),.s(s[0]),.y(v) ); mux21a M2 (.a(c[2]),.b(c[3]),.s(s[0]),.y(w) ); mux21a M3 (.a(v),.b(w),.s(s[1]),.y(z) ); endmodule

11 // Example 4a: 2-to-1 MUX using logic equations module mux21a ( input wire a, input wire b, input wire s, output wire y ); assign y = ~s & a | s & b; endmodule mux21a M1 (.a(c[0]),.b(c[1]),.s(s[0]),.y(v) );

12 // Example 4a: 2-to-1 MUX using logic equations module mux21a ( input wire a, input wire b, input wire s, output wire y ); assign y = ~s & a | s & b; endmodule mux21a M2 (.a(c[2]),.b(c[3]),.s(s[0]),.y(w) );

13 // Example 4a: 2-to-1 MUX using logic equations module mux21a ( input wire a, input wire b, input wire s, output wire y ); assign y = ~s & a | s & b; endmodule mux21a M3 (.a(v),.b(w),.s(s[1]),.y(z) );

14 mux21a Label1 (.a(a),.b(b),.s(s),.y(y) );

15 Aldec Active-HDL Simulation

16 4-to-1 Multiplexer Module Instantiation Logic Equation for a 4-to-1 MUX

17 2 x 1 MUX y = a & ~s | b & s

18 v = ~s0 & c0 | s0 & c1 w = ~s0 & c2 | s0 & c3 z = ~s1 & v | s1 & w z = ~s1 & (~s0 & c0 | s0 & c1) | s1 & (~s0 & c2 | s0 & c3) z = ~s1 & ~s0 & c0 | ~s1 & s0 & c1 | s1 & ~s0 & c2 | s1 & s0 & c3

19 4-to-1 Multiplexer z 4 x 1 MUX s0s1 c0 c1 c2 c3 z s1s0 0 0 c0 0 1 c1 1 0 c2 1 1 c3 z = ~s1 & ~s0 & c0 | ~s1 & s0 & c1 | s1 & ~s0 & c2 | s1 & s0 & c3


Download ppt "4-to-1 Multiplexer: Module Instantiation Discussion D7.2 Example 5."

Similar presentations


Ads by Google