Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a decimal palindrome checker

Hardware interview practice

Verify a decimal palindrome checker

MediumReference ModelsSystemVerilog

Verify a single-request block that reports whether a signed 32-bit value reads the same forward and backward in ordinary decimal notation.

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 signed [31:0] number;
logic busy, done;
logic request_error, is_palindrome;
parameter int MAX_LATENCY = 12;
Reviewed example

Work through one case

Input
accept number=12321; change live input bus to 99 while busy
Expected output
palindrome=1 for captured 12321; exactly one done pulse

The accepted request is snapshotted, so later input changes cannot alter the decimal reversal result.

What to cover

Requirements

  1. Accept a request only when start is high and busy is low, and snapshot the accepted number.
  2. Treat every negative number as false, zero as true, and trailing-zero values such as 10 as false.
  3. Require exactly one done pulse within 1 through MAX_LATENCY cycles unless reset cancels the request.
  4. Compare both completion outputs, ignore later input changes, and cover busy starts and reset during work.
Continue practicing

Related questions

Reference ModelsVerify duplicate token supply→Reference ModelsScoreboard a maximum-interval accelerator→Reference ModelsBuild a FIFO reference model→
asic.fyi · Learn silicon end to end.info@asic.fyi