Floating Point Representation Formula Sheet: IEEE 754 Revision Notes

Revise IEEE 754 from one compact sheet, then apply it to exact binary32 encoding, decoding, ties-to-even rounding and floating-point arithmetic.

KnowledgeGate Team

Exam prep & CS education

Updated 27 Nov 20265 min read
Floating Point Representation Formula Sheet: IEEE 754 Revision Notes

Floating-point questions become slow when field layout, bias, special cases, range and rounding are remembered as separate facts. Each formula is easier to use when its field pattern and validity condition are explicit, then exact encoding, rounding and arithmetic traces show the rules working together. Keep these rules beside your practice work, and use CS Fundamentals for Exams & Placements when you need the wider subject route.

Floating point representation formulas at a glance

The general form is x = (-1)^s x M x 2^e. Here, s is the sign bit, f the stored fraction, e the unbiased exponent, E the stored exponent, k the exponent width, and p the total precision including the hidden leading bit.

Case

Formula

When to use it

Bias

B = 2^(k-1) - 1

Convert between e and E

Normal

x = (-1)^s x (1.f)_2 x 2^(E-B)

E is neither all zeroes nor all ones

Subnormal

x = (-1)^s x (0.f)_2 x 2^(1-B)

E is all zeroes and f != 0

For normals, M = (1.f)_2 and E = e + B. Only bits after 1. are stored, so binary32 has 23 fraction bits but 24-bit precision. For subnormals, M = (0.f)_2. Classify before choosing a formula.

IEEE 754 binary32 and binary64 field, range and special-value sheet

Use the field pattern s | E | f. Field width and precision are different.

Format

Sign bits

Exponent bits

Fraction bits

Precision

Bias

binary32

1

8

23

p = 24

127

binary64

1

11

52

p = 53

1023

Classify before evaluation. For the field and special-value narrative, see Floating-Point Representation: Fields and Rounding; the field table places each rule beside its boundary.

Fields

Meaning

E = 0, f = 0

Signed zero

E = 0, f != 0

Subnormal, with no hidden 1

0 < E < all-ones

Normal, with hidden 1

E = all-ones, f = 0

Signed infinity

E = all-ones, f != 0

NaN

One NaN pattern is only an example because many exist. Binary32 has smallest positive normal 2^-126, smallest positive subnormal 2^-149, and largest finite (2 - 2^-23) x 2^127. Binary64 has 2^-1022, 2^-1074, and (2 - 2^-52) x 2^1023, respectively.

IEEE 754 binary32 encoding and decoding: work -18.625 exactly

Convert and normalise the magnitude first:

18.625_10 = 10010.101_2 = 1.0010101_2 x 2^4

The number is negative, so s = 1. The unbiased exponent is e = 4, giving E = 4 + 127 = 131 = 10000011_2. Remove the hidden leading 1 to obtain f = 00101010000000000000000.

The fields are 1 | 10000011 | 00101010000000000000000. Their 32-bit word is 11000001100101010000000000000000, or 0xC1950000.

Reverse-check it: (-1)^1 x 1.0010101_2 x 2^4 = -1.1640625 x 16 = -18.625.

Now independently decode 0 | 10000001 | 01101000000000000000000. Here s = 0, e = 129 - 127 = 2, and M = 1.01101_2 = 1.40625. Therefore the value is 1.40625 x 4 = 5.625; its hexadecimal form is 0x40B40000. The Floating Point in COA: IEEE 754 Worked Examples article expands the worked-example method. The formula card and cross-format checks stay together for revision.

Flow diagram converts -18.625 to binary, separates sign, exponent and fraction fields, and finishes with binary32 word 0xC1950000 and a reverse check.

Floating point rounding, ULP and error formulas

Keep these error quantities separate:

  • Absolute error: |x - fl(x)|

  • Relative error for x != 0: |x - fl(x)| / |x|

  • Machine epsilon for precision p: epsilon = 2^(1-p)

  • Unit roundoff under round-to-nearest: u = 2^-p

  • ULP in the normal binade [2^e, 2^(e+1)): 2^(e-(p-1))

