CARDIAC A cardboard illustrative aid to computation illustrates

CARDIAC A cardboard illustrative aid to computation • illustrates the operation of a computer • demos basic units of a simple computer – – – input memory accumulator program output

Simple Computer Block Diagram output program unit input memory accumulator

SIMCO Instruction register Program unit Program counter Control unit


The IR The function of the instruction register is to store each instruction word during the time that particular instruction is being executed. Once this instruction is executed, the IR is fed a new (instruction) word.

CARDIAC’s IR

Program Counter (PC)

Program counter “bug” CARDIAC’s PC Program counter “bug” Note: it has Moved to Next instr

Flow Chart Start receive numbers to be added do addition announce answer stop

Start Turn on computer READ FIRST NUMBER Take 1 st no. , from input and store in memory READ SECOND NUMBER Take 2 nd no. , from input and store in memory PUT 1 ST NUMBER IN ACCUMULATOR ADD SECOND NUMBER TO FIRST STORE SUM IN MEMORY PRINT SUM Stop clear acc and transfer 1 st no. to it from memory transfer 2 nd no. from mem to acc and add it to 1 st transfer sum from acc to memory transfer sum from mem to output and print

017 018 117 218 619 519 read first number read second number put first in accumulator add second to the first store sum in memory print sum memory location operation code } computer word

MEMORY 00 05 01 02 03 04 SIMCO has 100 addresses (00 through 99) addresses

CADIAC’s memory

Converting SIMCO to THE Stored-Program Mode Instruction Register + Program Unit = Program Counter + Control Unit

input control cell selector output accumulator op code memory address instruction register (IR) program counter cells

Program Example 017 018 117 218 619 519 read (input) first number read second number put first number into the accululator add second number to the first store sum in memory location 19 print the sum Memory locations Operation codes(op codes)

Op codes cardiac Instruction Set ============ Op Code Abbr. Meaning -----------------0 INP Input. Read from input device 1 CLA Clear accumulator and add 2 ADD Add to accumulator 3 TAC Test accumulator contents 4 SFT Shift accumulator contents 5 OUT Output. Write to output device 6 STO Store accumulator to memory cell 7 SUB Subtract from accumulator 8 JMP Jump to address 9 HRS Halt and Reset

You can install a java version of cardiac Requires Java language be installed first Your instructor will demonstrate CARDIAC in operation. http: //sourceforge. net/project/showfiles. php? group_id=49761&release_id=91891 Note: to install type java jcinc from DOS command window Play around with it…try to figure out how to write and execute a program

CARDIAC program:

1 st program instruction Note: program begins in memory Location nine

Data “words”load here

Output 8 + 9 = 17
- Slides: 22