Back to the 2024 paper

Module 1: Functional Block of computer and Data representaion

20247m

Write short notes on any two of the following:
b) Fixed and Floating point representations

Worked SolutionAI Assisted

Fixed and Floating Point Representations [7M]

1. Fixed Point Representation:

In fixed point, binary point is fixed at one position (usually after sign bit / between integer and fractional part). Used for integers and fractional numbers where range is limited.

  • Format: S | Integer part | Fractional part . e.g. Q15 format: 1 sign + 15 fractional bits. Value = I.FI.F where FF has weight 2−k2^{-k}.
  • Signed representation: Sign-magnitude, 1's complement, but practically 2's complement is used. e.g. 8-bit 2's complement : +5=00000101+5 = 00000101, −5=11111011-5 = 11111011. Range for nn-bits: −2n−1-2^{n-1} to +2n−1−1+2^{n-1}-1.
  • Fractional fixed point: e.g. S = 0.101 (≈0.625\approx 0.625 in Q3Q_{3}). Value = −b0.b−1b−2...-b_{0}.b_{-1}b_{-2}... in 2's complement : V=−b0+∑i=1kb−i2−iV = -b_{0} + \sum_{i=1}^{k} b_{-i}2^{-i}.
  • Advantages: Simple hardware, fast ALU, exact representation within range.
  • Disadvantages: Very limited dynamic range. Overflow easily. Small numbers lose precision. Trade-off between Range and Precision: range≈2nrange \approx 2^{n}, resolution=2−fresolution = 2^{-f} where ff=fractional bits.

Used in DSP, embedded systems (no FPU), address arithmetic.

2. Floating Point Representation:

Based on scientific notation: N=±M×BEN = \pm M \times B^{E} where MM = mantissa/significand, BB = base (2), EE = exponent.

Standard: IEEE 754

  • Single precision (32-bit): 1-bit Sign (S) | 8-bit Exponent (E) | 23-bit Mantissa (M)
    Value = (−1)S×1.M×2E−127(-1)^S \times 1.M \times 2^{E-127}
    Bias = 127. Normalized form: leading 1 is hidden (1.M).

  • Double precision (64-bit): 1 | 11 | 52 , Bias = 1023. Value = (−1)S×1.M×2E−1023(-1)^S \times 1.M \times 2^{E-1023}

  • Example: −12.510=−1100.12=−1.1001×23 -12.5_{10} = -1100.1_2 = -1.1001 \times 2^3
    S=1S=1, E=3+127=130=100000102E = 3+127 = 130 = 10000010_2, M=1001000...0M = 1001000...0 (23 bits)
    Encoding: 1 10000010 10010000000000000000000 = 0xC1480000

  • Special cases:

    • E=0,M=0E=0, M=0 => 00 (±0\pm 0)
    • $E=0, M
      eq0=>Denormalized: => Denormalized: (-1)^S \times 0.M \times 2^{-126}$ (gradual underflow)
    • E=255,M=0E=255, M=0 => ±∞\pm\infty
    • $E=255, M
      eq0$ => NaN
  • Advantages: Huge dynamic range (≈10±38\approx 10^{\pm38} single, 10±30810^{\pm308} double), automatic scaling.

  • Disadvantages: Complex hardware (align exponents for add), rounding error, not exact (e.g. 0.1), slower.

Comparison:

Feature Fixed Point Floating Point
Range Small, fixed Very large
Precision Uniform Precision decreases with magnitude
HW Cost Low High (FPU)
Speed High Lower
Use Counters, DSP, address Scientific computing, graphics

Modern CPUs provide both; GPU/FPU handles IEEE 754 while ALU handles fixed point integers.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.