0 · Recall Warm-up
Answer from memory first. Answers are in the Answer Vault at the bottom.
- What value does the 8-bit 2's-complement pattern 1011 0110 have? from Lesson 1.1.1
- What is 0.625 in binary? from Lesson 0.1.2
- Which decimal fractions end in binary? from Lesson 0.1.2
1 · The Hook
🎣
Money is usually counted in paise: ₹12.50 is stored as 1250 paise, and the point is just "understood" to sit two places from the right. Computers do the same with binary fractions: a fixed-point number is an integer with an imaginary binary point at an agreed place. It is how cheap chips, audio and DSP hardware handle fractions, and GATE asks its range, its step size and its rounding error.
2 · Predict First
🤔
An 8-bit unsigned format puts 4 bits before the point and 4 after (written 4.4). What is the smallest step between two neighbouring values? What is the largest value?
Make a guess in your head. The answer opens Section 3.
3 · Core Concept
💡
Predict First — the answer
Step = 2⁻⁴ = 1/16 = 0.0625. Largest = 1111.1111₂ = 15.9375 (= 16 − 1/16).
🗣️
In plain words
Pick a fixed place for the binary point. Places to the right of it are worth 1/2, 1/4, 1/8, … The stored bits are just an integer; the real value is that integer divided by 2^(number of fraction bits). Every value is a multiple of one fixed step, so precision is the same everywhere, but the range is small.
1. The format
An i.f format has i integer bits and f fraction bits (n = i + f bits in total). Value = (bits read as an integer) ÷ 2ᶠ.
- Unsigned 4.4: 0101.1100 = 92 ÷ 16 = 5.75.
- Step (resolution) = 2⁻ᶠ: the gap between neighbouring values, the same everywhere.
2. Ranges
| Format | Smallest | Largest |
|---|---|---|
| Unsigned i.f | 0 | 2ⁱ − 2⁻ᶠ |
| Signed (2's complement) i.f, sign bit counted in i | −2ⁱ⁻¹ | 2ⁱ⁻¹ − 2⁻ᶠ |
Signed 4.4: −8 … 7.9375 in steps of 0.0625.
3. Converting
- Real → fixed: multiply by 2ᶠ, round (or truncate) to an integer, write it in n bits (2's complement if negative). 5.75 × 16 = 92 → 0101.1100. −5.75 → −92 in 8-bit 2's complement → 1010.0100.
- Fixed → real: read the n bits as an integer (2's complement if signed) and divide by 2ᶠ. Signed 4.4 pattern 1101.0110 → 1101 0110 = −42 → −42/16 = −2.625.
4. Rounding error
Numbers that are not multiples of the step must be cut down:
- Truncation (chop the extra bits): error up to (just under) one step, 2⁻ᶠ.
- Rounding to the nearest value: error at most half a step, 2⁻ᶠ⁻¹.
0.1 with 8 fraction bits: 0.1 × 256 = 25.6 → truncated to 25 → 0.00011001₂ = 25/256 = 0.09765625 (error 0.00234375).
4 · Visual
Unsigned 4.4 fixed point: weights of the 8 bits
bit : b7 b6 b5 b4 . b3 b2 b1 b0
weight: 8 4 2 1 . 1/2 1/4 1/8 1/16
0101.1100 = 4 + 1 + 1/2 + 1/4 = 5.75
5 · Worked Examples
Example 1 Easy
Write 2.625 in unsigned 4.4 fixed point.
Solution
2.625 × 16 = 42 = 0010 1010 → 0010.1010.
Example 2 Medium
What is the range of signed (2's-complement) 8.8 fixed point (16 bits)?
Solution
−2⁷ = −128 to 2⁷ − 2⁻⁸ = 127.99609375, step 1/256.
Example 3 GATE
A signed 4.4 fixed-point register holds 1101 0110. What real number is it?
Solution
As an 8-bit integer it is −42; ÷ 16 = −2.625.
6 · GATE Traps
⚠️
- Step size depends only on the number of fraction bits.
- For signed formats the sign bit is one of the integer bits (range −2ⁱ⁻¹ …).
- Negate the whole pattern (2's complement of all n bits), not just the integer part.
- Truncation error < 1 step; rounding error ≤ ½ step.
7 · Memory Hook
🧠
"Fixed point = an integer over 2ᶠ. Step 2⁻ᶠ everywhere; range 2ⁱ."
8 · Connect the Dots
Fixed point can't hold both 0.000001 and 1,000,000 in a reasonable number of bits. The next lesson lets the point float: store a sign, an exponent and a few significant bits, like scientific notation. That is the IEEE 754 standard.
9 · Self-Test
GATE format. Try every question before opening the vault.
Q1NAT1 markStep size
What is the step (resolution) of a fixed-point format with 6 fraction bits? Give it as a decimal.
Numerical answer: ________
Q2NAT1 markValue
The unsigned 4.4 pattern 1010.1000 represents what real number?
Numerical answer: ________
Q3NAT2 marksSigned value
The signed (2's-complement) 4.4 pattern 1110.1000 represents what real number?
Numerical answer: ________
Q4MCQ1 markRange
The largest value of unsigned 4.4 fixed point is:
- (A) 7.9375
- (B) 16
- (C) 15
- (D) 15.9375
Q5NAT2 marksTruncation
0.1 is stored in a format with 8 fraction bits by truncation. What real value is actually stored (exactly)?
Numerical answer: ________
10 · Rule Card
- i.f fixed point: value = integer ÷ 2ᶠ; step 2⁻ᶠ (same everywhere).
- Unsigned range 0 … 2ⁱ − 2⁻ᶠ; signed 2's complement −2ⁱ⁻¹ … 2ⁱ⁻¹ − 2⁻ᶠ.
- Real → fixed: × 2ᶠ, round/truncate, write in n bits. Negatives: 2's complement of all n bits.
- Truncation error < 2⁻ᶠ; rounding error ≤ 2⁻ᶠ⁻¹.
11 · Concept Ledger
Unlocked in this lesson. From here on, these terms may be used.
fixed-point numberinteger bits and fraction bitsresolution (step)unsigned and signed fixed-point rangesconverting to and from fixed pointtruncationroundingrepresentation error
12 · Answer Vault
Answer Vault
Try the questions first. Open when you are ready to check.
Recall Warm-up
- −74.
- 0.101.
- Those p/q with q a power of 2.
Self-Test
Q1 Answer: 0.0156251 mark
2⁻⁶.
Re-read: Lesson 2.1.1 — Fixed-point binary fractions: range, precision and rounding
Q2 Answer: 10.51 mark
8 + 2 + 0.5.
Re-read: Lesson 2.1.1 — Fixed-point binary fractions: range, precision and rounding
Q3 Answer: -1.52 marks
1110 1000 = −24; −24/16.
Re-read: Lesson 2.1.1 — Fixed-point binary fractions: range, precision and rounding
Q4 Answer: (D)1 mark
16 − 1/16.
- (A) is wrong: That is the signed maximum.
- (B) is wrong: Not representable.
- (C) is wrong: Ignores the fraction bits.
Re-read: Lesson 2.1.1 — Fixed-point binary fractions: range, precision and rounding
Q5 Answer: 0.097656252 marks
25/256.
Re-read: Lesson 2.1.1 — Fixed-point binary fractions: range, precision and rounding