Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ577
Page ↗
Q577DesignASIC interview problem

Merge two sorted ready/valid streams

TechniquesReady/validMergeBackpressure
DifficultyHard
TopicStreaming RTL
LanguageSystemVerilog
Requirements5 checkpoints
01

Problem

Merge two nonempty finite streams of nondecreasing 16-bit values into one ordered ready/valid stream. Preserve duplicates and choose stream A first when both head values are equal.

Example input and output

Use this case to check your interpretation
Input
stream A=[1,3,3]; stream B=[2,3]
Output
accepted output=[1(A),2(B),3(A),3(A),3(B)]; last=1 only on final B
Explanation

Equal heads select A one beat at a time, preserving both duplicates and consuming exactly one stream per output handshake.

02

Requirements (5)

  • Buffer only the current head of each input stream.
  • Require at least one accepted item on each input; this data-plus-last interface does not encode an empty frame.
  • Consume exactly one input for each accepted output and never discard both heads on a tie.
  • Hold output valid, data, and last stable while the consumer stalls.
  • Assert out_last only on the final item after both input streams have ended.