For binary32, p = 24, epsilon = 2^-23, and u = 2^-24.

Now use a toy format with p = 4 significant binary bits. The exact value 1.1011_2 x 2^2 = 6.75 is halfway between 1.101_2 x 2^2 = 6.5 and 1.110_2 x 2^2 = 7.0. Each distance is 0.25. Round-to-nearest, ties-to-even selects 7.0 because the retained least-significant bit in 1.110_2 is 0, hence even.

Guard, round and sticky bits preserve the information needed for the final decision. Simply dropping discarded bits is truncation, not round-to-nearest.

Number line shows 6.75 exactly halfway between 6.5 and 7.0, with ties-to-even selecting 7.0 because its retained bit is even.

Floating point addition and multiplication formulas with exact traces

For addition or subtraction, follow unpack and classify -> align exponents -> add or subtract significands -> normalise -> round -> repack.

For 1.5 + 0.375, write 1.5 = 1.100_2 x 2^0 and 0.375 = 1.100_2 x 2^-2 = 0.011_2 x 2^0. Now the exponents match, so 1.100_2 + 0.011_2 = 1.111_2 x 2^0 = 1.875. Never add significands before aligning exponents. The Floating Point Representation: Encode and Add in IEEE 754 article gives the longer derivation. The compact operation order and trace are ready for revision.

For multiplication, use s = s1 XOR s2 and preliminary stored exponent E_result = E1 + E2 - B, then adjust it if normalising the product requires a shift. For 1.5 x 0.75, (1.1_2 x 2^0)(1.1_2 x 2^-1) = 10.01_2 x 2^-1 = 1.001_2 x 2^0 = 1.125. Biased exponents require one bias subtraction, followed by normalisation and rounding.

Floating point traps and the reverse-check routine

Trap

Repair

Biasing before normalising

Normalise first, bias second

Storing the leading bit

Store the fraction without hidden 1

Skipping classification

Classify E = 0 and all-ones first

Adding before alignment

Align before addition

Adding stored exponents directly

Subtract one bias

Stopping after the operation

Normalise and round

Dropping rounding evidence

Carry guard, round and sticky information

Trusting final fields

Reverse-decode them

Finite-precision addition is not associative. In a toy p = 3 format using round-to-nearest, ties-to-even, let x = 4, y = -4, and z = 0.25. Then (x + y) + z = 0.25. Exact y + z = -3.75 is halfway between -3.5 and -4.0, so it rounds to even -4.0. Thus x + (y + z) = 0, although real addition is associative.

Use this scratch order every time: classify -> convert -> normalise -> sign -> unbiased exponent -> bias -> fraction -> round -> reverse-check.

How GATE-style questions use floating point representation

Typical question shapes ask you to encode a decimal as binary32, decode fields or hexadecimal, classify zero or a special value, compute range, precision or ULP, trace one rounded operation, or locate an incorrect field in a proposed encoding.

Under time pressure, classify the exponent field first. Write the applicable formula, complete one field at a time, and reverse-check the final value. Practice questions in the Floating Point Rep area build this routine. Use COA Number Representation and Floating Point: 12 Solved MCQs as a timed application set after learning these rules.

Floating point representation: the short revision card and next step

  • Normal: (-1)^s x (1.f)_2 x 2^(E-B)

  • Subnormal: (-1)^s x (0.f)_2 x 2^(1-B)

  • Bias: 2^(k-1) - 1

  • Binary32: 1/8/23, B = 127, p = 24

  • Operation order: classify, align, operate, normalise, round, repack

Self-test the anchors: -18.625 -> 0xC1950000, 0x40B40000 -> 5.625, and 6.75 -> 7.0 for p = 4 under ties-to-even. If one fails, repeat its section before attempting mixed questions. For the full COA sequence, continue with the Computer Architecture and Organisation course.

Keep learning

Discussion