0% found this document useful (0 votes)
408 views29 pages

Floating Point Representation

This document discusses a normalized floating point representation with an 8-bit mantissa and 4-bit exponent stored in two's complement format. It asks the reader to: 1) Write the largest and smallest positive numbers representable in this format in binary. 2) Calculate the decimal equivalents of given binary floating point numbers. 3) Write binary floating point representations for given decimal numbers. 4) Discuss potential issues like overflow that could occur with floating point representations.

Uploaded by

Edgardo Leysa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
408 views29 pages

Floating Point Representation

This document discusses a normalized floating point representation with an 8-bit mantissa and 4-bit exponent stored in two's complement format. It asks the reader to: 1) Write the largest and smallest positive numbers representable in this format in binary. 2) Calculate the decimal equivalents of given binary floating point numbers. 3) Write binary floating point representations for given decimal numbers. 4) Discuss potential issues like overflow that could occur with floating point representations.

Uploaded by

Edgardo Leysa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

box

A normalised floating point representation uses an 8-bit mantissa and a 4-bit exponent,
both stored using twos complement format.

(a)

In binary, write the largest positive number that can be represented using this
normalised floating point system in the boxes below.

Mantissa

Exponent
(1 mark)

(b)

This is a floating point representation of a number.

Mantissa

Exponent

Calculate the denary equivalent of the number, showing how you have arrived at your
answer.
Working: ..............................................................................................................................
............................................................................................................................................
............................................................................................................................................
Answer: ...............................................................................................................................
(2 marks)
(c)

Write the normalised floating point representation of the denary value 13.625 in the
boxes below. Space has been provided for you to do rough work.
Rough Work: ......................................................................................................................
............................................................................................................................................
............................................................................................................................................
Answer:

Mantissa

Exponent
(2 marks)

(d)

Write the normalised floating point representation of the denary value 0.34375 in the
boxes below. Space has been provided for you to do rough work.
Rough Work: ......................................................................................................................
............................................................................................................................................
............................................................................................................................................
Answer:

Mantissa

Exponent
(2 marks)

(e)

Explain what overflow is and give an example of a situation which might cause overflow
to occur.
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
(3 marks)

A normalised floating point representation uses an 8-bit mantissa and a 4-bit exponent,
both stored using twos complement format.
(a)

In binary, write in the boxes below, the smallest positive number that can be
represented using this normalised floating point system.

Mantissa

Exponent
(2 marks)

(b)

This is a floating point representation of a number:

Mantissa

Exponent

Calculate the denary equivalent of the number. Show your working.


Working: ..............................................................................................................................
............................................................................................................................................
............................................................................................................................................
(1 mark)
Answer: ...............................................................................................................................
(1 mark)
(c)

Write the normalised floating point representation of the denary value 12.75 in the
boxes below. Space has been provided for you to do rough work, if required.
Rough Work: .....................................................................................................................
............................................................................................................................................
............................................................................................................................................
Answer:
Mantissa

Exponent
(2 marks)

(d)

Floating point numbers are usually stored in normalised form.


State two advantages of using a normalised representation.
Advantage 1: ......................................................................................................................
............................................................................................................................................
Advantage 2: ......................................................................................................................
............................................................................................................................................
(2 marks)

(e)

An alternative twos complement format representation is proposed. In the alternative


representation 7 bits will be used to store the mantissa and 5 bits will be used to store
the exponent.
Existing Representation (8-bit mantissa, 4-bit exponent):

Mantissa

Exponent

Proposed Alternative Representation (7-bit mantissa, 5-bit exponent):

Mantissa

Exponent

Explain the effects of using the proposed alternative representation instead of the
existing representation.
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
(2 marks)

A normalised floating point representation uses a 7-bit mantissa and a 5-bit exponent,
both stored using twos complement format.
(a)

In binary, write the most negative number that can be represented using this
normalised floating point system in the boxes below:

Mantissa
(b)

Exponent

(2 marks)

This is a floating point representation of a number:

Mantissa

Exponent

Calculate the denary equivalent of the number. Show how you have arrived at your
answer.
Working: ..............................................................................................................................
............................................................................................................................................
............................................................................................................................................
(1 mark)
Answer: ...............................................................................................................................
(1 mark)
(c)

