A turing complete Von-Neumann 8-bit computer build entirely in Logisim Evolution.
On the diagramm below the spatial positon of different modules inside the computer can be seen. Thick lines represent the data flow and thin lines show the clock propagation paths.
In order to be able to experiment and test the 8-bit-compuer the Logisim Evoltuion is required. It is simple:
- Install Logisim Evoltuion on your system.
- Open the 8_bit_computer.circ.
The standard Logisim might work, though this has never been tested.
This computer has a total of 16 byte of RAM and has the following set of assembly instructions:
NOP->0000-> No operationLDA X->0001-> Load a value from RAM at the addressXinto theA rigisterADD X->0010-> Add a value from RAM at the addressXto theA rigisterand store it in theA rigisterSUB X->0011-> Subtruct a value from RAM at the addressXfromA rigisterand store it in theA rigisterSTA X->0100-> Load a value from theA rigisterinto RAM at the addressXLDI X->0101-> LoadXinto theA rigisterJMP X->0110-> Jump to the instructionXJC X->0111-> Jump to the instructionXif the carry flag is setJZ X->1000-> Jump to the instructionXif the zero flag is setOUT->1110-> Output the contents of theA rigisterHLT->1111-> Halt (Not implemented yet)
- Create a file containing your valid assembly instruction ( please think of the the limitaions of the 16-byte RAM)
- Compile it using the
assembly-compiler:- Make sure you have
RUSTinstalled on your machine - Navigate to the
assembly-compilerfolder - Compile using the following command
cargo run -- -i <your_assembly_file> -o <output_file_path> -l
- Make sure you have
- Copy the contents of the output file into the RAM module:
- Right click on the
PRAM - Select
Edit Contents.... - Select the fist address.
- Paste the contens of your compiled code using
v.3.0 hex,wordsandaddressedas settings. - Click
Ok.
- Right click on the
- Set
PRAMpin to1/Highin order to switch to programmable memory. - Start the clock (cmd + k)
- Set the
MANUALpin to1/High - Set the
RIpin1/High - Set the address using the pins
A0-A3 - Set the assembly opcode (and the
Xif needed) usingD0-D7 - Puls the clock
HighandLow(cmd + t) - Repeat for all the other instruction After writing all the instructions and data to the RAM:
- Set the
MANUALpin back to0/Low - Reset the computer using the
RESETbutton - Start the clock (cmd + k)
For Control Unit to work correctly it has to be programmed. The code for generatin of the ROM microinstruction is written in C and produces a file called control_unit which has the microcode in it. In most cases one does not have to reprogramm the ROM. In case if it has to be done:
- Modify the microcode_gen.c if needed.
- Compile and run the program.
- Open 8_bit_computer.circ in Logisim Evolution.
- Right click on the Control Unit ROM.
- Select
Edit Contents.... - Select the fist address.
- Paste the contens of generated control_unit using
v.3.0 hex,wordsandaddressedas settings. - Click
Ok.
This project was inspited by the works of Ben Eater and his tutorial series on building an 8-bit breadboard computer!. Some of the designs were take directly from his videos and some were modified. Also some parts of microcode_gen.c were taken from the eeprom-programmer of Ben Eater.
