Day 2 - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Day 2

Description:

Fetches from memory decodes instructions tells system execute instructions. 3 Address Registers ... Decode instruction. Execute instruction. Increment counter ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 31
Provided by: Pau1276
Category:
Tags: day | decodes

less

Transcript and Presenter's Notes

Title: Day 2


1
Day 2
  • MATH 248 SPRING 03

2
What a Computer Does
  • It can manipulate and organize information.
  • Oh yeah like what?
  • Move it
  • Store it
  • Retrieve it
  • Perform simple mathematical and logical
    operations on it.

3
What a Computer Does
  • A computer must be programmed to do anything!
  • A computer manipulates information based on its
    program!

4
What a Computer Does
  • It can input information from the outside world.
  • It can output information to the outside world.
  • It can make simple yes/no decisions based on the
    information it has been given

5
THATS IT!!!!!
6
Vocabulary
  • CPU
  • Central Processing Unit
  • BRAINS
  • Housed in microprocessor

7
CPU Performs
  • Simple Logic
  • Arithmetic
  • Compare , lt, or gt
  • Jump, Skip
  • Stores and Retrieves Insructions
  • Stores and Retrieves Data

8
Standard CPU Architecture
  • 1 ALU
  • arith. logic unit
  • Circuits perform arith. logic
  • 2 Control Unit
  • Traffic Controller
  • Fetches from memory decodes instructions tells
    system execute instructions
  • 3 Address Registers
  • Store addresses

9
Basic Logic of a 4 bit ALU
10
The Wired Version
11
Standard CPU Architecture
  • 4 Accumulator
  • Register(s)
  • Accumulates bits swapped in and out of the ALU.
  • 5 CONH
  • Registers
  • Store exceptional conditions within the CPU
  • 6 Shifter
  • Stores, carries and rotates results

12
Standard CPU Architecture
  • 7 P Z
  • Register(s)
  • Let the ALU manipulate data at high speed.
  • 8 P Counter
  • Register
  • Contains the address of the next instruction to
    be fetched and executed. The program counter is
    then incremented and the next processing cycle
    begins.
  • 9 S Pointer
  • Register
  • Keeps track of the STACK.

13
Standard CPU Architecture
  • The Processing Cycle (simplified)
  • Fetch the next instruction
  • Decode instruction
  • Execute instruction
  • Increment counter
  • 10 STACK
  • Register(s)
  • The Stack is not part of the CPU it is part of
    memory.
  • The pull operation results in a transfer of the
    word at the top of the stack into the
    accumulator.
  • The push operation puts a word on the stack. The
    final accumulator contents are deposited on top
    of the stack.
  • The Stack Pointer keeps track of whats next on
    the stack. First word at the bottom.

14
BASIC COMPUTER
15
More Detailed CPU
Special Registers
  • CU Instruction Decoder
  • 3-State is a gate that can send a 1, 0, or
    terminate
  •  
  • Again Program Counter is a gate which can also
  • A) increment by 1
  • B) reset to 0

16
PRIMARYMEMORY
  • RAM
  • Stores instructions and data of the executed
    program 64-256 Mb
  • LOST!
  • ROM
  • Read Only Memory Important Memory400-500 Kb
  • SAVED
  • CPU Registers
  • Special High Speed Memory Locations holds
    information while program is executed
  • LOST!

17
More Detailed Computer
18
STORAGE
  •  bit? 1 or 0
  • byte?23 bits
  • Kb?210 bytes 213 bits
  • Mb?210Kb 220 bytes 223 bits
  • Gb?210Mb 220 Kb 230 bytes 233 bits
  • Tb?210Gb 220 Mb 240 bytes 243 bits

19
More VOCABULARY
  • WORD- of bits in a CPU register
  • EX word length of 32 bits or 4 bytes
  • word 010001000011100010000101010110111
  • ADDRESS- is a number attached to each word or
    byte so it can be accessed
  • OPCODE- basic machine operations , , load
    , store,.

20
More VOCABULARY
  • OPERAND-the item (word) to be operated on
  •  
  • MACHINE INSRUCTIONS- are words
  • part 1 represent an opcode
  • part 2 represent address of operand

21
NOWLook at Example
  • FORTRAN 90
  • Page 4

22
More VOCABULARY
  • ASSEMBLY LANGUAGE set of abbreviated text names
    for opcodes and operands
  • ASSEMBLER changes assembly language into machine
    language

23
NOWLook at Example
  • FORTRAN 90
  • Page 4

24
More VOCABULARY
  • HIGH LEVEL LANGUAGE program source code written
    in a language similar to our own.
  • COMPILER converts high level code into machine
    code.
  • SYNTAX rules for a language . These RULES MUST
    be OBEYED!!!

25
4 Steps to Programming
  • 1) THE PROBLEM
  • What is the GOAL?
  • The Inputs ? The
    Outputs ? The Givens
    To Prove

26
4 Steps to Programming
  • 2) (i) DATA ORGANIZATION
  • What are the Variables ?
  • What are the units of Variables ?
  • What symbols represent the Variables?
  • (ii) ALGORITHM
  • How to solve the Problem ?
  • Flow Charts and Psuedocode
  • Basic Outline of the proof

27
4 Steps to Programming
  • 3) PROGRAM CODING
  • Developing Program for Algorithm
  • Coding Program
  • rough draft of proof
  • writing proper proof

28
4 Steps to Programming
  • 4) EXECUTION TESTING
  • Compile and Run Program
  • Test Algorithm and Program with specific input
    values where the output values are already known.
  • Hand proof to teacher/editor and Get back
    graded proof and cry.

29
ERRORS
  • A) Compile Time
  • B) Run Time
  • C) Logic

30
NOWLook at Basics of a Program
  • FORTRAN 90
  • Section 2.5
Write a Comment
User Comments (0)
About PowerShow.com