Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    1
    ReputationRep:
    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!
    Offline

    2
    ReputationRep:
    (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...
 
 
 
  • 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.

  • Poll
    Break up or unrequited love?
  • 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.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Quick reply
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.