dil01
Newbie level 1
- Joined
- Feb 25, 2014
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 12
i need help understanding this verilog code..
in this code first 2X1 multiplexer is made using gate level model..
then they have used the instance of 2X1 mux to create 4X1 multiplexer..
i dont understand how they have used 2x1 mux in 4x1 generation and then used 2x1 and 4x1 mux to generate 8x1 multiplexer..
can someone plz help and make me understand the code..
Code starts from here
in this code first 2X1 multiplexer is made using gate level model..
then they have used the instance of 2X1 mux to create 4X1 multiplexer..
i dont understand how they have used 2x1 mux in 4x1 generation and then used 2x1 and 4x1 mux to generate 8x1 multiplexer..
can someone plz help and make me understand the code..
Code starts from here
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 module 2-1mux(x,b,a,s); input a,b,s; output x; wire w1,w2,w3; not(w1,s); and(w2,w1,a); and(w3,s,b); or(x,w2,w3); endmodule module 4-1mux(x,data,sel); input [3:0] data; input [1:0] sel; output x; 2-1mux ins1(w1,data[3],data[2],sel[1]); 2-1mux ins2(w2,data[1],data[0],sel[1]); 2-1mux ins3(x,w1,w2,sel[0]); endmodule module 8-1mux(x,data,sel); input [7:0] data; input [2:0] sel; output x; 4-1mux ins1(w1,data[7:4],sel[2:1]); 4-1mux ins2(w2,data[3:0],sel[2:1]); 2-1mux ins3(x,w1,w2,sel[0]); endmodule
Last edited by a moderator: