Computer-science_A-level_Cie
-
computers-and-components6 主题
-
logic-gates-and-logic-circuits2 主题
-
central-processing-unit-cpu-architecture6 主题
-
assembly-language-4 主题
-
bit-manipulation1 主题
-
operating-systems3 主题
-
language-translators2 主题
-
data-security3 主题
-
data-integrity1 主题
-
ethics-and-ownership3 主题
-
database-concepts3 主题
-
database-management-systems-dbms-1 主题
-
data-definition-language-ddl-and-data-manipulation-language-dml1 主题
-
computational-thinking-skills1 主题
-
algorithms14 主题
-
data-types-and-records2 主题
-
arrays2 主题
-
files1 主题
-
introduction-to-abstract-data-types-adt1 主题
-
programming-basics1 主题
-
constructs2 主题
-
structured-programming1 主题
-
program-development-life-cycle2 主题
-
program-design-2 主题
-
program-testing-and-maintenance3 主题
-
user-defined-data-types1 主题
-
file-organisation-and-access-3 主题
-
floating-point-numbers-representation-and-manipulation3 主题
-
protocols2 主题
-
circuit-switching-packet-switching1 主题
-
processors-parallel-processing-and-virtual-machines5 主题
-
boolean-algebra-and-logic-circuits4 主题
-
purposes-of-an-operating-system-os3 主题
-
translation-software3 主题
-
encryption-encryption-protocols-and-digital-certificates3 主题
-
artificial-intelligence-ai4 主题
-
recursion1 主题
-
programming-paradigms4 主题
-
object-oriented-programming7 主题
-
file-processing-and-exception-handling2 主题
-
data-representation5 主题
-
multimedia3 主题
-
compression2 主题
-
networks-and-the-internet11 主题
floating-point-conversions
Denary to floating-point binary
How do you convert denary to floating-point binary?
-
For the following conversions we are assuming:
-
12-bit mantissa (bit 0 is the sign: 0 = +, 1 = -)
-
4-bit exponent (in two’s complement, unbiased)
-
-
Convert the number into binary (split into integer part + fractional part)
-
Example: 5 =
101₂, 0.25 =0.01₂, so 5.25 =101.01₂
-
-
Normalise the binary into the form
0.xxxxx × 2ⁿ-
Move the binary point until there is one non-zero digit to the right of it
-
Count how many places the binary point moved = the exponent
-
-
Build the mantissa (12 bits):
-
First bit = sign (0 for +, 1 for −)
-
Next 11 bits = binary digits after the binary point
-
Pad with zeros on the right if needed
-
-
Convert the exponent to 4-bit two’s complement (unbiased)
-
Positive exponents are normal binary
-
Negative exponents use two’s complement
-
-
Write the final floating-point number as (Mantissa | Exponent)
Example: +5.25
-
Step 1: Convert to binary
-
5.25 =
101.01₂
-
-
Step 2: Normalise
-
101.01₂ = 0.10101 × 2³
-
-
Step 3: Build mantissa (12 bits)
-
Sign = 0 (positive)
-
Fraction =
10101→ pad →10101000000 -
Mantissa =
010101000000
-
-
Step 4: Exponent
-
+3 =
0011
-
-
Final representation:
Mantissa =010101000000
Exponent =0011
Example: −5.25
-
Step 1: Convert the magnitude (ignore the sign for now)
-
First, convert +5.25 to binary →
101.01₂ -
Normalise:
101.01₂ = 0.10101 × 2³ -
You always start by working with the positive version, then apply the negative sign later
-
-
Step 2: Build the mantissa (12 bits)
-
Sign = 1 (negative)
-
Fraction =
10101→ pad →10101000000 -
Mantissa =
110101000000
-
-
Step 3: Exponent
-
Exponent is the same as for +5.25 → +3 =
0011
-
-
Final representation:
Mantissa =110101000000
Exponent =0011
Summary table
|
Value |
Binary |
Normalised |
Mantissa (12-bit) |
Exponent (4-bit) |
|---|---|---|---|---|
|
+5.25 |
|
|
|
|
|
−5.25 |
|
|
|
|
Floating-point binary to denary
How do you convert floating-point binary to denary?
-
For the following conversions we are assuming:
-
12-bit mantissa (sign + 11 fraction bits)
-
4-bit exponent (two’s complement, unbiased)
-
-
Read the exponent (4 bits)
-
Convert from two’s complement into denary
-
Positive values = normal binary
-
Negative values = two’s complement
-
-
Check the mantissa sign
-
First bit = sign (0 = +, 1 = −)
-
Remember: the rest of the mantissa is just the fraction, not in two’s complement
-
-
Restore the fraction
-
Write it as
0.<fraction bits>in binary -
Example: mantissa
010101000000→ fraction bits10101000000→0.10101₂
-
-
Apply the exponent
-
Shift the binary point right if exponent is positive, left if exponent is negative
-
Multiply the fraction by
2^(exponent)
-
-
Apply the sign
-
If the sign bit was 1, make the final result negative
-
Convert the following to denary (+)
Mantissa: 010101000000
Exponent: 0011
-
Step 1: Exponent
-
0011₂ = +3
-
-
Step 2: Mantissa sign
-
First bit = 0 → positive
-
-
Step 3: Restore fraction
-
Fraction bits =
10101000000 -
Fraction =
0.10101₂
-
-
Step 4: Apply exponent
-
0.10101 × 2³ = 101.01₂ = 5.25₁₀
-
-
Step 5: Apply sign
-
Positive → stays
+5.25
-
-
Final result:
+5.25
Convert the following to denary (-)
Mantissa: 110101000000
Exponent: 0011
-
Step 1: Exponent
-
0011₂ = +3
-
-
Step 2: Mantissa sign
-
First bit = 1 → negative
-
-
Step 3: Restore fraction
-
Fraction bits =
10101000000 -
Fraction =
0.10101₂
-
-
Step 4: Apply exponent
-
0.10101 × 2³ = 101.01₂ = 5.25₁₀
-
-
Step 5: Apply sign
-
Negative →
−5.25
-
-
Final result:
−5.25
Examiner Tips and Tricks
-
Always handle sign first (0 = +, 1 = −)
-
The mantissa fraction is never in two’s complement for CIE
-
Only the exponent uses two’s complement
-
Show the normalisation step (
0.xxxxx × 2ⁿ) if the question asks to “show your working”
Summary table
|
Mantissa |
Exponent |
Result (Denary) |
|---|---|---|
|
|
|
+5.25 |
|
|
|
−5.25 |
Worked Example
Numbers are stored in two different computer systems by using floating-point representation.
System 1 uses:
-
10 bits for the mantissa
-
6 bits for the exponent
-
two’s complement form for both the mantissa and the exponent.
System 2 uses:
-
8 bits for the mantissa
-
8 bits for the exponent
-
two’s complement form for both the mantissa and the exponent.
Calculate the normalised floating-point representation of 113.75 and show how it would be represented in each of these two systems.
Show your working. [4]
Answer
-
conversion of 113.75 to binary seen
1110001.11[1 mark] -
exponent for normalisation 7 converted to binary
111OR evidence of binary [1 mark] -
point moved 7 places OR evidence of finding exponent = 7 [1 mark]
-
system 1 answer [1 mark]
-
system 2 answer showing correct version from system 1 [1 mark]
System 1
|
Mantissa |
Exponent |
|---|---|
|
|
|
System 2
|
Mantissa |
Exponent |
|---|---|
|
|
|
Responses