{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# slide5 - A r i thmeti c I CPSC 350 E J Ki m A ny Questi ons...

This preview shows pages 1–13. Sign up to view the full content.

Arithmetic I CPSC 350 E. J. Kim

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

View Full Document
Any Questions?
What happened so far? We learned the basics of the MIPS assembly language We briefly touched upon the translation to machine language We formulated our goal, namely the implementation of a MIPS processor.

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

View Full Document
Pipelined MIPS Processor
Welcome to the Future! The execution of machine instructions can follow, for example, the steps: Instruction fetch Instruction decode and register read Execute opn. or calculate an address Access operand in data memory Write the result into a register

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

View Full Document
Pipelined MIPS 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)

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

View Full Document
Computer Arithmetic
Unsigned Numbers 32 bits are available Range 0..2 32 -1 1101 2 = 2 3 +2 2 +2 0 = 13 10 Upper bound 2 32 –1 = 4,294,967,295

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

View Full Document
Unsigned Numbers If 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 1101 + 1001 =0110
Number representations What signed integer number representations do you know?

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

View Full Document
Signed Numbers Sign-magnitude representation MSB represents sign, 31bits for magnitude One’s complement Use 0..2 31 -1 for non-negative range Invert all bits for negative numbers Two’s complement Same as one’s complement except negative numbers are obtained by inverting all bits and adding 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern