Version 2 of my Crazy Small CPU
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Examples
Figs
Verilog
Compiler.md
Instructions.md
LICENSE
Makefile
Notes
README.md Oops, another schematic mistake fixed Nov 11, 2017
Schematic.pdf
Usage.md
cas
clc
crazycpu.circ
csim
gen_alu

README.md

Crazy Small CPU, version 2

This repository holds the files associated with Warren's crazy small breadboard CPU built with only eleven chips. For more details on the design of the CPU itself, see the Crazy Small CPU website.

The files are:

  • crazycpu.circ, a version of the CPU that runs in Logisim
  • Schematic.pdf, a PDF version of the CPU's breadboard design done in Kicad
  • cas, the assembler for the CPU
  • clc, a very crude compiler that outputs assembly that can be given to cas
  • csim, a simulator that can run assembled programs. This allows you to test programs without loading them into Logisim or burning ROMs
  • gen_alu, a program to generate the contents of the ALU ROM
  • notes, my journal and notes as I went through the design and implementation stages
  • Makefile, to help make some of the ROM files. make all will build the ALU ROM contents, assemble fibminsky.s and produce the top and bottom control ROM images

Some example programs in the Examples directory include:

  • fibminsky.s, a program that calculates Fibonacci numbers and then draws a sine wave using Minsky's circle algorithm.
  • genfibn, a Perl program that generates the assembly code for the Fibonacci program. You tell it what size Fibonacci number to generate, up to 24 digits.
  • minsky.cl. This is a reimplementation of the Minsky's circle algorithm program in the high-level language, just to test the compiler. Use the Makefile to build minsky, then run csim by hand.
  • bubblesort.s, sort an array of numbers with Bubblesort.
  • circle.s, draw a circle using Minsky's circle algorithm and VT100 escape sequences.
  • decimal.s, print out numbers in decimal.
  • enumttt.s, enumerate winning tic-tac-toe boards.
  • firstfunction.s, an example of function calls and returns.
  • genascii.s, generate all the printable ASCII characters.
  • hanoi.s, perform the Towers of Hanoi algorithm.
  • hexbench2.s, a CPU speed testing program.
  • mel.s, print two stanzas of "Mel the Programmer".
  • printdecs.s, print out numbers in decimal.
  • printhex.s, print one number out in hexadecimal.
  • printhexes.s, print numbers out in hexadecimal.
  • stack.s, an example of a stack and its operations.

The Verilog directory holds an implementation of the CPU in Icarus Verilog. A description of the CPU's instruction set can be found in Instructions.md. A description of the cas assembler and the csim simulator can be found in Usage.md.

If you want to leave any comments, feel free to use the GitHub issues page for this purpose.