This preview shows pages 1–14. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Arithmetic I CPSC 350 E. J. Kim Any Questions? What happened so far? We learned the basics of the MI PS assembly language We briefly touched upon the translation to machine language We formulated our goal, namely the implementation of a MI PS processor. Pipelined MI PS Processor Welcome to the Future! The execution of machine instructions can follow, for example, the steps: I nstruction fetch I nstruction decode and register read Execute opn. or calculate an address Access operand in data memory Write the result into a register Pipelined MI PS Processor We concentrate first on the arithmeticlogic unit The ArithmeticLogic Unit Arithmetic (addition and subtraction) we need to know number representations there exist various interesting algorithms for addition and subtraction integer and floating point arithmetic Logical operations (and, or, not) Computer Arithmetic Unsigned Numbers 32 bits are available Range 0..2 32 1 1101 2 = 2 3 +2 2 +2 = 13 10 Upper bound 2 32 1 = 4,294,967,295 Unsigned Numbers I f we have n bit unsigned integers, then addition really means a+b mod 2 n For example, if n=4, then 1101 2 + 1001 2 = 13 + 9 = 22 = 6 mod 16 Number representations What signed integer number representations do you know? Signed Numbers Signmagnitude representation MSB represents sign, 31bits for magnitude Ones complement Use 0..2 311 for nonnegative range I nvert all bits for negative numbers Twos complement Same as ones complement except negative numbers are obtained by inverting all bits and adding 1 Ones Complement Suppose we want to express 30 as an 8bit integer in ones complement representation....
View Full
Document
 Spring '08
 Staff

Click to edit the document details