A basic ALU for the Alchitry CU board and the Alchitry IO board.
git clone https://git.sr.ht/~nytpu/alu cd alu make 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:
||Add||Adds the operands|
||Subtract||Subtracts the operands|
||Invert||Ones complement of operand one|
||AND||Bitwise AND the operands|
||OR||Bitwise OR the operands|
||XOR||Bitwise XOR the operands|
||Shift Left||operand one << operand two|
||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 ~firstname.lastname@example.org