badmathkid
Badges: 12
Rep:
?
#1
Report Thread starter 1 year ago
#1
How would you convert the denary value 0.0625 into normalised floating point binay using an 8-bit mantissa and a 4 bit exponent?

My problem is that in order to normalise a positive value, you must move the decimal back or forth until a 0.1 is achieved. In this case, 0.0625, in binary, is:
00000000.0001

All help appreciated.
0
reply
FryOfTheMann
Badges: 7
Rep:
?
#2
Report 1 year ago
#2
So you currently have 0000.0001 (The number of 0s at the start doesn't matter for now)
To have a normalised value, you must move the 1 three spaces to the left to get 0000.1000
So the exponent will be negative three, 1101.
You would then write this value with an 8-bit mantissa and 4-bit exponent as:
[0.1000000] and [1101]

You can check this by multiplying 1/2 (mantissa) by 2^(exponent):
0.5 * 2^-3 = 1/16 = 0.625
1
reply
badmathkid
Badges: 12
Rep:
?
#3
Report Thread starter 1 year ago
#3
(Original post by FryOfTheMann)
So you currently have 0000.0001 (The number of 0s at the start doesn't matter for now)
To have a normalised value, you must move the 1 three spaces to the left to get 0000.1000
So the exponent will be three, 0011.
You would then write this value with an 8-bit mantissa and 4-bit exponent as:
[0.1000000] and [0011]
Oh right, I didn't think that it was as simple as that. That makes sense, thnk you.
0
reply
FryOfTheMann
Badges: 7
Rep:
?
#4
Report 1 year ago
#4
(Original post by badmathkid)
Oh right, I didn't think that it was as simple as that. That makes sense, thnk you.
Please note that I made a mistake and had the exponent as positive 3 when it should have been negative! I have now changed this. No problem
0
reply
badmathkid
Badges: 12
Rep:
?
#5
Report Thread starter 1 year ago
#5
(Original post by FryOfTheMann)
Please note that I made a mistake and had the exponent as positive 3 when it should have been negative! I have now changed this. No problem
Oh I see, the exponent should have been 1011. Thanks again!
0
reply
CopyThat
Badges: 12
Rep:
?
#6
Report 1 year ago
#6
I hate all this mantissa and exponent stuff, it's so easy to make a mistake to get the entire question wrong
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
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 Bristol
    Undergraduate Open Afternoon Undergraduate
    Wed, 23 Oct '19
  • University of Exeter
    Undergraduate Open Day - Penryn Campus Undergraduate
    Wed, 23 Oct '19
  • University of Nottingham
    Mini Open Day Undergraduate
    Wed, 23 Oct '19

Have you made up your mind on your five uni choices?

Yes I know where I'm applying (153)
59.53%
No I haven't decided yet (59)
22.96%
Yes but I might change my mind (45)
17.51%

Watched Threads

View All
Latest
My Feed