4.1.17

Floating Point Subtraction

Test yourself on Floating Point Subtraction

Test your knowledge with free interactive questions on Seneca — used by over 10 million students.

Floating Point Subtraction

When subtracting floating point binary numbers, it is important to ensure each number is represented with the same level of precision. This means that the exponents must be the same.

Subtraction

Subtraction

  • The example below shows the subtraction of two normalised 12-bit floating point numbers, with 8-bit mantissas and 4-bit exponents:
    • 0.10110000011 − 0.11100000010
Matching exponents

Matching exponents

  • The first step is to ensure the exponents of the two numbers match, by adding 1 to the exponent of the second number (2) to match that of the first (3).
  • Adding 1 to the exponent of the second number moves the binary point of the mantissa in this number one place to the left:
    • 0.11100000010 \rightarrow 0.01110000011
Two's complement

Two's complement

  • The next step is to find the twos complement of the second number:
    • 1.1001000
Add mantissas

Add mantissas

  • The two mantissas can then be added:
    • 0.1011000 + 1.1001000 = 0.1000000
  • Note that the first digit of the two's complement corresponds to -1 in decimal.
  • Factor this in when you do the addition.
Normalise the result

Normalise the result

  • The result should then be normalised by moving the binary point one place to the left.
  • That means we add 1 to the exponent:
    • 1.00100000100
Jump to other topics
1

Components of a Computer

2

Software & Software Development

3

Exchanging Data

4

Data Types, Data Structures & Algorithms

5

Legal, Moral, Cultural & Ethical Issues

6

Elements of Computational Thinking

6.1

Thinking Abstractly

6.2

Thinking Ahead

6.3

Thinking Procedurally

6.4

Thinking Logically

6.5

Thinking Concurrently

7

Problem Solving & Programming

8

Algorithms

Practice questions on Floating Point Subtraction

Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.

  1. 1
Answer all questions on Floating Point Subtraction

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium