16by1MUX Day3
16by1MUX Day3
16by1MUX Day3
Learnt Verilog Modelling (Behavioral and Structural models) using the 16to1 MUX example.
Experimented to see how it will get synthesized. In all the cases, the tool synthesized to the
ultimate structural design. (low level implementation)
module muxtest;
reg [15:0] A;
reg [3:0] S;
wire F;
endmodule
assign t1 = ~sel;
assign t2 = in[0] & t1;
assign t3 = in[1] & sel;
assign out = t2 | t3;
endmodule
module mux4to1(in, sel, out);
input [3:0] in;
input [1:0] sel;
output out;
wire [1:0] t;
0 A = xxxx, S = x, F = x
5 A = 3f0a, S = 0, F = 0
10 A = 3f0a, S = 1, F = 1
15 A = 3f0a, S = 6, F = 0
20 A = 3f0a, S = c, F = 1
Reference:
NPTEL Video on Hardware Modelling using Verilog by Indranil Sengupta sir.