Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Assert an integer square-root pipeline

Hardware interview practice

Assert an integer square-root pipeline

HardTemporal ChecksSystemVerilog

Check a 32-bit floor-square-root block with fixed 16-cycle latency, one outstanding request, and a backpressured response. Verify both protocol timing and the arithmetic result.

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 →
Reviewed example

Work through one case

Input
accept radicand=27 at cycle0; response first asserts at cycle16 with root=5,remainder=2 and stalls until cycle18
Expected output
fixed latency PASS; arithmetic PASS; root/remainder/valid stable through acceptance at cycle18

Five squared is 25 <= 27, six squared is 36 > 27, and remainder 27-25 is two; ready does not alter assertion latency.

What to cover

Requirements

  1. Associate each accepted radicand with the response that first asserts exactly LATENCY cycles later, regardless of rsp_ready.
  2. Check root squared is at most the radicand and the next root squared is greater, using widened products that represent 65536 squared.
  3. Check remainder equals radicand minus root squared on every accepted response.
  4. Hold rsp_valid, root, and remainder stable throughout response stalls.
  5. Cancel pending latency obligations on reset and cover boundary, perfect-square, near-square, and stalled cases.
Continue practicing

Related questions

Temporal ChecksOverlapped versus non-overlapped implication in SVA→Temporal ChecksAssert bounded eventual completion→Temporal ChecksProve an elastic one-hot checker→
asic.fyi · Learn silicon end to end.info@asic.fyi