Skip to content

mp2720/k8-18

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K8-18

8-bit CPU.

Schema

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.

Build and run an example microcode and program

To build microassembler run

cmake -B cmake -B cmake
make -C cmake

Then compile microcode for brainfuck

cmake/mas mas/examples/brainfuck/mc.mas

Now CPU can execute brainfuck programs (, operator is not supported though).

To build Logisim circuit, run

python build.py circ

Then build the Logisim components using maven

pushd logisim-comps
mvn package
popd

Now you can run Logisim

java -jar logisim-comps/src/main/resources/logisim-generic-2.7.1.jar

Press 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!".

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors