Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify signed maximum-product ranges

Hardware interview practice

Verify signed maximum-product ranges

MediumReference ModelsSystemVerilog

Implement an exhaustive signed oracle, tagged response checker, and core protocol assertions for an accelerator that returns the maximum product over every nonempty contiguous factor range.

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
signed factors=[-2,3,-4]
Expected output
maximum_product=24; start=0; end=2

The full range product is positive 24 and exceeds every shorter range; widened signed arithmetic avoids truncation.

What to cover

Requirements

  1. Use an independent O(n squared) exhaustive oracle with a full-width signed product rather than duplicating the DUT's running maximum/minimum algorithm.
  2. For equal products, select the lowest start and then the lowest end; reject counts outside 1 through 12 with zeroed results.
  3. List zero, plus/minus one, signed extrema, alternating signs, repeated products, and invalid counts as targeted follow-up stimulus.
  4. Match responses by ID under independent backpressure, flush pending IDs on reset, and detect unknown, duplicate, or missing responses; explain why a generation field or ID quarantine is needed to identify an old response after ID reuse.
  5. Assert payload stability and legal returned ranges; identify sign pattern, winning range, tie type, arithmetic boundary, response order, and reset as follow-up coverage dimensions.
Continue practicing

Related questions

Reference ModelsMatch out-of-order packets by ID→Reference ModelsVerify a minimum energy-window engine→Reference ModelsVerify a dominant-opcode window analyzer→
asic.fyi · Learn silicon end to end.info@asic.fyi