Master the fundamental concepts of digital logic & boolean algebra through this focused micro-challenge.
A half-adder adds two single-bit inputs and produces a sum bit plus a carry-out. It is the atomic building block inside every arithmetic unit, from a 4-bit student ALU to the 64-bit adders in modern x86 cores.
For example, adding 1 + 1 gives sum 0 and carry 1, which is binary 10.
cLoading…
A full-adder adds three bits: A, B, and Cin from the previous stage. Two half-adders plus an OR gate form the standard textbook design.
A + B produces intermediate sum and carryCinFor this exercise, you will wire half-adders into a full-adder using only the gate primitives you already built. You will need carry propagation correct before the ripple-carry adder in the next task can produce 3 + 5 = 8 on four bits.
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.
Build half-adder and full-adder circuits using logic gates.
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