Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Search a synchronous calibration ROM

Hardware interview practice

Search a synchronous calibration ROM

HardRTL DesignSystemVerilog

Search a nondecreasing local calibration table through a one-cycle synchronous read-only memory (ROM) port. Report whether the key exists and, for duplicates, return its lowest index.

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
ROM=[2,4,4,4,9]; search key=4
Expected output
found=1; index=1

An equal comparison records a candidate but continues the binary search left, with each ROM issue separated from its next-cycle comparison.

What to cover

Requirements

  1. Support N >= 1 even when N is not a power of two.
  2. Separate the ROM read-issue cycle from the comparison cycle.
  3. Continue toward the left boundary after an equal comparison.
  4. Return found = 0 and index zero for a miss, and pulse done after a finite search.
asic.fyi · Learn silicon end to end.info@asic.fyi