# Org3 - Arithmetic Chapter 3 Computer Organization and...

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

Arithmetic Chapter 3 Computer Organization and Design

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

View Full Document
Addition Addition is similar to decimals   0000 0111 + 0000 0101 = 0000 1100 Subtraction (negate)   0000 0111 + 1111 1011 = 0000 0010
Over(under)flow For signed addition If signs are the same It has to agree with the arguments If signs different There can be no over(under)flow.

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

View Full Document
Over(under)flow For signed subtraction If signs are the same There can be no over(under)flow If signs are different It has to match the subtractant (zero?)
Over(under)flow For unsigned addition If result smaller than the argument, it is overflow For unsigned subtraction If the result is greater than the subtractant it is overflow

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

View Full Document
In practice. .. MIPS signed ops can cause overflow Causes exception and saves the offending instruction in  Exception PC (mfc0) Unsigned ops will not cause C ignores integer overflows.
Multimedia Operations Operations like MMX, SSE, etc Graphics and image processing often work with 8  or 16 bits Treat a 32-bit register as 4 8-bit registers or 2 16  bits registers. Break the carry chain

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

View Full Document
Multiplication          1000        x 1001          1000         0000        0000       1000 =     1001000
Hardware Multiplicant Product Multiplier Control Adder

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

View Full Document
Can we speed up? All operations could be done in parallel Have a cascade of adders and add them all Gate delays will be a problem Have a tree of additions Logarithmic time Use carry save adders

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

View Full Document
Tree of Adders Adder Adder Adder mplier2*mcant mplier1*mcant mplier0*mcant mplier3*mcant Pr0 Pr1 Pr6-2 Pr7
Division unsigned long int rem, ldvsr; int i; rem   = divident; ldvsr = ((long)divisor)<<31; quot = 0; for (i=1; i<32; i++){   quot = quot<<1;   if (rem>=ldvsr){     rem-=ldvsr;     quot+=1;   } }

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

View Full Document
Doing it faster Hard! The reason is that we do not know the reminder in
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/13/2012 for the course CSE 1720 taught by Professor Baljko during the Winter '12 term at York University.

### Page1 / 36

Org3 - Arithmetic Chapter 3 Computer Organization and...

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

View Full Document
Ask a homework question - tutors are online