Write the normalised floating point representation of the denary value 416 in the boxes
below. Show how you have arrived at your answer.
Working: .............................................................................................................................
............................................................................................................................................
............................................................................................................................................
(1 mark)
Answer:

Mantissa

Exponent
(1 mark)

(d)

Write the normalised floating point representation of the negative denary value -12.5 in
the boxes below. Show how you have arrived at your answer.
Working: .............................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
(2 marks)
Answer:

Mantissa
Mantissa

Exponent
Exponent
(1 mark)

(e)

Table 4 lists three different calculations that might cause an error to occur in a floating
point system.
Complete Table 4 by stating the name of the type of error that may occur for each
calculation. You should not give the same answer more than once.
Table 4
Calculation

Type of error

Multiplying two very large numbers together.

Dividing a number by a very large number.


Adding together two numbers of very different
sizes eg a tiny number to a very big number.
(3 marks)

A particular computer uses a normalised floating point representation with an 8-bit


mantissa and a 4-bit exponent, both stored using twos complement.
(a)

Four bit patterns that are stored in this computers memory are listed in Figure 3 and
are labelled with the letters A to D. Three of the bit patterns are valid floating point
numbers and one is not.
Figure 3
A

Mantissa
B

Exponent

Mantissa
D

Exponent

Mantissa
C

Exponent

Mantissa

Exponent

Complete Table 1 below. In the Correct letter (A-D) column write the appropriate
letter from A to D to indicate which bit pattern in Figure 3 is an example of the type of
value described in the Value description column.
Do not use the same letter more than once.
Table 1
Value description

Correct letter (A-D)

A negative value.
The smallest positive value that can be represented.
A value that is not valid in the representation because it is not
normalised.
(3 marks)

(b)

This is a floating point representation of a number.

Mantissa

Exponent

Calculate the denary equivalent of the number. Show how you have arrived at your
answer.
Working: .............................................................................................................................
............................................................................................................................................
............................................................................................................................................
(1 mark)
Answer: ..............................................................................................................................
(1 mark)
(c)

Write the normalised floating point representation of the negative denary value -7.75 in
the boxes below. Show how you have arrived at your answer.
Working: .............................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
(2 marks)
Answer:

Mantissa

Exponent
(1 mark)

(d)

There can be a loss of precision when a denary number is stored using this floating
point system.
The closest possible representation of the denary number 6.9 is shown below.

Mantissa

Exponent

By converting this bit pattern back into denary it can be seen that the actual number
stored is 6.875, not 6.9.
(d) (i)

Calculate the absolute error that has occurred.


............................................................................................................................................
............................................................................................................................................
(1 mark)

(d) (ii)

Calculate the relative error that has occurred.


............................................................................................................................................
............................................................................................................................................
(1 mark)

(d) (iii)

Explain how the floating point system used could be modified to allow a more accurate
representation of 6.9.
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
(2 marks)

A particular computer uses two 8-bit bytes to store floating-point values. One byte is
used to store the mantissa and the other is used to store the exponent.
(i) Write down, in binary form, the largest positive value that can be stored using this
representation.

[2]
(ii) Write down, in binary form the smallest magnitude, negative number that can be
stored in this representation.

[2]
(iii) The value 01101000 11111101 is stored as a floating-point number in this
computer.
State what denary number is being represented, explaining how you arrived at
your answer.

[4]

A particular computer uses a single 10-bit word to store a floating-point representation


of a number.
The first 6 bits are used to store the mantissa and the remaining 4 bits are used to
store the exponent.
(i) Explain why 000101 0100 = 2

1
2

using this notation.

[2]
(ii) Rewrite the binary value of this floating-point representation so that it is in
normalised form.

[2]
(iii) 011001 0011 is a normalised floating-point number.
By converting each of the mantissa and the exponent into a denary number first,
write this number in denary.

[3]

Floating point is to be used to represent real numbers with:

8 bits for the mantissa, followed by


4 bits for the exponent
twos complement used for both the mantissa and the exponent

(i) Consider the binary pattern:


0

What number is this in denary? Show your working.

[3]
(ii) The representation shown in part (d)(i) is normalised.
Explain why floating point numbers are normalised.

[1]
(iii) Show the binary pattern for the smallest positive number which can be stored
using a normalised 12-bit floating point representation.
Mantissa:

Exponent:

Work out its denary value.

Denary:

[3]

