Verilog Programming
Verilog Programming
Verilog Programming
End module
endmodule – ends a module – not a statement
No “;”
It is like opening the loop and closing it to show the finish
module andgate (a,b,y);
input a,b;
output y;
assign y = a & b;
endmodule
With Assign, inputs and outputs are connected via AND gate.
A ANDed with B and will be connected to Y.
Nothing is stored in this scenario and hence there is no need for a register at
all. In case we store, we need a register.
Test Bench
C:\iverilog\bin>vvp AND_gate
000
010
100
111