Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the initial block.
Verilog
initial begin
[1]
endAttempts:
3 left
💡 Hint
Common Mistakes
Using 'always' inside an initial block.
Trying to declare a module inside the initial block.
✗ Incorrect
The initial block starts with 'initial begin' and inside you can assign initial values like 'clk = 0;'.
2fill in blank
mediumComplete the code to wait for 10 time units inside the initial block.
Verilog
initial begin
#[1];
endAttempts:
3 left
💡 Hint
Common Mistakes
Using a wrong delay value.
Forgetting the semicolon after the delay.
✗ Incorrect
The delay operator '#' followed by a number waits that many time units. Here, '#10;' waits 10 time units.
3fill in blank
hardFix the error in the initial block to assign 1 to signal 'rst' after 5 time units.
Verilog
initial begin
rst = 0;
#[1] rst = 1;
endAttempts:
3 left
💡 Hint
Common Mistakes
Using a signal name instead of a number after '#'.
Missing the semicolon after the delay.
✗ Incorrect
The delay operator '#' must be followed by a number and then a semicolon before the assignment. '#5 rst = 1;' is correct.
4fill in blank
hardFill both blanks to assign 0 to 'clk' and then toggle it after 5 time units.
Verilog
initial begin
clk = [1];
#[2] clk = ~clk;
endAttempts:
3 left
💡 Hint
Common Mistakes
Assigning clk to 1 initially.
Using wrong delay value.
✗ Incorrect
Initially assign clk to 0, then after 5 time units toggle it with '~clk'.
5fill in blank
hardFill all three blanks to create an initial block that sets 'rst' to 1, waits 10 time units, then sets 'rst' to 0.
Verilog
initial begin
rst = [1];
#[2];
rst = [3];
endAttempts:
3 left
💡 Hint
Common Mistakes
Reversing the rst values.
Using wrong delay time.
✗ Incorrect
Set rst to 1, wait 10 time units, then set rst to 0 to simulate a reset pulse.
