Recall & Review
beginner
What is a Modulo-N counter in Verilog?
A Modulo-N counter is a digital counter that counts from 0 up to N-1 and then resets back to 0, repeating this cycle continuously.
Click to reveal answer
beginner
How do you reset a Modulo-N counter in Verilog?
You use a reset signal (usually asynchronous or synchronous) that sets the counter value back to 0 when activated.
Click to reveal answer
beginner
Explain the role of the modulus value N in a Modulo-N counter.
The modulus value N defines the number of unique states the counter cycles through before restarting at zero. The counter counts from 0 to N-1.
Click to reveal answer
beginner
What happens when the counter reaches N-1 in a Modulo-N counter?
When the counter reaches N-1, on the next clock pulse it resets to 0 and starts counting again.
Click to reveal answer
intermediate
Write a simple Verilog snippet to implement a Modulo-4 counter with synchronous reset.
module mod4_counter(
input clk,
input reset,
output reg [1:0] count
);
always @(posedge clk) begin
if (reset)
count <= 0;
else if (count == 3)
count <= 0;
else
count <= count + 1;
end
endmodule
Click to reveal answer
What does a Modulo-N counter do when it reaches its maximum count?
✗ Incorrect
A Modulo-N counter resets to zero after reaching its maximum count (N-1) and continues counting from there.
In Verilog, which keyword is used to describe behavior that happens on a clock edge?
✗ Incorrect
The 'always @(posedge clk)' block describes behavior triggered on the rising edge of the clock signal.
If a Modulo-8 counter counts from 0, what is the highest value it reaches before resetting?
✗ Incorrect
A Modulo-8 counter counts from 0 up to 7 (which is 8-1) before resetting to 0.
What type of reset sets the counter value back to zero immediately, regardless of the clock?
✗ Incorrect
An asynchronous reset sets the counter to zero immediately, without waiting for a clock edge.
Which Verilog data type is commonly used to store the count value in a Modulo-N counter?
✗ Incorrect
The 'reg' type is used to store values that change inside always blocks, such as the count in a counter.
Describe how a Modulo-N counter works and how you would implement it in Verilog.
Think about counting steps and when to reset.
You got /4 concepts.
Explain the difference between synchronous and asynchronous reset in a Modulo-N counter.
Consider when the reset affects the counter value.
You got /3 concepts.