Back to the 2025 paper

Module 1: Functional Block of computer and Data representaion

20257m

Explain all types of number representations: signed integers, fixed point, floating point, and character codes.

Worked SolutionAI Assisted

Types of Number Representations

1. Signed Integer Representations (n-bit)

For n=8n=8 example range and representation of −13-13:

a) Sign-Magnitude (SM): MSB = sign (0=+ ,1=-), rest = magnitude.
Range −(2n−1−1)-(2^{n-1}-1) to +(2n−1−1)+(2^{n-1}-1); two zeros ±0\pm 0.
+13=00001101+13 = 00001101, −13=10001101-13 = 10001101; 8-bit range -127 to +127.

b) 1's Complement: Negative = bitwise NOT of positive.
Range −(2n−1−1)-(2^{n-1}-1) to +(2n−1−1)+(2^{n-1}-1); two zeros.
−13=00001101‾=11110010-13 = \overline{00001101}=11110010.

c) 2's Complement (used in modern ALUs): Negative = 1's complement +1.
Range −2n−1-2^{n-1} to +(2n−1−1)+(2^{n-1}-1); single zero. Addition/subtraction unified.
−13=11110010+1=11110011-13 = 11110010+1=11110011.
Range 8-bit: -128 to +127.
Property: A−B=A+(−B)2′sA-B = A + (-B)_{2's}.

Other: Excess/Biased 2n−12^{n-1} or 127, base −2-2 not asked separately.

2. Fixed Point Representation

Binary point is implied fixed position.
Format: Sign | Integer part | Fractional part
E.g. Q4.4Q4.4 format: 1 sign +3 integer +4 fractional.
Number =−3.75=1∣011∣1100= -3.75 = 1|011|1100 (SM). Value =∑bi2i= \sum b_i 2^i.
Used for integer arithmetic and DSP fractional [−1,+1)[-1,+1).
Range depends on point position. E.g. 8-bit pure fraction 0.xxx0.xxx: −1-1 to +0.992+0.992.

3. Floating Point Representation

For very large/small reals: N=±M×B±EN = \pm M \times B^{\pm E} where MM = mantissa/significand, EE = exponent, BB = base (2).

IEEE 754 Standard:

  • Single Precision (32-bit): 1 sign | 8 biased exponent (bias 127) | 23 mantissa with hidden 1.
    Value =(−1)S×1.M×2E−127= (-1)^S \times 1.M \times 2^{E-127}. E=0E=0 and 255255 reserved for 0/subnormals/inf/NaN.
    E.g. 13.25=1101.012=1.10101×2313.25 =1101.01_2 =1.10101\times2^3: S=0,E=130=10000010,M=1010100...0S=0,E=130=10000010,M=1010100...0 => 0x41540000.

  • Double Precision (64-bit): 1|11|52, bias 1023.
    Special values: E=0,M=0⇒±0E=0,M=0\Rightarrow\pm0; $E=0,M
    eq0\Rightarrowsubnormal; subnormal; E=255,M=0\Rightarrow\pm\infty;; E=255,M
    eq0\Rightarrow$ NaN.

Normalized form keeps 1.xxx1.xxx before point to maximize precision.

4. Character Codes

To represent text/symbols.

  • ASCII (7-bit, extended 8-bit): 27=1282^7=128 chars: 0-31 control, 32-127 printable. E.g. 'A'=65=0x41=1000001, 'a'=97, '0'=48. Extended ASCII 256 chars.
  • EBCDIC (8-bit IBM): 256 chars, used in mainframes.
  • Unicode: Universal. UTF-8 variable 1-4 bytes backward compatible with ASCII, UTF-16 2/4 bytes, UTF-32 fixed 4 bytes. Can represent >1M code points, covers all world scripts. E.g. 'A' = U+0041, '₹' = U+20B9.

Conversion example: 25.510=11001.1225.5_{10}=11001.1_2 fixed point 00011001.100000011001.1000, floating 1.10011×241.10011\times2^4 IEEE single 0x41CC0000.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.