Back to 课程

Computer-science_A-level_Cie

0% Complete
0/0 Steps
  1. computers-and-components
    6 主题
  2. logic-gates-and-logic-circuits
    2 主题
  3. central-processing-unit-cpu-architecture
    6 主题
  4. assembly-language-
    4 主题
  5. bit-manipulation
    1 主题
  6. operating-systems
    3 主题
  7. language-translators
    2 主题
  8. data-security
    3 主题
  9. data-integrity
    1 主题
  10. ethics-and-ownership
    3 主题
  11. database-concepts
    3 主题
  12. database-management-systems-dbms-
    1 主题
  13. data-definition-language-ddl-and-data-manipulation-language-dml
    1 主题
  14. computational-thinking-skills
    1 主题
  15. algorithms
    14 主题
  16. data-types-and-records
    2 主题
  17. arrays
    2 主题
  18. files
    1 主题
  19. introduction-to-abstract-data-types-adt
    1 主题
  20. programming-basics
    1 主题
  21. constructs
    2 主题
  22. structured-programming
    1 主题
  23. program-development-life-cycle
    2 主题
  24. program-design-
    2 主题
  25. program-testing-and-maintenance
    3 主题
  26. user-defined-data-types
    1 主题
  27. file-organisation-and-access-
    3 主题
  28. floating-point-numbers-representation-and-manipulation
    3 主题
  29. protocols
    2 主题
  30. circuit-switching-packet-switching
    1 主题
  31. processors-parallel-processing-and-virtual-machines
    5 主题
  32. boolean-algebra-and-logic-circuits
    4 主题
  33. purposes-of-an-operating-system-os
    3 主题
  34. translation-software
    3 主题
  35. encryption-encryption-protocols-and-digital-certificates
    3 主题
  36. artificial-intelligence-ai
    4 主题
  37. recursion
    1 主题
  38. programming-paradigms
    4 主题
  39. object-oriented-programming
    7 主题
  40. file-processing-and-exception-handling
    2 主题
  41. data-representation
    5 主题
  42. multimedia
    3 主题
  43. compression
    2 主题
  44. networks-and-the-internet
    11 主题
课 Progress
0% Complete

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)

  1. Convert the number into binary (split into integer part + fractional part)

    • Example: 5 = 101₂, 0.25 = 0.01₂, so 5.25 = 101.01₂

  2. 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

  3. 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

  4. Convert the exponent to 4-bit two’s complement (unbiased)

    • Positive exponents are normal binary

    • Negative exponents use two’s complement

  5. 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

101.01

0.10101 × 2³

010101000000

0011

−5.25

−101.01

0.10101 × 2³

110101000000

0011

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)

  1. Read the exponent (4 bits)

    • Convert from two’s complement into denary

    • Positive values = normal binary

    • Negative values = two’s complement

  2. Check the mantissa sign

    • First bit = sign (0 = +, 1 = −)

    • Remember: the rest of the mantissa is just the fraction, not in two’s complement

  3. Restore the fraction

    • Write it as 0.<fraction bits> in binary

    • Example: mantissa 010101000000 → fraction bits 101010000000.10101₂

  4. Apply the exponent

    • Shift the binary point right if exponent is positive, left if exponent is negative

    • Multiply the fraction by 2^(exponent)

  5. 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)

010101000000

0011

+5.25

110101000000

0011

−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 111 OR 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

0111000111

000111

System 2

Mantissa

Exponent

01110001

00000111

Responses

您的邮箱地址不会被公开。 必填项已用 * 标注