Concepts in computing - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Concepts in computing

Description:

1. Concepts in computing. Introducing the Simpletron Simulator ... Automated Teller Machines (ATMs) Graphics & Virtual Reality. Games. Tele-surgery ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 28
Provided by: gerard49
Category:

less

Transcript and Presenter's Notes

Title: Concepts in computing


1
Concepts in computing
  • Introducing the Simpletron Simulator

2
Computer Engineering
  • Databases
  • Automated Teller Machines (ATMs)
  • Graphics Virtual Reality
  • Games
  • Tele-surgery
  • Building intelligent computers and robots
  • Mars rover
  • Talking to a computer

3
Misconceptions of Computers
4
The nature of computers
  • A Computer
  • is a very simple machine
  • is totally predictable
  • operates only on numbers
  • Does only one thing at a time
  • Does it VERY fast
  • Computes do not
  • Have a brain
  • Cannot think
  • Only does exactly what it is told
  • Garbage in ? Garbage out

5
What is a computer ?
  • A Central Processing Unit (CPU) MEMORY
  • The CPU
  • manipulates data
  • add, multiply, divide, read, write, etc.
  • Examples
  • Core Duo from Intel, CELL from IBM, ARM7 from
    Acorn Risk Machines (ARM)
  • The Memory
  • stores instructions for CPU and data
  • series of locations each with a unique address
  • numbered drawers

6
Computer Organisation
HLL Program (Java, C)
Compiler
Machine Language Program
Computer
7
How a computer works !
  • What is machine language ?
  • numbers !
  • code for operation to perform on the data
  • address of the data
  • What is Data ?
  • numbers !
  • stored in memory
  • read from Input-Output (IO) device
  • keyboard, mouse, camera, microphone, robot,

8
The Simpletron
The Processor
The Memory
9
The Simpletron CPU
Simpletron Processor
  • accumulator
  • stores the result of operations
  • program counter
  • memory address of next instruction
  • operator
  • the instruction to be performed
  • add, subtract, multiply, divide,
  • read, store, load, write,
  • branch, branch negative, goto, halt
  • operand
  • address of data

Accumulator
9 9 9 9
Program Counter
9 9
9 9
Operator
9 9
Operand
10
The Simpletron Memory
  • The Memory
  • 100 Memory locations
  • Each has an address 00 to 99
  • a location holds four digits and a sign
  • e.g. 4596 or - 0234
  • The range of values which can be stored are from
    9999 to - 9999
  • memory locations can store either instructions or
    data

11
The Simpletron Instructions
  • Instructions
  • operations to perform on the data
  • address of the data
  • Instruction operator operand

12
The Simpletron operators
  • READ 10 ADD 30 BRANCH 40
  • WRITE 11 SUBTRACT 31 BRANCHNEG 41
  • LOAD 20 DIVIDE 32 BRANCHZERO 42
  • STORE 21 MULTIPLY 33 HALT 43
  • ADD add the number at operand address to the
    value in the accumulator
  • SUBTRACT subtract the number at operand address
    from value in accumulator
  • DIVIDE divide the value in the accumulator by
    number at operand address
  • MULTIPLY multiply value in operand address by
    value in the accumulator
  • READ read a number from the keyboard and put
    into operand address
  • WRITE write a number to the screen from operand
    address
  • LOAD load a number from operand address into the
    accumulator
  • STORE store the number in the accumulator into
    the operand address

13
The Simpletron operators
READ 10 ADD 30 BRANCH 40 WRITE
11 SUBTRACT 31 BRANCHNEG 41 LOAD
20 DIVIDE 32 BRANCHZERO 42 STORE
21 MULTIPLY 33 HALT 43
  • BRANCH get the next instruction from operand
    address
  • BRANCHNEG if the contents of the accumulator are
    negative get instruction from operand address
  • BRANCHZERO if the contents of the accumulator
    are zero get instruction from operand address
  • HALT stop the program executing

14
The Processor
  • All mathematical operations happen INSIDE the
    processor
  • The processor is like a calculator and the memory
    like a piece of paper.
  • For example compute the sum 2345 2255
  • 1 copy 2345 from paper into the calculator
  • 2 add 2255 from the paper to the value stored in
    the calculator
  • 3 write the result 4600 back to the paper to
    save the answer

15
Computer Instructions
  • adding two numbers takes three instructions
  • First copy the first number from memory into the
    CPU
  • Second add the second value to the value in the
    CPU
  • Third save the result by writing it out to
    memory
  • Instruction 1 LOAD 2345 into the CPU
  • where is it in memory ? what is its address ?
  • we will assume 2345 is stored in location 05
  • The LOAD operator has the code number 12
  • The operand is 05
  • The instruction is 1205

16
Computer Instructions
  • Instruction 2 Add 2255 to the value stored in
    the CPU
  • ADD operation is 30
  • assume number 2255 is in location 06
  • operator is 30, operand is 06
  • instruction is 3006
  • Instruction 3 Store 4600 to memory
  • STORE operation is 21
  • We will store the result in location 07
  • operator is 21, operand is 07
  • instruction is 2107

17
A Simpletron Programme
00 01 02 03 04 05 06 07
  • Add two numbers
  • programme in memory
  • Execute Assumptions
  • programme counter always starts at 00
  • most instructions add one to programme counter
  • Execute Cycle
  • Fetch instruction
  • Execute instruction
  • Fetch next instruction
  • Stop if halt instruction loaded

18
Turn On Computer
00 01 02 03 04 05 06 07
Accumulator
0000
Program Counter
00
00
Operator
00
Operand
19
Fetch
00 01 02 03 04 05 06 07
Accumulator
0000
Program Counter
00
12
Operator
05
Operand
20
Execute (LOAD)
00 01 02 03 04 05 06 07
Accumulator
2345
Program Counter
01
12
Operator
05
Operand
21
Fetch
00 01 02 03 04 05 06 07
Accumulator
2345
Program Counter
01
30
Operator
06
Operand
22
Execute (ADD)
00 01 02 03 04 05 06 07
Accumulator
4600
Program Counter
02
30
Operator
06
Operand
23
Fetch
00 01 02 03 04 05 06 07
Accumulator
4600
Program Counter
02
21
Operator
07
Operand
24
Execute (STORE)
00 01 02 03 04 05 06 07
Accumulator
4600
Program Counter
03
21
Operator
07
Operand
4600
4600
25
Fetch
00 01 02 03 04 05 06 07
Accumulator
4600
Program Counter
03
43
Operator
00
Operand
4600
4600
4600
26
Execute (HALT)
00 01 02 03 04 05 06 07
Accumulator
4600
Program Counter
03
43
Operator
00
Operand
4600
4600
4600
27
Key Points
  • Computers only do what they are told
  • Computers only operate on numbers
  • CPU executes instructions
  • Memory holds data and instructions
  • Instructions have two parts
  • Operator the command to the CPU
  • Operand the location of the data
  • Instructions are fetched from memory and executed
    in the CPU
  • Key Parts of the CPU
  • Accumulator
  • Program Counter
Write a Comment
User Comments (0)
About PowerShow.com