You keep dividing by 2 and write down the remainders all the way down
to 0, then read it form the bottom up. Here's my example
511
255 | 1
127 | 1
63 | 1
31 | 1
15 | 1
7 | 1
3 | 1
1 | 1
0 | 1
Now read it from the bottom up... and you get 111111111
That's a bad example though because it's confusing to know which
direction to read from. Here's another, let's do the number 89
89
44 | 1
22 | 0
11 | 0
5 | 1
2 | 1
1 | 0
0 | 1
In this case, the binary representation of the number 89 is 1011001. Simple eh?
We'll do one more which is small, how about the number 10
10
5 | 0
2 | 1
1 | 0
0 | 1
This binary representation is 1010. The way you can check is to
multiply each digit by increasing powers of 2. So in the example above
for 1010, you have from right to left:
0 * 2^0 = 0 (any number raised to the 0 is 1 except for 0)
1 * 2^1 = 2
0 * 2^2 = 0
1 * 2^3 = 8
0 + 2 + 0 + 8 = 10 which is the original number you started with. You
can go back and check the other two examples to make sure you
understand.
Thanks for your question!
skermit-ga |
Request for Answer Clarification by
tong123-ga
on
04 Oct 2004 16:27 PDT
Thanks. So what is the meaning of excess-511?
|
Clarification of Answer by
skermit-ga
on
04 Oct 2004 19:59 PDT
I'm sorry, I read that as example - 511. Where are you getting this excess 511 from?
|
Request for Answer Clarification by
tong123-ga
on
04 Oct 2004 20:55 PDT
From a problem as follows:
Consider a 40-bit floating point format: 1 bit sign, 10 bit exponent
and 29 bit mantissa. The 10-bit exponent is for base 2 and is
expressed in excess-511 code, ...
Thanks.
|
Clarification of Answer by
skermit-ga
on
04 Oct 2004 21:15 PDT
I've worked with IEEE floating point representations before, but have
never come across "excess-511 code". Is there a reference I can look
at for this question?
skermit-ga
|
Request for Answer Clarification by
tong123-ga
on
04 Oct 2004 21:49 PDT
Sorry that I have no idea about that. I saw this problem in a previous
exam, and it is without any solution.
Thanks.
|
Request for Answer Clarification by
tong123-ga
on
04 Oct 2004 21:54 PDT
I am afraid that I have no electronic copy of it, so I post the full
problem here. It is like this:
Consider a 40-bit floating point format: 1 bit sign, 10 bit exponent
and 29 bit mantissa. The 10-bit exponent is for base 2 and is
expressed in excess-511 code.
1. Show the representation of 1.5 and -10.
2. What is the range of numbers can be represented?
3. What is the approximate decimal-equivalent precision of this format?
Thanks.
|
Clarification of Answer by
skermit-ga
on
07 Oct 2004 03:01 PDT
Thank you to efn-ga and pinkfreud-ga for helping on this question. I
got confused with the notation of the excess-511, and never thought it
to be this:
http://www.trotek.ec-lyon.fr/~muller/cours/numeration/relatif.html.en
This should answer your question. Sorry for the delay.
skermit-ga
|