Binary fractions and fixed-point arithmetic
The binary point is a scale convention
Binary positions to the right of the radix point have weights 2^−1,2^−2,2^−3,… . Thus (10.101)₂=2+1/2+1/8=2.625. The dot is a reading convention, not an extra stored bit. A stored integer can represent a fraction if its scale is declared.
Prerequisites: unsigned binary and two's-complement signed integers. Goals: convert terminating binary fractions, decode a fixed-width scaled integer, derive range and resolution, and perform addition/multiplication with correct scale and rounding. All examples use mathematical arithmetic followed by an explicit storage rule, not a programming language's implicit conversion.
We define an n-bit signed fixed-point format with f fractional bits by value I×2^−f, where I is the n-bit two's-complement integer and f≥0 is fixed. We state n and f directly because Q-format naming conventions can count the sign/integer bits differently. The representable values are evenly spaced; changing f changes interpretation without changing the stored bit count.
Convert a fractional value
For a nonnegative fraction r<1, repeatedly multiply by 2. The integer part is the next bit from left to right; keep only the fractional remainder for the next step.
Worked example 1: 0.6875×2=1.375 gives bit 1 and remainder 0.375; then 0.375×2=0.75 gives bit 0; then 0.75×2=1.5 gives bit 1; then 0.5×2=1 gives bit 1 and zero remainder. Therefore 0.6875=(0.1011)₂. Check 1/2+1/8+1/16=11/16.
A reduced rational p/q has a finite binary fractional expansion exactly when q is a power of two. Any finite expansion equals an integer divided by 2^f. Conversely, such a denominator can be represented with enough fractional positions. Decimal 0.1=1/10 has a factor 5 in its reduced denominator, so no finite binary fraction represents it exactly. More bits improve approximation but do not make this particular rational exact.
Range resolution and decoding
The scaled signed range is −2^(n−1−f) through 2^(n−1−f)−2^−f, with resolution Δ=2^−f. Resolution is the gap between adjacent stored values, not a universal relative-error guarantee. More fractional bits at the same total width improve resolution but reduce range.
For n=8,f=4, the integer range −128…127 becomes −8…7.9375 and Δ=1/16=0.0625. There are 256 encodings and one zero. The pattern 10000000 represents −8, not negative zero.
Worked example 2: decode 11011010 at n=8,f=4. Its unsigned value is 218, so signed I=218−256=−38. Scale gives −38/16=−2.375. Do not detach the top bit as a minus sign or apply the scale only to positive bits.
Worked example 3: encode 1.3125 in the same format. Multiply by 16: I=21, an integer within range. Store 00010101. To encode −1.3125, store signed integer −21, which is 11101011. Decode back to confirm. For an arbitrary value x, compute x×2^f, apply the declared integer-rounding rule if necessary, then check the integer range before storage.
Rounding is part of the contract
Suppose x=0.1 and f=4. Scaled x is 1.6, so nearest rounding chooses I=2 and represented value 0.125. Error (stored minus exact) is +0.025. Rounding toward zero would choose I=1 and value 0.0625. Neither policy can encode 0.1 exactly at this scale.
For nearest rounding, a tie is exactly halfway between adjacent values. “Ties to even” chooses the candidate whose scaled integer I is even, not the candidate whose decimal spelling ends in an even digit. Example: x=0.09375 gives scaled 1.5, halfway between I=1 and I=2; choose I=2, representing 0.125. With nearest rounding and no range overflow, absolute rounding error is at most Δ/2. At a tie either neighbor has that magnitude of error; the even rule chooses which one.
Truncation must also be defined. Rounding −0.1 toward zero at f=4 gives I=−1 and value −0.0625. Rounding downward gives I=−2 and value −0.125. Dropping low bits in a signed shift is not automatically the same as rounding toward zero. Do not import a machine instruction's rounding behavior without stating it.
Addition requires a common scale
If two values share f, their integer representations may be added directly: (I_a+I_b)2^−f. Check the resulting integer against the destination width. If scales differ, first convert to a common scale, allowing any required rounding and extra bits. Adding the raw integers of differently scaled values is generally meaningless.
Worked example 4: with n=8,f=4, 1.5 has I=24 and 2.25 has I=36. Add 24+36=60; decode 60/16=3.75. No rounding is required and 60 fits.
Contrast 7.5+0.75: I values 120 and 12 give exact I=132, above 127. The exact result 8.25 exceeds the format's maximum. If and only if the stated policy retains the low eight bits, raw pattern 10000100 decodes to I=−124 and value −7.75. Saturation would instead store 7.9375. An overflow flag, wraparound result and saturated result are different outputs; the format alone does not choose a policy.
Multiplication changes the scale
The exact product is (I_a I_b)2^−2f. Before rescaling it has 2f fractional bits. A full product of two n-bit signed integers can be held in 2n signed bits. Returning to the original f requires dividing the product integer by 2^f with a declared rounding rule, followed by a range check.
Worked example 5: n=8,f=4, 1.5×(−2) uses 24×(−32)=−768. At scale 2^−8 this equals −3. To return to f=4, divide −768 by 16 to get I=−48 exactly, stored as 11010000.
Worked example 6: 1.25×1.125 uses I_a=20,I_b=18, raw product 360 and exact value 360/256=1.40625. For f=4, the new scaled integer is 22.5. Nearest ties-to-even chooses I=22, so the stored value is 22/16=1.375. Choosing I=23 would give 1.4375, equally near but with odd scaled integer. This is a rounding loss, not range overflow.
Key checks
Write total width, signed encoding, fractional-bit count, rounding and overflow policy. Decode the raw integer before scaling. Align scales before addition, add fractional-bit counts for multiplication, and keep enough intermediate width. Check exact representability separately from range: a value can lie comfortably inside the range yet need rounding.
Original practice
These six single-correct MCQs are original learning questions, not previous-year questions. Choose exactly one option.
C01. What is the decimal value of binary (11.011)₂?
A. 3.75 B. 3.375 C. 3.125 D. 3.011
Answer: B
A is incorrect: .11₂ is .75; the specified fraction is .011₂.
B is correct: 2+1+1/4+1/8=3.375.
C is incorrect: it omits the 1/4 position.
D is incorrect: binary fractional digits are not decimal digits.
C02. An 8-bit two's-complement fixed-point format has f=4. What are its minimum and maximum values?
A. −128 and 127 B. −8 and 8 C. −7.9375 and 7.9375 D. −8 and 7.9375
Answer: D
A is incorrect: these are the raw integer limits before division by 16.
B is incorrect: +8 would require raw I=128, which does not fit.
C is incorrect: −8 is representable by raw I=−128.
D is correct: divide −128 and 127 by 16.
C03. Decode pattern 11101000 in an 8-bit two's-complement fixed-point format with f=3.
A. −3 B. 29 C. −13 D. −24
Answer: A
A is correct: signed integer 232−256=−24, scaled by 1/8, is −3.
B is incorrect: 29 uses unsigned 232/8, ignoring signedness.
C is incorrect: it treats the sign bit as separate magnitude.
D is incorrect: −24 is the raw integer, before scaling.
C04. Which decimal fraction has no finite binary expansion?
A. 0.625 B. 0.125 C. 0.1 D. 0.75
Answer: C
A is incorrect: 0.625=5/8 terminates.
B is incorrect: 0.125=1/8 terminates.
C is correct: 1/10 has factor 5 in its reduced denominator.
D is incorrect: 0.75=3/4 terminates.
C05. Round x=0.15625 to f=4 fixed-point using nearest ties-to-even, with adequate range. What is stored?
A. 0.1875 B. 0.125 C. 0.15625 exactly D. 0.0625
Answer: B
A is incorrect: scaled I=3 is odd at this tie.
B is correct: x×16=2.5; choose even I=2, giving 0.125.
C is incorrect: scaled 2.5 is not an integer encoding.
D is incorrect: I=1 is not a nearest candidate.
C06. Two fixed-point operands each have f=5 fractional bits. Before rescaling, how many fractional bits does their raw product represent?
A. 5 B. 25 C. 6 D. 10
Answer: D
A is incorrect: multiplication combines both scales, not just one.
B is incorrect: fractional-bit counts add rather than multiply.
C is incorrect: adding one bit relates to some sum widths, not this product scale.
D is correct: 2^−5×2^−5=2^−10, so ten fractional bits.
Scope and sources
This is one bounded Digital Logic lesson, not complete GATE CS coverage. The official syllabus establishes relevance only; the derivations, examples and practice are original. Technical references were used to check representation and circuit conventions, not to reproduce their exercises.
- Official GATE 2027 CS syllabus Section 2
- Oracle numerical computation guide representation and rounding
Sources checked 14 October 2026.
Sign in to keep your progress. Sign in