Download presentation
Presentation is loading. Please wait.
1
March 2005 1R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Exam Topic OverviewExam Topic Overview Technical Topic ReviewTechnical Topic Review Skills Review – conversions, programmingSkills Review – conversions, programming Data: CharactersData: Characters Data: Floating PointData: Floating Point
2
March 2005 2R. Smith - University of St Thomas - Minnesota Topics for the Exam Data Formats: convert to/from decimalData Formats: convert to/from decimal –Sign and magnitude, 1’s complement, 2’s complement 2’s complement binary and hex arithmetic2’s complement binary and hex arithmetic –AND, OR, NOT, Add, Subtract ProgrammingProgramming –Arithmetic expressions for MIPS or LC-3 –Conditionals (IFs) in LC-3 assembly language –Looping in LC-3 assembly language Instruction Set ArchitecturesInstruction Set Architectures –Properties – compare for processors we’ve studied Stacks and Method CallsStacks and Method Calls –Role of different MIPS registers –“Program wide” and “per method” memory maps
3
March 2005 3R. Smith - University of St Thomas - Minnesota Suggestions Print out copies of lecture notesPrint out copies of lecture notes They should fit readably 6 to a pageThey should fit readably 6 to a page You probably don’t need to print out the lecture with all the instruction data flowsYou probably don’t need to print out the lecture with all the instruction data flows –If you don’t “get” instruction data flows, don’t worry, we’ll be doing a lot of that in the next few weeks –It’s easier to use the appendix in P&P that describes how the instructions work Bring BOTH books on Monday, just to be safeBring 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
March 2005 4R. Smith - University of St Thomas - Minnesota Properties of ISAs Data sizes for operations (register sizes)Data sizes for operations (register sizes) Address range for RAMAddress range for RAM Common address modes for RAMCommon address modes for RAM –Which types of instructions use which modes –EX: “fetch store” design vs. allowing arithmetic to access RAM Instruction SizingInstruction Sizing –Fixed vs variable length instructions Things to Look ForThings to Look For –Shared consistencies – things both processors do –Differences – what’s different in the ISA between them
5
March 2005 5R. Smith - University of St Thomas - Minnesota Memory Maps and Methods “Global” map for a running program“Global” map for a running program –Text –Data region Starts with fixed “global” dataStarts with fixed “global” data Then comes a variable sized “heap” of data given to the program piecemeal on requestThen comes a variable sized “heap” of data given to the program piecemeal on request –Stack
6
March 2005 6R. Smith - University of St Thomas - Minnesota “Map” for individual methods Section 2.7 – Stacks and MethodsSection 2.7 – Stacks and Methods –Described in terms of MIPS subroutine calls Stack FrameStack Frame –Return address –Local variables for the new method Pointed to by “Frame Pointer”Pointed to by “Frame Pointer” –Registers saved while used locally Stack Pointer – start of RAM belonging to the stackStack 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 callerMust 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
March 2005 7R. Smith - University of St Thomas - Minnesota Skills Review Representation/ConversionRepresentation/Conversion 2’s Complement add/subtract2’s Complement add/subtract Binary/hex add, subtract, and, or, notBinary/hex add, subtract, and, or, not Arithmetic in LC-3 or MIPSArithmetic in LC-3 or MIPS –Short RAM example –Longer register based example IF example in LC-3IF example in LC-3 –Min/max using registers Loop exampleLoop example –Down counting –Sentinel value
8
March 2005 8R. Smith - University of St Thomas - Minnesota “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.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 calculate the average? How do you do it without integer divide?How do you do it without integer divide?
9
March 2005 9R. Smith - University of St Thomas - Minnesota Characters Comparison issuesComparison issues –3 vs ‘3’ vs “3” Character (decimal) to integer conversionCharacter (decimal) to integer conversion
10
March 2005 10R. Smith - University of St Thomas - Minnesota What is Floating Point? PartsParts –Mantissa – the fraction part –Exponent – powers of 2 –Signs Special Values: 0, Infinity, and “Not a Number”Special Values: 0, Infinity, and “Not a Number” ProblemsProblems –Overflow, Underflow –Loss of precision Double vs FloatDouble 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
March 2005 11R. Smith - University of St Thomas - Minnesota Floating Point Format First bit is the signFirst bit is the sign –Easy to compare 0 Next is exponentNext is exponent –Easier to compare magnitude of numbers based on exponent –EXCEPT that negative exponents are “larger” than positive –Exponent in 2’s complement notation Finally comes the mantissaFinally comes the mantissa –Generally a ‘hidden’ 1 at the top – implicitly always there –Unsigned magnitude value –“Sign and magnitude” form
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.