Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a bounded step-sequence counter

Hardware interview practice

Verify a bounded step-sequence counter

MediumReference ModelsSystemVerilog

Verify a single-request block that counts ordered sequences of one-step and two-step advances for distances from zero through 24.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

logic clk, rst_n, start;
logic [4:0] steps;
logic busy, done, request_error;
logic [31:0] ways;
parameter int MAX_LATENCY = 28;
Reviewed example

Work through one case

Input
request steps=5; then request steps=25
Expected output
steps 5: ways=8,error=0; steps 25: ways=0,error=1

The legal request follows ways(5)=8, while 25 is above the supported bound and returns the defined zeroed error result.

What to cover

Requirements

  1. Predict ways(0)=1, ways(1)=1, and ways(n)=ways(n-1)+ways(n-2).
  2. Return request_error with ways zero for values above 24.
  3. Snapshot steps on acceptance and require one done pulse within the bounded latency.
  4. Ignore busy-time starts and cancel all pending completion obligations on reset.
Continue practicing

Related questions

Reference ModelsScoreboard a maximum-interval accelerator→Reference ModelsVerify a decimal palindrome checker→Reference ModelsVerify duplicate token supply→
asic.fyi · Learn silicon end to end.info@asic.fyi