
This project is an 8-bit Interactive Arithmetic Logic Unit (ALU) designed for real-time calculation and hardware verification. The core is built around a two-register architecture (Register A and Register B) and can execute 11 different mathematical and logical operations based on a 4-bit opcode.
To maximize the efficiency of the physical pins and fit within the standard Tiny Tapeout 3x PMOD footprint, the design implements an Output Multiplexer:
uo_out) is multiplexed.Out_Sel control pin, the user can switch the output bus to display either the 8-bit numerical result or the 9th bit (Carry Flag) on the LSB of the output bus.The control bus is routed through the bidirectional pins (uio_in), which are hardware-locked to act strictly as inputs for safety.
The ALU is designed to be driven by a microcontroller or a Raspberry Pi.
rpi_reset pin (uio_in[7]) HIGH to clear the internal registers.ui_in). Pulse Load A (uio_in[0]) or Load B (uio_in[1]) HIGH then LOW to latch the data into the respective internal registers.ALU_OP (uio_in[5:2]). The ALU processes the operation combinationally.Out_Sel (uio_in[6]) to 0 and read the 8-bit result on the output bus (uo_out).
Out_Sel to 1 and read uo_out[0] to check for an Arithmetic Carry or Overflow.Supported Opcodes:
0000: AND0001: OR0010: ADD (with Carry Out)0011: SUB0100: XOR0101: NAND0110: NOR0111: Shift Left1000: Shift Right1001: NOT A1010: NEG A (2's Complement)To fully interact with and verify the ALU, the following external hardware is recommended:
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Data In Bit 0 (LSB) | Result Bit 0 / Carry Flag (When Out_Sel=1) | Load A (Trigger) |
| 1 | Data In Bit 1 | Result Bit 1 | Load B (Trigger) |
| 2 | Data In Bit 2 | Result Bit 2 | ALU_OP [0] |
| 3 | Data In Bit 3 | Result Bit 3 | ALU_OP [1] |
| 4 | Data In Bit 4 | Result Bit 4 | ALU_OP [2] |
| 5 | Data In Bit 5 | Result Bit 5 | ALU_OP [3] |
| 6 | Data In Bit 6 | Result Bit 6 | Out_Sel (0=Result, 1=Flags) |
| 7 | Data In Bit 7 (MSB) | Result Bit 7 (MSB) | Reset (Active High) |