Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ947
Q947DesignArchASIC interview problem

Search a synchronous calibration ROM

TechniquesBinary searchSynchronous ROMFSM
DifficultyEasy
TopicRTL Design
LanguageSystemVerilog
Requirements4 checkpoints
01

Problem

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.

Example input and output

Use this case to check your interpretation
Input
ROM=[2,4,4,4,9]; search key=4
Output
found=1; index=1
Explanation

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

02

Requirements (4)

  • Support N >= 1 even when N is not a power of two.
  • Separate the ROM read-issue cycle from the comparison cycle.
  • Continue toward the left boundary after an equal comparison.
  • Return found = 0 and index zero for a miss, and pulse done after a finite search.