RTL Design · Medium · SystemVerilog

Cache Address Decode

Split a 32-bit byte address into tag, index and word offset fields for a small direct-mapped cache.

Task

Use a 16-line cache with 4 words per line. Produce a 24-bit tag, 4-bit line index and 2-bit word offset from address bits.

Examples

Constraints

What this problem is testing

A strong answer translates the requirement into synthesizable state and combinational logic, states reset and update semantics precisely, and handles boundary conditions rather than only the nominal case.

Interview habit: before coding, state reset behavior, the state that must be stored, and the conditions that update each output.

Verification plan

Edge cases worth testing

Common mistakes

Interview follow-up questions

Concepts to review

cache, addressing, tag/index/offset

Open Cache Address Decode in the HDLForge interactive editor.

Related problems

Explore the RTL Design Practice & Interview Preparation hub.

Continue practising