(b) The developer of a new programming language decides that all real numbers will be
stored using 20-bit normalised floating point representation. She cannot decide how
many bits to use for the mantissa and how many for the exponent.
Explain the trade-off between using either a large number of bits for the mantissa, or a
large number of bits for the exponent.

[2]

Real numbers are to be stored in floating point representation with:

8 bits for the mantissa, followed by


4 bits for the exponent
twos complement used for both the mantissa and the exponent

(i) Consider the binary pattern:


1

What number is this in denary? Show your working.

[3]
(ii) Explain how you can recognise that the above pattern is normalised.

[1]
(iii) Show the binary pattern for the smallest negative number (negative sign and large
magnitude) which can be stored using a normalised 12-bit floating point
representation.
Mantissa:

Exponent:

Work out its denary value.

Denary:

[3]

Many computer systems need to store and process real numbers.


A computer uses two bytes to store a real number. The first (Byte 7) stores the mantissa and
the second (Byte 8), the exponent. Both mantissa and exponent use twos complement.

(a)

(i) What denary number is represented by Byte 7 and Byte 8?


Byte 7
0

Byte 8
0

Show your working.

[3]
(ii) Without any working out, how can you recognise that this 16-bit pattern (Byte 7 and Byte
8) is a positive number?
[1]
(b) (i) Without any working out, how can you recognise that this 16-bit pattern (Byte 7
and Byte 8) is normalised?

[1]
(ii) Both of the representations shown below are not normalised.
Write in the empty rows the binary for the normalised form for the same value.
Mantissa
0

Exponent
0

Mantissa
1

Exponent
0

[3]

(c)

A change is made to use the two bytes as a 12-bit mantissa with a 4-bit exponent. Describe
the effect of this change on the values that can be represented, compared with the old use of
the two bytes.

[2]

10 Many computer systems need to store and process real numbers.


A computer uses two bytes to store a real number. The first (Byte 1) stores the mantissa and
the second (Byte 2) the exponent. Both mantissa and exponent use twos complement.
(i) What denary number is represented by Byte 1 and Byte 2?
Byte 1
1

Byte 2
0

Show your working.

[3]
(ii) How can you recognise that this 16-bit pattern (Byte 1 and Byte 2) is normalised?
[1]
(iii) The positive number 2.0 is to be represented as a normalised real number.
Show the mantissa and exponent for this value.
Mantissa

Exponent

[2]
(iv) What is the largest positive number that can be represented? Use the same 8-bit
mantissa and 8-bit exponent.
Show the mantissa and exponent.
Mantissa

Do not attempt to evaluate this.

Exponent

[2]

(b) An alternative representation is suggested using a 6-bit mantissa with a 10-bit exponent.
Describe the effect on the numbers which can be represented, compared to the 8-bit
mantissa and 8-bit exponent used earlier.

[2]

(a)

Mantissa

Exponent

1 mark for correct bit pattern in both mantissa and exponent.


(b)

Mantissa = -0.6875 // -11/16


Exponent = 3
Answer = -5.5 // -5
1 method mark for either:
showing correct value of both mantissa and exponent in
denary
showing binary point shifted 3 places to right within a
correct binary pattern*
indicating that final answer calculated using
answer = mantissa x 2exponent (A mantissa in denary or
binary but exponent must be in denary)
1 mark for correct answer
* Correct binary patterns with the binary point shifted 3 places
are:
1010.1000
1010.1

(c)

0101.1000
101.1000
101.1

Mantissa

Exponent

1 mark for correct mantissa


1 mark for correct exponent
(d)

Mantissa
1 mark for correct mantissa
1 mark for correct exponent

Exponent
2

(e)

Definition (2 marks):
The result of a calculation is too large to store/represent // a
number is too large to store/represent;
In the available number of bits / storage space (allow example
e.g. data type, byte, word, example of a data type); R space NE
Example (1 mark):
Multiplying two numbers together;
Dividing a number by a number less than one / small number;
R zero
A Adding two numbers (of same sign)
A When number converted from one type to another that does
not have suitable range/enough bits/enough storage space to
represent it
A Answers by example
MAX 1

(a)

Mantissa

(b)

0
0
1
Exponent
0

1 mark for correct mantissa


1 mark for correct exponent

1 method mark for either:


