Circuit challenges
Build each circuit in the editor from the parts allowed, within the gate budget. It is simulated on every input it can see, and a first pass earns XP. Sign in to keep your XP; you can try them all without an account.
Beginner
Half adder
15 XPAdd two bits. sum is the low bit of a + b, carry the high bit.
at most 2 gates · xor, and
NOT from NAND
15 XPNAND is universal: every gate can be built from it. Start with the inverter. y is the opposite of a.
at most 1 gate · nand
AND from NAND
15 XPBuild y = a AND b from NAND gates alone.
at most 2 gates · nand
OR from NAND
15 XPBuild y = a OR b from NAND gates alone.
at most 3 gates · nand
Even parity bit
15 XPp makes the number of 1s among a, b, c, d and p even, as a simple error check on a 4-bit word would.
at most 3 gates · xor
T flip-flop from D
15 XPOn each rising clock edge q toggles if t is 1 and holds if t is 0. Use a D flip-flop.
at most 1 gate · dff, xor
Core
XOR from four NANDs
25 XPBuild y = a XOR b from at most four NAND gates. The obvious way takes five.
at most 4 gates · nand
Full adder from NAND
25 XPAdd three bits: a + b + cin gives sum and cout, using at most nine NAND gates.
at most 9 gates · nand
4:1 multiplexer from gates
25 XPy follows d0 to d3, chosen by the select lines: s1 s0 = 00 picks d0, 11 picks d3.
at most 13 gates · not, and, or
2-bit comparator
25 XPCompare two unsigned 2-bit numbers: exactly one of gt, eq and lt is 1.
at most 12 gates · not, and, or, xor, nand, nor, xnor
4-bit ripple-carry adder
25 XPAdd two 4-bit numbers and a carry in. Split the buses into bits, chain four full adders, and merge the sum.
at most 20 gates · xor, and, or
JK flip-flop from D
25 XPOn each rising edge: j k = 00 holds, 01 resets, 10 sets, 11 toggles.
at most 5 gates · dff, not, and, or
Mod-6 counter
25 XPq counts 0, 1, 2, 3, 4, 5 and back to 0, one step per rising clock edge. It starts at 0.
at most 8 gates · dff, not, and, or, xor, nand, nor, xnor
GATE
BCD to 7-segment
40 XPDrive segments a to g for the digit on bcd, 0 to 9. Inputs 10 to 15 never occur, so use them as don't-cares. 6 and 9 have their tails, and 7 is a, b, c.
at most 36 gates · not, and, or, xor, nand, nor, xnor
Traffic light
40 XPExactly one of green, yellow and red is on. It starts green, then each rising clock edge moves green to yellow to red to green.
at most 3 gates · dff, not, and, or, xor, nand, nor, xnor
101 sequence detector
40 XPWatch the serial input x, sampled on each rising clock edge. After an edge, y is 1 exactly when the last three bits sampled were 1, 0, 1; overlaps count, so 10101 gives two hits. This is a Moore machine: y doesn't change with x between edges.
at most 8 gates · dff, not, and, or, xor, nand, nor, xnor