Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Constrain three disjoint child arrays

Hardware interview practice

Constrain three disjoint child arrays

MediumConstraintsSystemVerilog

Randomize a unique five-element parent array and three non-empty child arrays whose union equals the parent with no overlap.

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
randomize three children drawn from parent=[10,11,12,13,14]
Expected output
One valid result: a=[10], b=[11,13], c=[12,14]

The children are pairwise disjoint and contain only parent values; many other random partitions satisfy the same constraints.

What to cover

Requirements

  1. Child sizes must sum to the parent size.
  2. Every child element must come from the parent.
  3. Children must be pairwise disjoint and individually unique.
Continue practicing

Related questions

ConstraintsConstrain a DMA transfer to one 4KB page→ConstraintsGenerate a temporal hazard-safe instruction stream→SystemVerilog ConstraintsConstrain one triplicate and seven singletons→
asic.fyi · Learn silicon end to end.info@asic.fyi