Upload
john-thomas
View
218
Download
1
Embed Size (px)
Citation preview
CARDIACA 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
programunit
output
input
memory
accumulator
SIMCO
Programunit
Instructionregister
Programcounter
Control unit
The IR
The function of the instruction register is tostore each instruction word during the timethat particular instruction is being executed.
Once this instruction is executed, the IR is feda new (instruction) word.
CARDIAC’s IR
Program Counter (PC)
CARDIAC’s PC
Program counter“bug”
Program counter“bug”
Note:it hasMoved toNext instr
Flow ChartStart
stop
receive numbers to be added
do addition
announce answer
Start
READ FIRST NUMBER
READ SECOND NUMBER
PUT 1ST NUMBER IN ACCUMULATOR
ADD SECOND NUMBER TO FIRST
STORE SUM IN MEMORY
PRINT SUM
Stop
Turn on computer
Take 1st no., frominput and store inmemory
Take 2nd no., frominput and store inmemory
clear acc and transfer 1st no.to it from memory
transfer 2nd no.from mem to accand add it to 1st
transfer sum from acc to memory
transfer sum frommem to outputand print
017 read first number018 read second number117 put first in accumulator218 add second to the first619 store sum in memory519 print sum
memory location
operation codecomputerword}
MEMORY
00 05
01
02
03
04
addresses
SIMCO has 100 addresses (00 through 99)
CADIAC’s memory
Converting SIMCO to THE Stored-Program Mode
Program Unit =
Instruction Register
Program Counter
Control Unit
+
+
input
output
accumulator
op code address
control memory
cell selector cells
program counter
instruction register(IR)
Program Example
017 read (input) first number018 read second number117 put first number into the accululator218 add second number to the first619 store sum in memory location 19519 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 javaversion of cardiac
Requires Java language be installed firstYour 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:
1st program instruction
Note: program begins in memoryLocation nine
Data “words”load here
Output 8 + 9 = 17