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.
Failed to load latest commit information.
Notes Oops, another schematic mistake fixed Nov 11, 2017

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.
  • 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 A description of the cas assembler and the csim simulator can be found in

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