Google Answers Logo
View Question
 
Q: problem in computer arithmetic ( No Answer,   2 Comments )
Question  
Subject: problem in computer arithmetic
Category: Computers > Algorithms
Asked by: tong123-ga
List Price: $5.00
Posted: 04 Oct 2004 13:30 PDT
Expires: 17 Nov 2004 10:41 PST
Question ID: 410231
How to express an integer in base 2, excess-511 code?
Answer  
There is no answer at this time.

The following answer was rejected by the asker (they received a refund for the question).
Subject: Re: problem in computer arithmetic
Answered By: skermit-ga on 04 Oct 2004 16:05 PDT
 
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
Reason this answer was rejected by tong123-ga:
What I am asking is "How to express an integer in base 2, excess-511
code", but the answer that I got is just telling me how to convert an
integer into binary. The "excess-511 code" part is not answered.

Comments  
Subject: Re: problem in computer arithmetic
From: efn-ga on 05 Oct 2004 22:00 PDT
 
IEEE-754 floating point format uses excess-127 in the 8-bit exponent
of a single-precision number and excess-1023 in the 11-bit exponent of
a double-precision number.  Excess-511 in a 10-bit exponent would
presumably work the same way.
Subject: Re: problem in computer arithmetic
From: tong123-ga on 06 Oct 2004 07:55 PDT
 
Oh, that solves the problem. I can't find any excess-511 online, but a
bunch of excess-127s. It seems that they simply minus 127 from the
converted binary and get the final result. excess-511 on 10 bit code
should work in this way.


Thanks.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy