a basic alu designed for the alchitry cu
delete needless demo section
added demo video
add bit shifting operations



You can also use your local clone with git send-email.

#fpga alu

A basic ALU for the Alchitry CU board and the Alchitry IO board.

watch a demo here


git clone https://git.sr.ht/~nytpu/alu
cd alu
make load


Load onto board with make load. There is no external circuit to build, just make sure the FPGA has a good power source and that the Alchitry IO board is properly connected onto the CU.

Input is done with the banks of dip switches and the center button on the button pad. The middle button on the 5-button pad is used to execute on the current input and display it. The output is displayed in hex on the 7-segment display. Press the reset button to reinitialize.

The leftmost bank of dip switches is the Command. Select a command by entering it's command number in binary. The list of possible commands are:

# (Binary) Command Description
00000001 Add Adds the operands
00000010 Subtract Subtracts the operands
00000011 Invert Ones complement of operand one
00000100 AND Bitwise AND the operands
00000101 OR Bitwise OR the operands
00000110 XOR Bitwise XOR the operands
00000111 Shift Left operand one << operand two
00001000 Shift Right operand one >> operand two

The middle bank of DIP switches is Operand One. The rightmost bank of dip switches is Operand Two. Enter in a number in binary for both.

Once the command and both operands are entered properly, press the center button to execute the command and display the output.


send patches, suggestions, and bug reports to ~nytpu/public-inbox@lists.sr.ht