8-bit CPU.
Features:
- Flexible microcode (up to 4096 microinstructions).
- Each microinstruction can encode multiple operations. All executed at one tick.
- Microcode ROM has main and aux pages.
- Can address up to 256KiB of RAM.
- Segmented memory: 16-bit offset and 8-bit segment form a 18-bit address.
- ALU with add, sub, and logic operations.
- Flags and conditional jumps.
- 16-bit Instruction Pointer.
- 16-bit Stack Pointer.
- +/-1 circuit for IP and SP.
- Two 16-bit general registers D and P formed by four 8-bit registers A, B, X and Y.
To build microassembler run
cmake -B cmake -B cmake
make -C cmakeThen compile microcode for brainfuck
cmake/mas mas/examples/brainfuck/mc.masNow CPU can execute brainfuck programs (, operator is not supported though).
To build Logisim circuit, run
python build.py circThen build the Logisim components using maven
pushd logisim-comps
mvn package
popdNow you can run Logisim
java -jar logisim-comps/src/main/resources/logisim-generic-2.7.1.jarPress Ctrl+O, select .circ file in the repo root dir. Select main rom & ram on the left side.
In Simulate menu enable simulation and ticks. Increase frequency since brainfuck is not very efficient.
After a while you'll see "Hello World!".
