CARDIAC - do-it-yourself computer made of paper

    If you take a piece of paper, a printer pen , scissors and glue ...


    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:
    AddressValueDecryption
    17034Enter value in cell 34
    18035Enter value in cell 35
    19134Copy cell 34 to battery
    20235Add cell 35 to the battery
    21636Write battery to cell 36
    22536Print cell 36
    23900Stop 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.
    AddressValueDecryption
    07068Enter values ​​in cell 68
    08404Zero the battery by shifting 4 to the right
    09669Write battery to cell 69
    10070Enter values ​​in cell 70
    eleven170Load cell 70 into the battery
    12700Subtract cell 0 (i.e. value 1) from the battery
    thirteen670Write battery to cell 70
    14319If the battery has a negative value, go to address 19
    fifteen169Load cell 69 into the battery
    16268Add cell 68 to the battery
    17669Write battery to cell 69
    18811Go to address 11
    19569Print cell 69
    20900Stay


    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:



    Also popular now: