cs3330-chap1-3-potpourri

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

Info iconThis preview shows pages 1–5. 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
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 2s 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 2s 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 2s Complement Form: Dont subtract, just add in the 2s 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

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 Right Arrow Icon
Ask a homework question - tutors are online