Interactive boolean logic — click inputs to toggle 0/1 and watch outputs update live
A AND 0 = 0 A AND 1 = A A OR 0 = A A OR 1 = 1
NOT(NOT A) = A NOT(A AND B) = NOT A OR NOT B (De Morgan)
NOT(A OR B) = NOT A AND NOT B (De Morgan) A XOR A = 0
Place gates, connect them with wires, and watch signals propagate. Click a palette item, then click the canvas to place. Click two nodes to connect. Toggle input nodes by clicking them.
Enter a boolean expression using AND, OR, NOT, XOR, NAND, NOR. Variables: A, B, C, D (up to 4). The truth table, SOP form, and Karnaugh map are generated automatically.
A half adder adds two 1-bit inputs. Sum = A XOR B, Carry = A AND B. It has no carry-in, so it can only add the least-significant bit.
A full adder adds three bits: A, B, and a Carry-In. Sum = A XOR B XOR Cin, Carry = (A AND B) OR (Cin AND (A XOR B)). Full adders chain together to add multi-bit numbers.
Four full adders chained: each carry-out feeds the carry-in of the next stage. Enter two 4-bit numbers and watch the carry ripple through all four stages.
An Arithmetic Logic Unit (ALU) is the computational core of a CPU. It performs:
Arithmetic: ADD, SUBTRACT, INCREMENT, DECREMENT, NEGATE
Logic: AND, OR, NOT, XOR, NAND, NOR
Comparison: EQUAL, LESS-THAN, GREATER-THAN (sets flags)
Shift: LEFT SHIFT (×2), RIGHT SHIFT (÷2), ROTATE
A control signal (opcode) tells the ALU which operation to perform. The ALU outputs a result and status flags (zero, carry, overflow, sign).