{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

number_rep

# number_rep - Twos Complement Arithmetic Addition is...

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

CSE431 Chapter 3.1 Irwin, PSU, 2008 Two’s 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) =?

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

View Full Document
CSE431 Chapter 3.2 Irwin, PSU, 2008
CSE431 Chapter 3.3 Irwin, PSU, 2008

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

View Full Document
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

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

View Full Document
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 32-bit ALU multiplier Control add shift right product

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

View Full Document
CSE431 Chapter 3.8 Irwin, PSU, 2008 Booth’s Algorithm
CSE431 Chapter 3.9 Irwin, PSU, 2008 Example of Booth’s Algorithm

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

View Full Document
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 0 2 -1 2 -2 2 -3 2 -4 Example 6-bit representation: 10.1010 2 = 1x2 1 + 1x2 -1 + 1x2 -3 = 2.625 10 If we assume “fixed binary point”, range of 6-bit representations with this format: 0 to 3.9375 (almost 4)
CSE431 Chapter 3.11 Irwin, PSU, 2008 Fractional Powers of 2 0 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 2 -i

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

View Full Document
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 5-bits 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.

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

View Full Document
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 10 -9 Not normalized: 0.1 x 10 -8 ,10.0 x 10 -10 Scientific Notation (in Decimal)
CSE431 Chapter 3.15 Irwin, PSU, 2008 1.0 two x 2 -1 radix (base) binary point exponent Computer arithmetic that supports it called floating point , because it represents numbers where the binary point is not fixed, as it is for integers Declare such variable in C as float significand Scientific Notation (in Binary)

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

View Full Document
CSE431 Chapter 3.16 Irwin, PSU, 2008 Normal format: + 1 . xxxxxxxxxx two *2 yyyy two 32-bit version (C “ float ”) 0 31 S
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 46

number_rep - Twos Complement Arithmetic Addition is...

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

View Full Document
Ask a homework question - tutors are online