Title: 4-to-1 Multiplexer: Module Instantiation
14-to-1 MultiplexerModule Instantiation
- Discussion D7.2
- Example 5
24-to-1 Multiplexer
- Module Instantiation
- Logic Equation for a 4-to-1 MUX
32 x 1 MUX
y a s b s
44-to-1 Multiplexer
5Multiplexers
z
s1
s0
c0
0 0 c0 0 1 c1 1 0 c2 1 1 c3
c1
z
c2
c3
s0
s1
A multiplexer is a digital switch
0 0
6Multiplexers
z
s1
s0
c0
0 0 c0 0 1 c1 1 0 c2 1 1 c3
c1
z
c2
c3
s0
s1
0 1
7Multiplexers
z
s1
s0
c0
0 0 c0 0 1 c1 1 0 c2 1 1 c3
c1
z
c2
c3
s0
s1
1 0
8Multiplexers
z
s1
s0
c0
0 0 c0 0 1 c1 1 0 c2 1 1 c3
c1
z
c2
c3
s0
s1
1 1
9Creating a 4 x 1 MUX from 2 x 1 MUXs
10// Example 5a 4-to-1 MUX using module
instantiation module mux41 ( input wire 30 c
, input wire 10 s , output wire z ) //
Internal signals wire v // output of mux M1 wire
w // output of mux M2 // Module
instantiations mux21a M1 (.a(c0), .b(c1), .s
(s0), .y(v) ) mux21a M2 (.a(c2), .b(c3),
.s(s0), .y(w) ) mux21a M3 (.a(v), .b(w), .s
(s1), .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(c0), .b(c1), .s(s0), .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(c2), .b(c3), .s(s0), .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(s1), .y(z) )
14mux21a Label1 (.a(a), .b(b), .s(s), .y(y) )
15Aldec Active-HDL Simulation
164-to-1 Multiplexer
- Module Instantiation
- Logic Equation for a 4-to-1 MUX
172 x 1 MUX
y a s b s
18v 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
194-to-1 Multiplexer
z s1 s0 c0 s1 s0 c1 s1
s0 c2 s1 s0 c3