showing correct value of both mantissa and exponent in
denary
showing binary point shifted 2 places to right in binary number
indicating that final answer calculated using
answer = mantissa x 2exponent
1 mark for correct answer
[
Mantissa = -0.625 // -5/8
Exponent = 2
Answer = -2.5 // -2

(c)
0

Mantissa
1 mark for correct mantissa
1 mark for correct exponent
(d)

Exponent

Maximises precision/accuracy for given number of bits;


Note: Must have concept of given number of bits or an example of this
e.g. word length.
Unique representation of each number // simpler to test for equality of
numbers;

(e)

Reduced precision;
Increased range; A can represent larger/smaller numbers
No effect on amount of memory required to represent a number;

Max
2

(a)

1
1
1
1
Exponent

Mantissa

1 mark for correct mantissa


1 mark for correct exponent

(b)

1 method mark for either:


showing correct value of both mantissa and exponent in
denary
showing binary point shifted 6 places to right in binary
number
indicating that final answer calculated using
answer = mantissa x 2exponent
Mantissa = -0.6875 // -11/16
Exponent = 6
Answer = -44
1 mark for correct answer
If answer is correct and some working has been shown, award
two marks, even if working would not have gained credit on its
own.
Marks for working can be awarded in the answer.

(c)

1 mark for working:


Showing a bit pattern including 1101 and any number of
preceding or following 0s, but no other 1s;
Showing the correct value of the exponent in denary (9);
Showing the binary point being shifted 9 places;
MAX 1
1 mark for correct mantissa and exponent together:
0

Mantissa

Exponent

If answer is correct and some working has been shown, award


two marks, even if working would not have gained credit on its
own.
Marks for working can be awarded in the answer.

(d)

2 marks for working:


Correct representation of 12.5 in fixed point binary: 1100.1;
Bits flipped: 0011.0 // 10011.0; A any number of preceding 1s
Correct representation of -12.5 in fixed point twos complement:
10011.1; A any number of preceding 1s
Showing the correct value of the exponent in denary (4) or
binary // showing the binary point being shifted four places;
Showing the correct value of the mantissa in floating point binary
(1.001110)
MAX 2
1 mark for correct mantissa and exponent together:
1

Mantissa

Exponent

If answer is correct and some working has been shown, award


three marks, even if working would not have gained credit on its
own.
Marks for working can be awarded in the answer.

(e)
Calculation
Multiplying two very large numbers together.
Dividing a number by a very large number.
Adding together two numbers of very different
sizes e.g. a tiny number to a very big number.

Type of
Error
Overflow;
Underflow;
Cancellation;

If same answer is used more than once and it is correct in one


instance then award the mark for the correct instance.

(a)

One mark per correct answer:


Value description
A negative value.
The smallest positive
value that can be
represented.
A value that is not
valid in the
representation
because it is not
normalised.

Correct letter (A-D)


D;
A;

C;

If a letter is used more than once then mark as


correct in the position that is correct.
(b)

1 method mark for either:


showing correct value of both mantissa
and exponent in denary
showing binary point shifted 6 places to
right in mantissa
indicating that final answer calculated
using
answer = mantissa x 2exponent
Mantissa = 0.625 // 5/8
Exponent = 6
1 mark for correct answer
Answer = 40
If answer is correct and some working has been
shown, award two marks, even if working would
not have gained credit on its own.

2 marks for working:

(c)

Correct representation of 7.75 in fixed point


binary: 111.11; A. leading and trailing 0s.
Bits flipped: 000.00 // 1000.00; A. leading 1s
Correct representation of -7.75 in fixed point
twos complement: 1000.01; A. leading 1s
Showing the correct value of the exponent in
denary (3) or binary (11) // showing the binary
point being shifted 3 places;
Note: Award both working marks if bit pattern
1.00001 is shown anywhere
MAX 2
1 mark for correct mantissa and exponent
together:
1

Mantissa
0

Exponent
If answer is correct and some working has been
shown, award three marks, even if working
would not have gained credit on its own.
Working marks can be awarded for work seen in
the final answer e.g. correct exponent.
(d)

(d)

(i)

(ii)

0.025 // 6.9-6.875 // 1/40


R. -0.025
A. award BOD mark if correct method has been
shown i.e. 6.9-6.875 but candidate has then
made an error performing the subtraction
operation

0.003623 // 0.025/6.9 // 1/276


A. 0.3623%
A. answers rounded to at least two significant
figures
A. follow-through of incorrect answer to part 2di
A. award BOD mark if correct method has been
shown but candidate has then made an error
performing the division operation
R. if shown that incorrect method used e.g.
dividing by 6.875, even though this arrives at an
answer that is the same when written to 2
significant figures

(d)

(iii)

Alternative
1:
Adjust the mantissa;
To use more bits;
A. "longer" for "more bits" but R. "larger",
"increase size"
Alternative 2:
Reallocate (one) bit; from the exponent to the
mantissa; A. bits
Alternative 3:
Infer one of the two bits on either side of the
binary point (from the other, as they must both
be different); use the freed up bit to store one
more significant digit in the mantissa// use the
freed up bit to represent mantissa more
accurately;

(i)

01111111 01111111
(1 per nybble)
byte)

