Skip to content

Instantly share code, notes, and snippets.

@gibiansky
Created November 25, 2012 06:19
Show Gist options
  • Save gibiansky/4142599 to your computer and use it in GitHub Desktop.
Save gibiansky/4142599 to your computer and use it in GitHub Desktop.
Verilog Multiplexer Testbench
module mux_test;
reg a, b, s;
wire out;
mux my_mux(a, b, s, out);
initial begin
a <= 0;
b <= 1;
s <= 0;
#1;
$display("In: %b, %b select %b. Out %b.", a, b, s, out);
#1;
s <= 1;
#1;
$display("In: %b, %b select %b. Out %b.", a, b, s, out);
#1;
a <= 1;
b <= 0;
#1;
$display("In: %b, %b select %b. Out %b.", a, b, s, out);
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment