This preview shows pages 1–15. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CSE431 Chapter 3.1 Irwin, PSU, 2008 Twos Complement Arithmetic Addition is accomplished by adding the codes, ignoring any final carry Subtraction: change the sign and add 16 + (23) =? 16  (23) =? 23  (16) =? CSE431 Chapter 3.2 Irwin, PSU, 2008 CSE431 Chapter 3.3 Irwin, PSU, 2008 CSE431 Chapter 3.4 Irwin, PSU, 2008 Hardware for Addition and Subtraction CSE431 Chapter 3.5 Irwin, PSU, 2008 Multiply Binary multiplication is just a bunch of right shifts and adds multiplicand multiplier partial product array double precision product n 2n n can be formed in parallel and added in parallel for faster multiplication CSE431 Chapter 3.6 Irwin, PSU, 2008 Multiplication Example 1011 Multiplicand (11 dec) x 1101 Multiplier (13 dec) 1011 Partial products 0000 Note: if multiplier bit is 1 copy 1011 multiplicand (place value) 1011 otherwise zero 10001111 Product (143 dec) Note: need double length result CSE431 Chapter 3.7 Irwin, PSU, 2008 Add and Right Shift Multiplier Hardware multiplicand 32bit ALU multiplier Control add shift right product CSE431 Chapter 3.8 Irwin, PSU, 2008 Booths Algorithm CSE431 Chapter 3.9 Irwin, PSU, 2008 Example of Booths Algorithm CSE431 Chapter 3.10 Irwin, PSU, 2008 Representation of Fractions Binary Point like decimal point signifies boundary between integer and fractional parts: xx . yyyy 2 1 2 21 22 23 24 Example 6bit representation: 10.1010 2 = 1x2 1 + 1x21 + 1x23 = 2.625 10 If we assume fixed binary point, range of 6bit representations with this format: 0 to 3.9375 (almost 4) CSE431 Chapter 3.11 Irwin, PSU, 2008 Fractional Powers of 2 1.0 1 1 0.5 1/2 2 0.25 1/4 3 0.125 1/8 4 0.0625 1/16 5 0.03125 1/32 6 0.015625 7 0.0078125 8 0.00390625 9 0.001953125 10 0.0009765625 11 0.00048828125 12 0.000244140625 13 0.0001220703125 14 0.00006103515625 15 0.000030517578125 i 2i CSE431 Chapter 3.12 Irwin, PSU, 2008 0.828125 and 0.1640625 Example: (done in class) CSE431 Chapter 3.13 Irwin, PSU, 2008 Representation of Fractions So far, in our examples we used a fixed binary point. What we really want is to float the binary point. Why? Floating binary point most effective use of our limited bits (and thus more accuracy in our number representation): 000000.001010100000 Any other solution would lose accuracy! example: put 0.1640625 into binary. Represent as in 5bits choosing where to put the binary point. Store these bits and keep track of the binary point 2 places to the left of the MSB With floating point rep., each numeral carries a exponent field recording the whereabouts of its binary point. The binary point can be outside the stored bits, so very large and small numbers can be represented. CSE431 Chapter 3.14 Irwin, PSU, 2008 6.02 10 x 10 23 radix (base) decimal point significand exponent Normalized form: no leadings 0s (exactly one digit to left of decimal point) Alternatives to representing 1/1,000,000,000 Normalized: 1.0 x 109 Not normalized: 0.1 x 108 ,10.0 x 1010 Scientific Notation (in Decimal) CSE431...
View
Full
Document
This note was uploaded on 04/20/2010 for the course CS 102 taught by Professor Kp during the Spring '10 term at Jaypee University IT.
 Spring '10
 KP

Click to edit the document details