The design for a simple portable computer that only requires a pen and a piece of paper.
The computer consists of a sheet of paper that contains both the program as well as a number of data registers, that will be used to represent the contents of the registers.
To begin, the pen, representing the program counter, is positioned at the line
00 of a program. The instruction in that line is then processed by the user by either moving the pen(program counter), modifying the value of a data register or by checking if a data register has become “empty”(zeroed).
Most models contain a few arithmetic operations and at least one conditional operation. Three base models, each using three instructions, are drawn from the following collection. In addition, a machine usually has a HALT instruction, which stops the machine.
- CLR(r): CLeaR register r. (Set r to zero.)
- INC(r): INCrement the contents of register r.
- DEC(r): DECrement the contents of register r.
- CPY(rj, rk): CoPY the contents of register rj to register rk leaving the contents of rj intact.
- JZ(r, z): IF register r contains Zero THEN Jump to instruction z ELSE continue in sequence.
- JE(rj, rk, z): IF the contents of register rj Equals the contents of register rk THEN Jump to instruction z ELSE continue in sequence.
The following three counter machine models have the same computational power since the instructions of one model can be derived from those of another:
- INC(r), DEC(r), JZ(r, z) — Minsky (1961, 1967), Lambek (1961)
- CLR(r), INC(r), JE(rj, rk, z) — Ershov (1958), Peter (1958)
- INC(r), CPY(rj, rk), JE(rj, rk, z) — Elgot-Robinson (1964), Minsky (1967)
WDR Instruction Set
The WDR paper computer or Know-how Computer is an educational model of a computer consisting only of a pen, a sheet of paper, and individual matches in the most simple case. The instruction set of five commands is small but Turing complete and therefore enough to represent all mathematical functions: incrementing ("inc") or decrementing ("dec") a register, unconditional jump ("jmp"), conditional jump ("isz", skips next instruction if a register is zero), and stopping program execution ("stp").
|END||Aborts the execution of your program, so that you can examine the contents of your data registers.|
|SKP(r)||Checks if the data register r is zero. If it is zero, the program counter is increased by 2, otherwise the program counter is increased only by 1.|
|JMP(z)||Sets the program counter to line number z.|
|INC(r)||Increments the contents of the data register r and increases the program counter by 1.|
|DEC(r)||Decrements the contents of the data register r and increases the program counter by 1.|
CARDIAC Instruction Set
CARDIAC (CARDboard Illustrative Aid to Computation) is a learning aid developed for Bell Telephone Laboratories in 1968 to teach high school students how computers work. The computer operates in base 10 and has 100 memory cells which can hold signed numbers from 0 to ±999. It has an instruction set of 10 instructions which allows CARDIAC to add, subtract, test, shift, input, output and jump.
|INP||Input||take a number from the input card and put it in a specified memory cell.|
|CLA||Clear and add||clear the accumulator and add the contents of a memory cell to the accumulator.|
|ADD||Add||add the contents of a memory cell to the accumulator.|
|TAC||Test accumulator contents||performs a sign test on the contents of the accumulator; if minus, jump to a specified memory cell.|
|SFT||Shift||shifts the accumulator x places left, then y places right, where x is the upper address digit and y is the lower.|
|OUT||Output||take a number from the specified memory cell and write it on the output card.|
|STO||Store||copy the contents of the accumulator into a specified memory cell.|
|SUB||Subtract||subtract the contents of a specified memory cell from the accumulator.|
|JMP||Jump||jump to a specified memory cell. The current cell number is written in cell 99. This allows for one level of subroutines by having the return be the instruction at cell 99 (which had '8' hardcoded as the first digit.|
|HRS||Halt and reset||move bug to the specified cell, then stop program execution.|
To encode a WDR program into a 8-bits punched card, we could use 3 bits of space to encode the operation, which leaves 5 bits for the value. This computer's programs uses only 5 operations out of a possible 8, leaving 3 unused.
The following program subtracts from
R1 and adds to
R0 until the value of
R1 is zero. The result of the addition of
R1 will be stored in
The binary expression of the operation and value of the previous program can be encoded vertically as the following punched card:
v v v v v v • • • • • • • • • • •
Ref. 5-bits Table
The following table show the binary table for 32 addressable lines of a program.
Incoming: nibble dice virtual machines uxn devlog