Complete the code to print the value of signal 'a' once using $display.
initial begin a = 1'b0; #5 a = 1'b1; $[1]("Value of a = %b", a); end
The $display command prints the message once at the time it is executed.
Complete the code to continuously print changes of 'b' using $monitor.
initial begin b = 0; $[1]("Time=%0t, b=%b", $time, b); #10 b = 1; #10 b = 0; end
The $monitor command prints the message whenever any variable in the message changes.
Fix the error in the code to correctly display the value of 'c' at time 0.
initial begin c = 1'b1; $[1]("At time %0t, c = %b", $time, c); end
Use $display to print the value once at time 0. $monitor would print continuously.
Fill both blanks to print initial values once and then monitor signals 'x' and 'y'.
initial begin $[1]("x = %b, y = %b", x, y); $[2]("Monitoring signals x and y"); end
Use $display for one-time message and $monitor to watch signals continuously.
Fill all three blanks to display and monitor signals 'p' and 'q' with time info.
initial begin $[1]("Start time: %0t", $time); $[2]("p = %b, q = %b", p, q); $[3]("Monitoring p and q changes"); end
Use $display to print start time and messages once, and $monitor to watch signal changes.
