If you take a piece of paper, a pen printer, scissors and glue ...
Introduction
In the summer computer school, we sometimes offer children to assemble a “bio-computer”, that is, a computing device from what lies literally under their feet. Since children do not know very well how computing devices are arranged, it usually turns out 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 laboratories. The computer is called CARDIAC (CARDboard Illustrative Aid to Computation), which roughly translates to 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 logic device in it. Nevertheless, it allows you to understand some of the principles underlying modern computing. In addition, after a brief search, I found a description and materials for the manufacture of CARDIAC.
How does the computer
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 instruction being executed. In addition, the tape is inserted into the memory block, where the output takes place, and the tape with the 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 if you prefer, you can even write a self-modifying program. Values ​​in the cells are entered using a pencil, and modified using a pencil and eraser. At the same time, the value 01 is always “flashed” in cell 0. It is very convenient to use for increment, since the computer does not have commands with direct values ​​of the arguments.
Here is what the original memory block looks like:
Instruction counter
In the original, the 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 indicate the command counter - I just laid it 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 an operation code. The remaining two digits are usually the address of the cell with which the instruction operates.
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 - the addition of a memory cell to the battery
3 - TAC - go to the specified address if the battery value is negative
4 - SFT - left and right shift operation for a specified number of decimal places
5 - OUT - output of the memory cell to the output tape
6 - STO - write the battery in the memory cell
7 - SUB - subtracting a memory cell from the battery
8 - JMP - unconditional transition to a given address
9 - HRS - stop and reset
Manufacturing computer
I printed the enclosed materials on thick paper, cut out all the necessary holes, inserted moving strips inside and glued both blocks together.
How does all this work?
The functioning of the computer is the sequential execution of instructions. Before you start, you need to look at where the ladybug is (that is, the instruction counter) and move the strips to type in 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 the 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, 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 perform addition / subtraction in a column.
Computer operation example
To begin with, I “entered” (that is, wrote a pencil into memory cells from 17 to 23) the first of the programs listed in the manual:
Address
Value
Decryption
17
034
Enter the value in cell 34
18
035
Enter the value in cell 35
nineteen
134
Copy cell 34 to battery
20
235
Add cell 35 to battery
21
636
Write battery to cell 36
22
536
Display cell 36
23
900
Stop and reset
This program adds two numbers that are 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 further so that the next value appears in the Input window. You will need 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:
"Speed" computer
What is a review of a computer without benchmarks? I took from the manual the following program intended for multiplying two numbers.
Address
Value
Decryption
07
068
Enter values ​​in cell 68
08
404
Zero the battery using a shift of 4 to the right
09
669
Write battery to cell 69
ten
070
Enter values ​​in cell 70
eleven
170
Load cell 70 into battery
12
700
Subtract cell 0 (i.e., value 1) from battery
13
670
Write battery to cell 70
14
319
If the battery has a negative value, then go to the address 19
15
169
Load cell 69 into battery
sixteen
268
Add cell 68 to battery
17
669
Write battery to cell 69
18
811
Go to address 11
nineteen
569
Display cell 69
20
900
Stay
I ran this program for input data 5 and 3. It was necessary to execute 34 instructions, for which it 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).
Contents of memory and output tape
Other programs
The creators of CARDIAC approached the issue seriously and developed (not counting the above) the following programs:
The program for "turning" the number of digits
Bootstrap to load programs from the input tape
Subroutine call mechanism
A program for playing in Him with one pile (that is, the game Bash)