ENGR 330: Todays Class - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

ENGR 330: Todays Class

Description:

Float = 32 bits, 8 bit exponent, 23 bit mantissa, sign bit ... Finally comes the mantissa. Generally a hidden' 1 at the top implicitly always there ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 12
Provided by: ricks6
Category:
Tags: engr | class | mantissa | todays

less

Transcript and Presenter's Notes

Title: ENGR 330: Todays Class


1
ENGR 330 Todays Class
  • Exam Topic Overview
  • Technical Topic Review
  • Skills Review conversions, programming
  • Data Characters
  • Data Floating Point

2
Topics for the Exam
  • Data Formats convert to/from decimal
  • Sign and magnitude, 1s complement, 2s
    complement
  • 2s complement binary and hex arithmetic
  • AND, OR, NOT, Add, Subtract
  • Programming
  • Arithmetic expressions for MIPS or LC-3
  • Conditionals (IFs) in LC-3 assembly language
  • Looping in LC-3 assembly language
  • Instruction Set Architectures
  • Properties compare for processors weve studied
  • Stacks and Method Calls
  • Role of different MIPS registers
  • Program wide and per method memory maps

3
Suggestions
  • Print out copies of lecture notes
  • They should fit readably 6 to a page
  • You probably dont need to print out the lecture
    with all the instruction data flows
  • If you dont get instruction data flows, dont
    worry, well be doing a lot of that in the next
    few weeks
  • Its easier to use the appendix in PP that
    describes how the instructions work
  • Bring BOTH books on Monday, just to be safe
  • It should be enough to just bring the little MIPS
    card if you feel comfortable with how MIPS
    instructions work

4
Properties of ISAs
  • Data sizes for operations (register sizes)
  • Address range for RAM
  • Common address modes for RAM
  • Which types of instructions use which modes
  • EX fetch store design vs. allowing arithmetic
    to access RAM
  • Instruction Sizing
  • Fixed vs variable length instructions
  • Things to Look For
  • Shared consistencies things both processors do
  • Differences whats different in the ISA between
    them

5
Memory Maps and Methods
  • Global map for a running program
  • Text
  • Data region
  • Starts with fixed global data
  • Then comes a variable sized heap of data given
    to the program piecemeal on request
  • Stack

6
Map for individual methods
  • Section 2.7 Stacks and Methods
  • Described in terms of MIPS subroutine calls
  • Stack Frame
  • Return address
  • Local variables for the new method
  • Pointed to by Frame Pointer
  • Registers saved while used locally
  • Stack Pointer start of RAM belonging to the
    stack
  • Stack grows downward in RAM as more space is
    needed
  • Must ALWAYS pop the stack back to its starting
    point when done with it like when a method is
    finished and returns to its caller

7
Skills Review
  • Representation/Conversion
  • 2s Complement add/subtract
  • Binary/hex add, subtract, and, or, not
  • Arithmetic in LC-3 or MIPS
  • Short RAM example
  • Longer register based example
  • IF example in LC-3
  • Min/max using registers
  • Loop example
  • Down counting
  • Sentinel value

8
The assignment that got away
  • Write a MIPS program that adds a list of 4 or 8
    integers and calculates the (truncated) average
    value. Do NOT use the built-in Divide operation.
  • How do you calculate the average?
  • How do you do it without integer divide?

9
Characters
  • Comparison issues
  • 3 vs 3 vs 3
  • Character (decimal) to integer conversion

10
What is Floating Point?
  • Parts
  • Mantissa the fraction part
  • Exponent powers of 2
  • Signs
  • Special Values 0, Infinity, and Not a Number
  • Problems
  • Overflow, Underflow
  • Loss of precision
  • Double vs Float
  • Float 32 bits, 8 bit exponent, 23 bit mantissa,
    sign bit
  • Double 64 bits, 11 bit exponent, 52 bit
    mantissa, sign bit

11
Floating Point Format
  • First bit is the sign
  • Easy to compare lt0 or gt0
  • Next is exponent
  • Easier to compare magnitude of numbers based on
    exponent
  • EXCEPT that negative exponents are larger than
    positive
  • Exponent in 2s complement notation
  • Finally comes the mantissa
  • Generally a hidden 1 at the top implicitly
    always there
  • Unsigned magnitude value
  • Sign and magnitude form
Write a Comment
User Comments (0)
About PowerShow.com