22
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

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

Embed Size (px)

Citation preview

Page 1: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

CARDIACA cardboard illustrative aid to

computation

• illustrates the operation of a computer

• demos basic units of a simple computer– input

– memory

– accumulator

– program

– output

Page 2: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

Simple Computer Block Diagram

programunit

output

input

memory

accumulator

Page 3: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

SIMCO

Programunit

Instructionregister

Programcounter

Control unit

Page 4: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator
Page 5: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

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.

Page 6: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

CARDIAC’s IR

Page 7: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

Program Counter (PC)

Page 8: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

CARDIAC’s PC

Program counter“bug”

Program counter“bug”

Note:it hasMoved toNext instr

Page 9: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

Flow ChartStart

stop

receive numbers to be added

do addition

announce answer

Page 10: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

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

Page 11: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

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}

Page 12: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

MEMORY

00 05

01

02

03

04

addresses

SIMCO has 100 addresses (00 through 99)

Page 13: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

CADIAC’s memory

Page 14: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

Converting SIMCO to THE Stored-Program Mode

Program Unit =

Instruction Register

Program Counter

Control Unit

+

+

Page 15: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

input

output

accumulator

op code address

control memory

cell selector cells

program counter

instruction register(IR)

Page 16: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

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)

Page 17: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

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

Page 18: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

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

Page 19: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

CARDIAC program:

Page 20: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

1st program instruction

Note: program begins in memoryLocation nine

Page 21: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

Data “words”load here

Page 22: CARDIAC A cardboard illustrative aid to computation illustrates the operation of a computer demos basic units of a simple computer –input –memory –accumulator

Output 8 + 9 = 17