Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ732
Page ↗
Q732DVASIC interview problem

Verify a channel-capacity optimizer

TechniquesDVFWUVM RALTwo pointersTie-breaking
DifficultyMedium
TopicMemory Systems
LanguageSystemVerilog
Requirements5 checkpoints
01

Problem

Write an independent oracle for a software-programmed static random-access memory (SRAM) optimizer. For endpoints left < right, area is min(height[left], height[right]) times (right - left); return the maximum and the first maximizing pair visited by the specified two-pointer walk.

Example input and output

Use this case to check your interpretation
Input
programmed heights = [1, 8, 6, 2, 5, 4, 8, 3, 7]
Output
maximum_area=49; left_index=1; right_index=8
Explanation

The limiting height is 7 across a width of 7; the two-pointer visit order reaches this first maximizing pair.

02

Requirements (5)

  • Compute the true maximum across every endpoint pair, then emulate a walk beginning at both ends: advance left when the left height is less than or equal to the right height, otherwise decrement right.
  • Return the first pair visited by that walk whose area equals the mathematical maximum.
  • Treat counts outside 2 through 32 as bad_count with zero area and indices.
  • Use widened unsigned arithmetic for the product and make the equal-height branch explicit.
  • Treat accepted-write Register Abstraction Layer (RAL) prediction, start priority, response hold, reset retention, and stale-response checks as follow-up environment design.