
A 2-bit ALU built from discrete logic gates — no microcontroller. Takes two 2-bit numbers (A and B) and a 2-bit opcode, computes all four operations in parallel (ADD, AND, OR, NOT A), then uses a 2-to-4 decoder and output selector to route the correct result to a 7-segment display showing digits 0–3.
Set IN0–IN1 for input A, IN2–IN3 for input B, and IN4–IN5 for the operation (00=ADD, 01=AND, 10=OR, 11=NOT A). The 7-segment display shows the result. Toggle IN0 ON with everything else OFF — display should show 1. Toggle IN0 and IN2 ON — display should show 2. External hardware 7-segment display on OUT0–OUT6. DIP switches on IN0–IN5.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | ATOGGLE | G | O |
| 1 | ITOGGLE | H | P |
| 2 | A | I | Q |
| 3 | B | J | R |
| 4 | C | K | S |
| 5 | D | L | T |
| 6 | E | M | U |
| 7 | F | N | V |