Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to end the simulation after displaying the message.
Verilog
initial begin $display("Simulation started"); [1]; end
Attempts:
3 left
💡 Hint
Common Mistakes
Using $stop instead of $finish causes the simulation to pause but not end.
✗ Incorrect
The $finish system task ends the simulation cleanly after displaying the message.
2fill in blank
mediumComplete the code to display "Test complete" and then end the simulation.
Verilog
initial begin $display("Test complete"); [1]; end
Attempts:
3 left
💡 Hint
Common Mistakes
Using $write or $time instead of $finish does not end the simulation.
✗ Incorrect
After displaying the message, $finish ends the simulation.
3fill in blank
hardFix the error in the code to properly end the simulation after printing.
Verilog
initial begin $display("Done"); [1]; end
Attempts:
3 left
💡 Hint
Common Mistakes
Adding parentheses to $finish or $stop causes syntax errors.
✗ Incorrect
In Verilog, $finish is used without parentheses to end the simulation.
4fill in blank
hardFill both blanks to display "Test passed" and then end the simulation.
Verilog
initial begin [1]("Test passed"); [2]; end
Attempts:
3 left
💡 Hint
Common Mistakes
Using $write instead of $display causes no newline after the message.
Using $stop instead of $finish pauses simulation instead of ending it.
✗ Incorrect
Use $display to print the message and $finish to end the simulation.
5fill in blank
hardFill all three blanks to display "All tests done", wait 10 time units, then end the simulation.
Verilog
initial begin [1]("All tests done"); #[2]; [3]; end
Attempts:
3 left
💡 Hint
Common Mistakes
Using $stop instead of $finish ends simulation incorrectly.
Forgetting the delay causes immediate finish without wait.
✗ Incorrect
Use $display to print, #10 to wait 10 time units, and $finish to end the simulation.
