CARDIAC - do-it-yourself computer made of paper
If you take a piece of paper, a printer pen , scissors and glue ...

In the summer computer school, we sometimes suggest that children assemble a “biocomputer,” that is, a computing device from what is literally lying under your feet. Since children do not know very well how computing devices are arranged, it usually turns out to be something like a picture under a spoiler. But some still make scores or abacus.
And recently I came across a description of a computer model made of paper, developed in 1968 in Bell's laboratories. The computer is called CARDIAC (CARDboard Illustrative Aid to Computation), which roughly translates as Cardboard Visual Aid for Computing. That is, in fact, this is not exactly a computer, since a person acts as a signal conductor, as well as an arithmetic-logical device in it. Nevertheless, it allows you to understand some of the principles that underlie modern computer technology. In addition, after a brief search, I found a description and materials for the manufacture of CARDIAC.
CARDIAC consists of two blocks - memory and processor. Several paper strips are inserted into the processor unit with the help of which you need to select the executing instruction. In addition, a tape is inserted into the memory block where the output occurs, and a tape with input data is inserted into the processor.

The computer has 100 memory cells with addresses from 00 to 99. Each of them can be used to store one instruction or one three-digit number. Any of the cells can be overwritten, so you can even write a self-modifying program if you wish. The values in the cells are entered using a pencil, and modified using a pencil and an eraser. Moreover, the value 001 is always “flashed” in cell 0. It is very convenient to use it for increment, since the computer does not have commands with direct values of the arguments.
Here's what the original memory block looks like:

In the original, a ladybug is used as an instruction counter, as in the figure above. It is inserted into special holes punched in each of the memory cells. Since I didn’t want to make 100 holes, I used another ladybug to designate the command counter - I just laid it out on the desired cell.

The only register in the computer is the battery. It is used to perform arithmetic operations (addition, subtraction, shift), as well as for conditional transitions. Unlike memory cells, a battery can store 4 decimal places.
Each instruction is encoded using a three-digit decimal number. The first digit is always the operation code. The remaining two digits are usually the address of the cell that the instruction operates on.
CARDIAC can “execute” 10 different instructions (with codes from 0 to 9):
I printed the enclosed materials on thick paper, cut out all the necessary holes, inserted the moving strips inward and glued both blocks.



The functioning of the computer consists in the consistent execution of instructions. Before starting the execution, you need to look at where the ladybug is located (that is, the instruction counter) and moving the strips, type the value from this memory cell in the “Instruction Register” window.

Then you need to follow the arrows, starting with the inscription "Start" and follow all instructions. For example, in the picture above, you must first move the instruction counter forward, and then add the contents of cell 41 to the battery.
Of course, the calculations (addition, subtraction and shift) will have to be done manually. To do this, next to the inscription "Accumulator" there are several windows that allow you to add / subtract in a column.
To begin with, I “entered” (that is, wrote in pencil in memory cells from 17 to 23) the first of the programs listed in the manual:
This program adds two numbers read from the input tape and writes the result to the output tape.
The input instruction reads the value from the input tape, writes it to the specified cell, and then moves the input tape one step forward so that the next value appears in the "Input" window. You will have to use a pencil (and possibly an eraser) to write the value to the memory cell.
After executing this program with input values 42 and 128, the memory state became as follows:

What is a computer review without benchmarks? I took the following program from the manual, designed to multiply two numbers.
I ran this program for input data 5 and 3. In this case, it was necessary to follow 34 instructions, which took me a little less than 15 minutes. Therefore, the frequency of following the instructions for this computer (complete with me) was about 38 MHz (not to be confused with MHz).
The creators of CARDIAC took the matter seriously and developed (apart from the above) the following programs:
Video showing the original:

Introduction
In the summer computer school, we sometimes suggest that children assemble a “biocomputer,” that is, a computing device from what is literally lying under your feet. Since children do not know very well how computing devices are arranged, it usually turns out to be something like a picture under a spoiler. But some still make scores or abacus.
Biocomputer

And recently I came across a description of a computer model made of paper, developed in 1968 in Bell's laboratories. The computer is called CARDIAC (CARDboard Illustrative Aid to Computation), which roughly translates as Cardboard Visual Aid for Computing. That is, in fact, this is not exactly a computer, since a person acts as a signal conductor, as well as an arithmetic-logical device in it. Nevertheless, it allows you to understand some of the principles that underlie modern computer technology. In addition, after a brief search, I found a description and materials for the manufacture of CARDIAC.
How a computer works
CARDIAC consists of two blocks - memory and processor. Several paper strips are inserted into the processor unit with the help of which you need to select the executing instruction. In addition, a tape is inserted into the memory block where the output occurs, and a tape with input data is inserted into the processor.

