cs3330-chap1-3-potpourri

# cs3330-chap1-3-potpourri - 1 CS/ECE 3330 CS/ECE 3330...

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

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 CS/ECE 3330 CS/ECE 3330 Computer Architecture Chapters 1-3 Potpourri Âˇ Tie up loose ends regarding arithmetic â€“ Sign-magnitude vs 2â€™s complement â€“ Binary subtraction Today â€“ Why populate the â€śupper bitsâ€ť in integer division â€“ Special exponent bits â€“ Floating point multiplication â€“ Rounding Âˇ Review main concepts Chapters 1-3 CS/ECE 3330 â€“ Fall 2009 1 2 Âˇ 1100 Âˇ Depends! â€“ Is it in 2â€™s complement, unsigned, or sign- What Value Do These Bits Represent? magnitude form?! CS/ECE 3330 â€“ Fall 2009 2 Âˇ Depends on the â€śformâ€ť they are in Âˇ In Unsigned Form â€“ Only makes sense to subtract smaller number How Do We Do Binary Subtraction? from larger number Âˇ In 2â€™s Complement Form: â€“ Donâ€™t subtract, just add in the 2â€™s complement of the second value Âˇ In Sign-Magnitude Form: CS/ECE 3330 â€“ Fall 2009 â€“ Several rulesâ€¦ 3 3 Âˇ Addition â€“ Add magnitudes only â€“ Throw away any carry out of the MSB of the magnitude Add only integers of like sign The Rules for Sign Magnitude â€“ Add only integers of like sign â€“ Sign of result is the same as the sign of the addends Âˇ Subtraction â€“ If signs are same, continue â€“ If signs are different, change the problem to addition â€“ Compare magnitudes, then subtract smaller from CS/ECE 3330 â€“ Fall 2009 bigger â€“ If you switched the order, switch the resulting sign 4 Why Do We Put the Divisor in the â€śUpper Bitsâ€ť in Binary Division? CS/ECE 3330 â€“ Fall 2009 5 4 Âˇ Check for 0 divisor Âˇ Long division approach Âˇ If divisor â‰¤ dividend bits Âˇ 1 bit in quotient, subtract Otherwise Recall: Division quotient Âˇ Otherwise Âˇ 0 bit in quotient, bring down next dividend bit Âˇ Restoring division Âˇ Do the subtract, and if remainder goes < 0, add divisor back 1001 1000 1001010-1000 10 101 1010 1000 dividend divisor CS/ECE 3330 â€“ Fall 2009 Âˇ Signed division Âˇ Divide using absolute values Âˇ Adjust sign of quotient and remainder as required 6-1000 10 n-bit operands yield n-bit quotient and remainder remainder Iteration Step Quotient Divisor Remainder Âˇ Using the algorithm just shown, divide 7d by 2d, or 0000 0111 0010: Practice Division Initial Values 0000 0010 0000 0000 0111 1 1:Rem=Rem-Div 2b: Rem < 0 Ă† +Div, sll Q, Q0=0 3: Shift Div right 0000 0000 0000 0010 0000 0010 0000 0001 0000 1110 0111 0000 0111 0000 0111 2 1:Rem=Rem-Div 2b: Rem < 0 Ă† +Div, sll Q, Q0=0 3: Shift Div right 0000 0000 0000 0001 0000 0001 0000 0000 1000 1111 0111 0000 0111 0000 0111...
View Full Document

{[ snackBarMessage ]}

### Page1 / 18

cs3330-chap1-3-potpourri - 1 CS/ECE 3330 CS/ECE 3330...

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

View Full Document
Ask a homework question - tutors are online