slide5 - Arithmetic I CPSC 350 E. J. Kim Any Questions?...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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 arithmetic-logic unit The Arithmetic-Logic 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 Sign-magnitude representation MSB represents sign, 31bits for magnitude Ones complement Use 0..2 31-1 for non-negative 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

Page1 / 37

slide5 - Arithmetic I CPSC 350 E. J. Kim Any Questions?...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online