CARDboard Illustrative Aid to Computation
CARDIAC (CARDboard Illustrative Aid to Computation) was a learning aid developed by David Hagelbarger and Saul Fingerman for Bell Telephone Laboratories in 1968 to teach high school students how computers work. The kit consisted of an instruction manual and a die-cut cardboard "computer".
The computer "operated" by means of pencil and sliding cards. Any arithmetic was done in the head of the person operating the computer. The computer operated in base 10 and had 100 memory cells which could hold signed numbers from 0 to ±999. It had an instruction set of 10 instructions which allowed CARDIAC to add, subtract, test, shift, input, output and jump.
The “CPU” of the computer consisted of 4 slides that moved various numbers and arrows to have the flow of the real CPU (the user's brain) move the right way. They had one flag (+/-), affected by the result in the accumulator.
Memory consisted of the other half of the cardboard cutout. There were 100 cells. Cell 0 was “ROM”, always containing a numeric "1"; cells 1 to 98 were “RAM”; available for instructions and data; and cell 99 could best be described as “EEPROM”.
Memory cells held signed decimal numbers from 0 to ±999 and were written with a pencil. Cells were erased with an eraser. A “bug” was provided to act as a program counter, and was placed in a hole beside the current memory cell.
CARDIAC had a 10 instruction machine language. An instruction was three decimal digits (the sign is ignored) in the form
OAA. The first digit was the op code (
O); the second and third digits were an address (
AA). Addressing was one of accumulator to memory absolute, absolute memory to accumulator, input to absolute memory and absolute memory to output.
High level languages were never developed for CARDIAC, since they would defeat one of the purposes of the device, to introduce concepts of assembly language programming.
Programs were hand assembled, then written, by pencil into the appropriate memory cells.
|0||INP||Input||take a number from the input card and put it in a specified memory cell.|
|1||CLA||Clear and add||clear the accumulator and add the contents of a memory cell to the accumulator.|
|2||ADD||Add||add the contents of a memory cell to the accumulator.|
|3||TAC||Test accumulator contents||performs a sign test on the contents of the accumulator; if minus, jump to a specified memory cell.|
|4||SFT||Shift||shifts the accumulator x places left, then y places right, where x is the upper address digit and y is the lower.|
|5||OUT||Output||take a number from the specified memory cell and write it on the output card.|
|6||STO||Store||copy the contents of the accumulator into a specified memory cell.|
|7||SUB||Subtract||subtract the contents of a specified memory cell from the accumulator.|
|8||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.|
|9||HRS||Halt and reset||move bug to the specified cell, then stop program execution.|
Programs were run by first sliding three slides so that the number in the instruction register equaled the number in the memory cell the bug was sitting in. Once that was done the bug was moved to the next memory cell. The user then followed an arrow which would then tell them what to do next. This would continue for all of program execution.
- Little man computer (another instructional model)
- http://www.sourceforge.net/projects/cinc/ - a simulator for the Java platform, with both command-line and GUI interfaces, is a Sourceforge project called jcinc.
- http://www.kaleberg.com/software/cardiac/ - a simulator hosted on Macintosh, Windows (untested), and Linux (untested). Simulator provides editor, simple assembler, and examples. As described on the page, opcodes 0 and 9 are interchanged. Simulator source code appears to be proprietary, free downloads.
- http://www.drdobbs.com/embedded-systems/cpu-design-on-paper/240153480 - Al Williams published a spreadsheet version of CARDIAC on the Dr. Dobb's site
- http://www.drdobbs.com/embedded-systems/paper-to-fpga/240155922 - Al Williams' FPGA implementation of CARDIAC on an FPGA board (final article of a series on Dr. Dobb's web site)