Master the fundamental concepts of digital logic & boolean algebra through this focused micro-challenge.
A hardware simulator evaluates gates and wires in topological order. When an input toggles, affected gates recompute and propagate new values downstream. Tools like Logisim, Digital, and Verilog testbenches all follow this pattern.
cLoading…
Your simulator needs a netlist: gates as nodes, wires as edges. Each gate type (NAND, MUX, DFF) registers an evaluation function.
For example, feeding A=1, B=0 into a half-adder should eventually show sum=1, carry=0 on the output probes after one evaluation pass.
For this exercise, you will wire every component built so far into one runnable simulator. You will need to step clocks, load registers, and trace signals through the 4-bit ALU you constructed, mirroring how verification engineers smoke-test RTL before synthesis.
Keep the relevant datasheet, ISA manual, or architecture textbook chapter open while you implement. When your output disagrees with the reference trace on the same program, the bug is usually a mis-decoded opcode, a stale register read, or a flag bit left unchanged after arithmetic.
For this exercise, you will use those habits while implementing the requirement in the starter code. Microarchitectural product names change across CPU generations, but the control ideas (fetch, bypass, cache lines, vector lanes) stay stable enough to debug from first principles.
Create a unified hardware simulator for all digital circuits built so far.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github