Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify matrix zero propagation

Hardware interview practice

Verify matrix zero propagation

MediumReference ModelsSystemVerilog

Implement a two-pass predictor and two-entry tagged scoreboard for a matrix sanitizer that zeroes every row and column containing an original zero without cascading from newly written zeroes.

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
matrix=[[1,2,0],[4,5,6]]
Expected output
sanitized=[[0,0,0],[4,5,0]]

Only original row 0 and original column 2 are marked; zeroes written during transformation do not cascade into row 1.

What to cover

Requirements

  1. Deep-copy each accepted matrix and derive row and column masks exclusively from the untouched original snapshot.
  2. Match up to two outstanding responses by ID, compare every coordinate, and diagnose the first mismatch with the original matrix and both masks.
  3. Reject duplicate or unknown responses and flush accepted work on reset.
  4. Explain why no-zero, single-zero, intersecting, edge, full-row, full-column, all-zero, and non-square cases are useful follow-up tests.
asic.fyi · Learn silicon end to end.info@asic.fyi