Memory
The computer has 100 memory cells with addresses from 00 to 99. Each of them can be used to store one instruction or one three-digit number. Any of the cells can be overwritten, so you can even write a self-modifying program if you wish. The values in the cells are entered using a pencil, and modified using a pencil and an eraser. Moreover, the value 001 is always “flashed” in cell 0. It is very convenient to use it for increment, since the computer does not have commands with direct values of the arguments.
Here's what the original memory block looks like:

Instruction counter
In the original, a ladybug is used as an instruction counter, as in the figure above. It is inserted into special holes punched in each of the memory cells. Since I didn’t want to make 100 holes, I used another ladybug to designate the command counter - I just laid it out on the desired cell.

Battery
The only register in the computer is the battery. It is used to perform arithmetic operations (addition, subtraction, shift), as well as for conditional transitions. Unlike memory cells, a battery can store 4 decimal places.
Command system
Each instruction is encoded using a three-digit decimal number. The first digit is always the operation code. The remaining two digits are usually the address of the cell that the instruction operates on.
CARDIAC can “execute” 10 different instructions (with codes from 0 to 9):
- 0 - INP - input value from input tape
- 1 - CLA - loading the contents of the memory cell into the battery
- 2 - ADD - adding a memory cell to the battery
- 3 - TAC - jump to the specified address if the battery value is negative
- 4 - SFT - shift operation left and right by a given number of decimal places
- 5 - OUT - memory cell output to the output tape
- 6 - STO - write the battery to the memory cell
- 7 - SUB - subtraction of the memory cell from the battery
- 8 - JMP - unconditional jump to the specified address
- 9 - HRS - stop and reset
Computer manufacturing
I printed the enclosed materials on thick paper, cut out all the necessary holes, inserted the moving strips inward and glued both blocks.



How does it all work?
The functioning of the computer consists in the consistent execution of instructions. Before starting the execution, you need to look at where the ladybug is located (that is, the instruction counter) and moving the strips, type the value from this memory cell in the “Instruction Register” window.

Then you need to follow the arrows, starting with the inscription "Start" and follow all instructions. For example, in the picture above, you must first move the instruction counter forward, and then add the contents of cell 41 to the battery.
Of course, the calculations (addition, subtraction and shift) will have to be done manually. To do this, next to the inscription "Accumulator" there are several windows that allow you to add / subtract in a column.
Computer example
To begin with, I “entered” (that is, wrote in pencil in memory cells from 17 to 23) the first of the programs listed in the manual:
Address | Value | Decryption |
---|---|---|
17 | 034 | Enter value in cell 34 |
18 | 035 | Enter value in cell 35 |
19 | 134 | Copy cell 34 to battery |
20 | 235 | Add cell 35 to the battery |
21 | 636 | Write battery to cell 36 |
22 | 536 | Print cell 36 |
23 | 900 | Stop and reset |
This program adds two numbers read from the input tape and writes the result to the output tape.
The input instruction reads the value from the input tape, writes it to the specified cell, and then moves the input tape one step forward so that the next value appears in the "Input" window. You will have to use a pencil (and possibly an eraser) to write the value to the memory cell.
After executing this program with input values 42 and 128, the memory state became as follows:

Computer performance
What is a computer review without benchmarks? I took the following program from the manual, designed to multiply two numbers.
Address | Value | Decryption |
---|---|---|
07 | 068 | Enter values in cell 68 |
08 | 404 | Zero the battery by shifting 4 to the right |
09 | 669 | Write battery to cell 69 |
10 | 070 | Enter values in cell 70 |
eleven | 170 | Load cell 70 into the battery |
12 | 700 | Subtract cell 0 (i.e. value 1) from the battery |
thirteen | 670 | Write battery to cell 70 |
14 | 319 | If the battery has a negative value, go to address 19 |
fifteen | 169 | Load cell 69 into the battery |
16 | 268 | Add cell 68 to the battery |
17 | 669 | Write battery to cell 69 |
18 | 811 | Go to address 11 |
19 | 569 | Print cell 69 |
20 | 900 | Stay |
I ran this program for input data 5 and 3. In this case, it was necessary to follow 34 instructions, which took me a little less than 15 minutes. Therefore, the frequency of following the instructions for this computer (complete with me) was about 38 MHz (not to be confused with MHz).
The contents of the memory and output tape

Other programs
The creators of CARDIAC took the matter seriously and developed (apart from the above) the following programs:
- Program for "flipping" the digits of a number
- Bootstrap for loading programs from input tape
- Subroutine call mechanism
- A program for playing Nime with one handful (that is, the game Bachet)
References
Video showing the original:
- Wikipedia page: en.wikipedia.org/wiki/CARDboard_Illustrative_Aid_to_Computation
- Google+ page on your computer: plus.google.com/u/0/communities/105401067945055411018
- DIY Materials: kylem.net/hardware/hardware.html