(ii) 11111111 10000000 OR 10111111 10000000


(1 per byte)

[3]
[2]
[2]

(iii) 11111101 = 128 +(64+32+16+8+4+1) = 3


01101000 = + + 1/16 = 13/16
Number represented = 13/16 * ^3 {1/8}
= 13/128 (or .1015625)
OR:
11111101 = 128 +(64+32+16+8+4+1) = 3
(01101000 = 0.1101)
= 0.1101 * 2^3
= 0.0001101
= 1/16 + 1/32 + 1/128 = 13/128
Accept mantissa: 3/128
exponent: +104

(i)

(1 per line, max 4)

[4]

= (1/8 + 1/32) * 2^4


= 5/32 *16
= 2
OR:
= 0.00101 * 2^4
Hence move point 4 places
= 10.1 = 2 1/2
(1 mark for each underlined section, max 2. Note: Accept decimal values)

[2]

(ii) 010100 0010


(1 for mantissa, 1 for exponent)

[2]

(iii) M = + + 1/32 OR = 25/32


E=3
Number is 25/32 * 8
=6
(1 per line, max 3)

[3]

(i)

+13
mark as follows:
Exponent: +4 // move the pattern four places
Mantissa: +13/16 // 0.1101
Answer: 13/16 24 // or equivalent

[3]

(ii) There will be a unique representation for a number


The format will ensure the number is represented with the greatest possible/more
accuracy/precision
Multiplication is performed more accurately/precisely
[MAX 1]
(iii) Mantissa: 0100 0000
Exponent: 1000
Therefore number is * 28 // +1/512 // +29 // 0.00195

[3]

(b) choices made will effect range and accuracy


More bits used for the mantissa will result in better accuracy
More bits use for the exponent will result in larger range of numbers

(i)

[Max 2]

88
mark as follows:
Exponent: +7 // move pattern 7 places
Mantissa: 11/16 // 1.0101
Answer: 11/16 27 // or equivalent

[3]

(ii) The mantissa/the binary pattern starts with 10 // the first two bits of the mantissa/the
binary pattern are different
[1]
(iii) Mantissa: 1000 0000
Exponent: 0111
Denary: 128 // 27 // 1 * 27
9 (a)(i)

(ii)
(b)(i)

+6.5 give 3 marks


If answer incorrect mark as follows:
Exponent: +3 // move the pattern three places
Mantissa: +13/16 // 0.1101
Answer: 13/16 23 // or equivalent

[3]

(Positive ) The mantissa/byte 7 starts with a zero

[1]

(Normalised ) The mantissa/byte 7 starts with 01 / the first two bits are
different

[1]

(ii)
0

1
(c)

[3]

Mantissa
0
0
0

Mantissa
0
1
1

The precision / accuracy is increased, but


The range of possible numbers is decreased

Exponent
0
1
0

Exponent
1
1
0
0

[MAX 3]
[2]

10 (a) (i)1.75 give 3 marks


If answer incorrect mark as follows:
Exponent: +1 // move the pattern one place
Mantissa: 7/8
Answer: 7/8 21 // or equivalent

[3]

(ii) The mantissa starts with a 10 ...

[1]

(iii) 2.0 normalised


Mantissa Exponent
0

0
[2]

Mantissa

(iv)
0

Exponent
1

Mantissa
Exponent

(b) The precision/accuracy is decreased, but


The range of possible numbers is increased

1
(1)
(1)

[2]

[2]

You might also like