CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Combinational Logic

The For Loop Variable Bounds Latch

HardLogic CircuitAnalyze

Hardware synthesis tools cannot dynamically execute loops at runtime: they must statically unroll them into physical gates.

The RTL snippet under review shows a combinational block containing a for loop where the upper bound is defined by an input signal N, an 8-bit wire. Inside the loop, an accumulator Y is updated based on an array data_in.

Analyze the synthesized hardware footprint of this block. Determine the logic structures inferred by the variable loop bound and identify why the synthesis tool generates unintended state elements.

Constraints

  • N is an 8-bit unsigned integer input.
  • The loop iterates from 0 to N.
  • data_in is a packed array of 256 8-bit values.
  • Y is updated purely combinationally inside an always @(*) block.

Topics

LatchesRTLSynthesisLoops

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • Binary to HexEasy
  • 1-to-4 Demultiplexer from AND and NOT GatesEasy
  • 2-to-4 Line Decoder with Active-High EnableEasy
  • Hex Nibble to BinaryEasy
  • Odd Parity Bit Generator for 3-bit DataEasy
  • Full Adder from Half AddersEasy
  • Modulo ArithmeticMedium
  • Two's Complement: Encode a Negative DecimalEasy

Browse all problems · Learning tracks