This project implements a 4-bit Arithmetic Logic Unit (ALU) with flags, designed for integration in the Tiny Tapeout sky25a shuttle. The ALU performs arithmetic, logical, shift, and comparison operations on two 4-bit operands (A[3:0] and B[3:0]).
The design also generates status flags:
Carry (unsigned overflow/borrow)
Zero (result is zero)
Negative (sign bit of result)
Overflow (signed overflow)
This makes it suitable as a basic CPU building block or as a teaching/demo chip.
Connect 8 toggle switches to ui_in[7:0] (for A and B). Connect 4 toggle switches to uio_in[3:0] (for ALU_Sel). Connect 8 LEDs (with resistors ~330 Ω) to uo_out[7:0]. LED LEDs [7:4] = Flags (Carry, Zero, Neg, Ovf)
List external hardware used in your project (e.g. PMOD, LED display, etc), if any
# | Input | Output | Bidirectional |
---|---|---|---|
0 | A[0] | ALU_out[0] | ALU_sel[0] |
1 | A[1] | ALU_out[1] | ALU_sel[1] |
2 | A[2] | ALU_out[2] | ALU_sel[2] |
3 | A[3] | ALU_out[3] | ALU_sel[3] |
4 | B[0] | Overflow_out | |
5 | B[1] | Negative_out | |
6 | B[2] | Zero_out | |
7 | B[3] | Carry_out |