Normalised floating point binary Watch

hyper409kai
Badges: 3
Rep:
?
#1
Report Thread starter 3 years ago
#1
OCR AS Level Computer Science H046/01 Computing principles Sample Question Paper

4 (d) (i) Using normalised floating point binary representation using 4 bits for the mantissa and 4 for the exponent, represent the denary value 1.75. You must show your working.
Answer: 0111 0001

4 (d) (ii) Using normalised floating point binary representation using 4 bits for the mantissa and 4 for the exponent, represent the denary value -1.75. You must show your working.
Answer: 1001 0001

How would you answers these questions? What's the process?

Thanks!
0
reply
scottmn108
Badges: 2
Rep:
?
#2
Report 2 years ago
#2
(Original post by majicdude)
OCR AS Level Computer Science H046/01 Computing principles Sample Question Paper

4 (d) (i) Using normalised floating point binary representation using 4 bits for the mantissa and 4 for the exponent, represent the denary value 1.75. You must show your working.
Answer: 0111 0001

4 (d) (ii) Using normalised floating point binary representation using 4 bits for the mantissa and 4 for the exponent, represent the denary value -1.75. You must show your working.
Answer: 1001 0001

How would you answers these questions? What's the process?

Thanks!
Floating point binary is really nasty... normalisation does not come into this question but it is just as tricky :-(

Q1) So we first of all want to represent 1.75 in what is called fixed point binary. This is just like normal binary (with the headings 128, 64, 32 ...) except we then use the headings 1/2, 1/4, 1/8 ... and a decimal point. We are using 4 bits for the mantissa (aka the value we are representing) so we do the following:

128 64 32 16 8 4 2 1 . 1/2 1/4 1/8 1/16

1 . 1 1

(1 goes into 1, so we write a binary 1 in the one column)
(put the decimal point in)
We now just have the 0.75 part to represent.
1/2 (0.5) goes into 0.75 once (so we write a one) leaving 0.25
1/4 (0.25) goes into 0.25 to leave 0.

Now we want to make sure our number does not become negative, so we make sure the first binary digit is a 0.

so we had 1.11 so we put a 0 in front to make it 01.11 (if this seemed confusing, then I suggest you look up sign and magnitude, also on the OCR spec :-) )

Now the exponent. Binary won't allow us to have a " . ", so we do the following...

(sign bit) (mantissa)
0 | 1.11 (split to make it easier to see)

We want to move the point to the LEFT in this case so that it is after the 0 (where the line is). We always do this to remove the point. Since it only has to move once, the exponent is therefore 1 == 0001 as a 4 bit binary number.

so therefore:
1.75 is 0111 0001 in floating point binary.

This is soooo tricky to explain here and there is much more two it. Q2 requires two's complement! Hope this helps...
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • University of Roehampton
    Department of Humanities; Department of Drama, Theatre and Performance; Department of Social Sciences; Department of English and Creative Writing Undergraduate
    Wed, 20 Feb '19
  • Keele University
    Postgraduate Open Afternoon Postgraduate
    Wed, 20 Feb '19
  • Manchester Metropolitan University
    Postgraduate Open Day Postgraduate
    Wed, 20 Feb '19

Do you give blood?

Yes (73)
7.84%
I used to but I don't now (26)
2.79%
No, but I want to start (347)
37.27%
No, I am unable to (234)
25.13%
No, I chose not to (251)
26.96%

Watched Threads

View All