Lecture6

# Lecture6 - Abhishek Bhattacharjee Topics: s Integer...

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: Abhishek Bhattacharjee Topics: s Integer Arithmetic 198:211 Computer Architecture Rutgers University Abhishek Bhattacharjee 2 Review Rutgers University 3 Abhishek Bhattacharjee Twos Complement 000 001 010 011 100 101 110 111 1 2 3-4-3-2-1 Ones complement plus one s Most significant bit still gives the sign s Trick: copy all 0 bits from LSB till first 1 bit. Copy 1 bit, then flip all remaining bits till MSB. Advantages: s Only 1 zero s Most convenient for arithmetic computations Used in almost all computers today Rutgers University Abhishek Bhattacharjee 4 IEEE floating point standard Most computers follow IEEE 754 standard Single precision (32 bits) Double precision (64 bits) Extended precision (80 bits) S Fraction Exponent Rutgers University Abhishek Bhattacharjee 5 Floating point in C 32 bits single precision (type float) s 1 bit for sign, 8 bits for exponent, 23 bits for mantissa c Sign bit: 1 = negative numbers, 0 = positive numbers c Exponent is power of 2 s Have 2 zeros s Range is approximately -10 38 to 10 38 64 bits double precision (type double) s 1 bit for sign, 11 bits for exponent, 52 bits for mantissa s Majority of new bits for mantissa b higher precision s Range is -10 308 to +10 308 Rutgers University Abhishek Bhattacharjee 6 Numerical Values Three different cases: s Normalized values c exponent field 0 and exponent field 2 k-1 (all 1s) c exponent = binary value Bias Bias = 2 k-1-1 (e.g., 127 for float) c mantissa = 1.(mantissa field) c Ex: (sign: 0, exp: 1, mantissa: 1) would give 0b1.1x2-126 s Denormalized values c exponent field = 0 c exponent = 1 Bias (e.g., -126 for float) c Mantissa = mantissa field (no leading 1) c Ex: (sign: 0, exp: 0, mantissa: 10) would give 0b10x2-126 s Special values: represent + , - , and NaN Rutgers University Abhishek Bhattacharjee 7 Decimal to IEEE Floating Point 5.625 In binary 101.101 b 1.01101 x 2 2 Exponent field has value 2...
View Full Document

## Lecture6 - Abhishek Bhattacharjee Topics: s Integer...

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

View Full Document
Ask a homework question - tutors are online