Testing a module with $monitor
//test for behaviorial AND2 module
AND2 a2(in1,in2,out); //instantiate AND2 module
initial begin //Generate test data
$monitor("Time=%0d in1=%b in2=%b out=%b",$time, in1, in2, out);
Need to use registers here for stable monitoring
Constantly monitors input. Will display info at every input change