A Tiny Computer

A Tiny Computer. An unpublished memo by Chuck Thacker, Microsoft Research, 3 September 2007. Posted with permission.

Alan Kay recently posed the following problem:

"I'd like to show JHS and HS kids 'the simplest non-tricky architecture' in which simple gates and flipflops manifest a programmable computer”.

Alan posed a couple of other desiderata, primarily that the computer needs to demonstrate fundamental principles, but should be capable of running real programs produced by a compiler. This introduces some tension into the design, since simplicity and performance sometimes are in conflict.

This sounded like an interesting challenge, and I have a proposed design.

Presents the design of a complete CPU in under two pages of FPGA-ready Verilog. The TC3 is a Harvard architecture 32-bit RISC with 1KB of instruction memory, 1KB of data memory, and 128 general-purpose registers. This design is an ancestor of the DDR2 DRAM Controller used in the BEE3.

To help us into the brave new world of Hardware/Software co-design!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I had a similar idea to

I had a similar idea to Alan's when I visited the Computer History Museum and thought of kids rushing to the museum store looking for stimulating machines to play with at home or on the ride back home... While this is not a mechanical device of the sort I imagined, I think this memo should be printed out and handed to kids visiting the museum!

What I had in mind is things

What I had in mind is things like Cardiac.

Lisp, Forth, and Hardware

Hans Hübner's blog Lisp, Forth, and Hardware also makes my hackstincts twitch.

MIPS

"Computer Organization and Design: The Hardware/software Interface" by Patterson & Hennessy presents a number of implementations of the MIPS instruction set, some of which are rather simple.

It's really easy to find emulators and real compilers and OSes for MIPS, which is a big advantage.

This one is smaller, but also less useful.

Other well supported CPUs that can be implemented quite minimally include the 6502 (not a good compiler target) and ARM.

A somewhat related book.

I've been really enjoying

I've been really enjoying that book lately! I find it much more fun and approachable than other digital logic books that I've seen.

Petzold's CODE is also fantastic

Charles Petzold's CODE : The Hidden Language of Computer Hardware and Software is also great.

He starts out talking about friends using morse code like language, moves up the braille and binary codes, anatomy of a flash light. He doesn't get to "Logic and Switches" until chapter 10 and finishes the book by talking about operating systems, foating point math, high/low languages and finally "The Graphical Revolution."

Possibly simpler non-tricky architectures

Hi, Luke! Anything written by Chuck Thacker is worth reading, if you're into hardware design, anyway, so thanks for posting this gem.

Alan asked for the "simplest non-tricky architecture," so I'm curious why Chuck didn't propose an accumulator or 2-stack machine. Maybe those don't pass Chuck's "non-tricky" test, but eliminating the register file makes the hardware design a bit simpler still.

Incidentally, Alan has quite a few nice things to say about the B5000 architecture in this ACM Queue article. The B5000 was a stack-based architecture, though Alan doesn't mention whether he liked that aspect in particular. Maybe you could ask him ;)

B5000 posted

Hi Drew! Thanks for the prod, I posted the B5000 paper that he raves about.

I would love to see a 32-bit threaded-code Forth machine in two-or-so pages of Verilog!

That was my initial thought

That was my initial thought too, but I haven't finished reading Chuck's note. You can't do away with the register file entirely; "register file" is another word for "RAM"! You can, however, distinguish different parts of it, e.g. to save bits in the instruction encoding, or (as in Forth) to reduce coupling.

STEPS

This is the same design that Thacker proposed in 2007, in the STEPS Toward The Reinvention of Programming: First Year Progress Report. The computer was intended to support the other parts of that project.

It's good to see more information about the processor than just the schematic diagram.

Interesting Architecture

The fact that you can carry out an arithmetic operation and a store at the same time is interesting. The fact that the registers are general purpose, but their are many complex instructions makes this look pretty fun to target. It would be nice to have an actual assembly language rather then just bits. But that shouldn't be two hard. The one problem I would fix is that the skips modify the *next* instruction. Lucky for us jumps don't do that. The limited number of instructions is real problem, as is the absence of a jump to a known offset. Both of these encourage magic constants to be held in registers, which I don't feel leads to understandable assembler. MMIX might be preferable, but it probably goes to far in the other direction.