Xxxx2 xxxx the n bits of frac minimum when 0000 m 10

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: biased value: E = exp -­‐ Bias § exp is an unsigned value ranging from 1 to 2k-­‐2 (k == # bits in exp) § Bias = 2k-­‐1 -­‐ 1 §  Single precision: 127 (so exp: 1…254, E: -­‐126…127) §  Double precision: 1023 (so exp: 1…2046, E: -­‐1022…1023) § These enable nega=ve values for E, for represen=ng very small values ¢  Significand coded with implied leading 1: M = 1.xxx…x2 §  xxx…x: the n bits of frac §  Minimum when 000…0 (M = 1.0) §  Maximum when 111…1 (M = 2.0 – ε) §  Get extra leading bit for “free” IEEE Floa-ng Point Standard University of Washington Normalized Encoding Example s E V = (–1) * M * 2 s exp frac n k ¢  Value: float f = 12345.0; §  1234510 = 110000001110012 = 1.10000001110012 x 213 (normalized form) ¢  Significand: M = frac = ¢  1.10000001110012 100000011100100000000002 Exponent: E = exp -­‐ Bias, so exp = E + Bias E = Bias = exp = ¢  13 127 140 = 100011002 Result: 0 10001100 10000001110010000000000 s exp frac IEEE Floa-ng Point Standard University of Washington Integer & Floa-ng Point Numbers ¢  ¢  ¢  ¢  ¢  ¢  ¢  ¢  Representa-on of integers: unsigned and signed Unsigned and signed integers in C Arithme-c and shiBing Sign extension Background: frac-onal binary numbers IEEE floa-ng-­‐point standard Floa-ng-­‐point opera-ons and rounding Floa-ng-­‐point in C Floa-ng Point Opera-ons University of Washington How do we do opera-ons? ¢  Unlike the representa-on for integers, the representa-on for floa-ng-­‐point numbers is not exact Floa-ng Point Opera-ons University of Washington Floa-ng Point Opera-ons: Basic Idea s E V = (–1) * M * 2 s exp frac k ¢  x +f y = Round(x + y) ¢  x *f y = Round(x * y) ¢  n Basic idea for floa-ng point opera-ons: §  First, compute the exact result §  Then, round the result to...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online