Thursday, January 05, 2012

[jvuutkjy] Toy computer

Create a toy computer, with enough "rope" that the person -- a child -- playing with it can grasp Turing-completeness, with the awesome feeling, like Legos, that one could compute anything with this toy.

Assuming a traditional processor architecture, I'd suggest a 4 bit word size for general purpose registers, because such values can be displayed in a toy-like friendly manner in binary by four LEDs.  One can easily comprehend all 16 possibilities.  (Alternatively: base 10 computer).

A few special registers for accessing memory are much wider. Memory is cheap, so let's provide many gigabytes: You can compute anything with this toy!

ALU operations And, Or, Not, Increment, Decrement, Left and Right Shift by one bit.  Omit Add?

A breakpoint instruction, to freeze and display all the registers.

Obviously, a few more instructions (compare, branch).  What else?

A bit of a problem that the UI will probably require a computer fancier than the toy processor, suggesting it should be emulated,which sort of takes out the coolness.

The UI should support breakpoints, editing assembly language programs, saving and loading programs including old backups, saving and loading macros (an Add macro), maybe saving and loading libraries of functions, though it is "design your own calling convention".  Perhaps a way of sharing programs between different computers.

What peripherals?

An alternative to the traditional processor is a completely different machine architecture, perhaps Lisp?  Atoms are available as picture keys: flower, car, etc.

Yet another implementation might be Turing-complete cellular automata, though we would like to avoid exponential slowdown with the Counter Machine in Conway's Game of Life.

No comments :