Org3 - Arithmetic Chapter 3 Computer Organization and...

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

View Full Document Right Arrow Icon
    Arithmetic Chapter 3 Computer Organization and Design
Image of page 1

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

View Full Document Right Arrow Icon
    Addition Addition is similar to decimals   0000 0111 + 0000 0101 = 0000 1100 Subtraction (negate)   0000 0111 + 1111 1011 = 0000 0010
Image of page 2
    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.
Image of page 3

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

View Full Document Right Arrow Icon
    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?)
Image of page 4
    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
Image of page 5

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

View Full Document Right Arrow Icon
    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.
Image of page 6
    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
Image of page 7

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

View Full Document Right Arrow Icon
    Multiplication          1000        x 1001          1000         0000        0000       1000 =     1001000
Image of page 8
    Hardware Multiplicant Product Multiplier Control Adder
Image of page 9

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

View Full Document Right Arrow Icon
    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
Image of page 10
    Cascade of Adders Adder Adder Adder multiplicant multiplier & & & &
Image of page 11

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

View Full Document Right Arrow Icon
    Tree of Adders Adder Adder Adder mplier2*mcant mplier1*mcant mplier0*mcant mplier3*mcant Pr0 Pr1 Pr6-2 Pr7
Image of page 12
    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;   } }
Image of page 13

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

View Full Document Right Arrow Icon
    Doing it faster Hard!
Image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern