Question: Using the verilog code and 1x2 decoder diagram shown below, write a program for the 2x4 decoder diagram. Use arrays. module DecoderMod(s, o); // module
Using the verilog code and 1x2 decoder diagram shown below, write a program for the 2x4 decoder diagram. Use arrays.

module DecoderMod(s, o); // module definition input s; output [0:1] o; not(o[0], s); assign o[1] = s; endmodule module TestMod; reg s; wire [0:1] o; DecoderMod my_decoder(s, o); // create instance initial begin $monitor("%0d\t%b\t%b", $time, s, o); $display("Time s o"); $display("--------------"); end initial begin s = 0; #1; s = 1; #1; s = 0; #1; s = 1; end endmodule 2x4 diagram:

1x2 module DecoderMod (s, o); // module definition S Decoder input s; output [0:1] o; not (o[0], s); assign o[1] s; endmodule o0 module TestMod; reg si wire [0:1] o; DecoderMod my_decoder(s, o); // create instance initial begin $monitor("Xodit%b\t%", Sdisplay ("Time s o"); $display(" Stime, s, o); "); end initial begin end endmodule
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
