Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Logarithmic number system

Status
Not open for further replies.

krishvamsi

Junior Member level 2
Joined
Aug 21, 2018
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
160
could anyone explain me the 32 bit representation of a decimal number (ex-36.5) in logarithmic number system ?
 

I think you will need to make your question a bit clearer if you want a proper answer.
There can be any number of ways to represent a number using 32 bits. I *think* you want to understand one of the IEEE encoding systems (which are very widely used can be supported in hardware on some devices) in which case I suggest that you do a search of the Internet as there are many references that explain this.
An alternative is to use a fixed-point representation which effectively assumes there is a 'binary point' somewhere between two of the bits - in effect this is a scaled value that gives you fractional values.
On the subject of logarithmic number systems, you need to be more specific. What number base are you thinking about: 10, 2 e???
I suspect you may mean values that are expressed as a mantissa and a number base exponent - if that is the case then look back at the IEEE systems mentioned above.
Susan
 

I think you will need to make your question a bit clearer if you want a proper answer.
There can be any number of ways to represent a number using 32 bits. I *think* you want to understand one of the IEEE encoding systems (which are very widely used can be supported in hardware on some devices) in which case I suggest that you do a search of the Internet as there are many references that explain this.
An alternative is to use a fixed-point representation which effectively assumes there is a 'binary point' somewhere between two of the bits - in effect this is a scaled value that gives you fractional values.
On the subject of logarithmic number systems, you need to be more specific. What number base are you thinking about: 10, 2 e???
I suspect you may mean values that are expressed as a mantissa and a number base exponent - if that is the case then look back at the IEEE systems mentioned above.
Susan
. Hello thanks a lot for the reply sir . I'm clear with fixed point and floating point representations . I searched a lot regarding logarithmic number system but didn't get any detailed explanation with an example . In the question I meant represening a decimal number +36.5 in a 32 bit logarithmic number system of base 2 . Could you please provide a detailed solution to this ?
 

36.5 = 2^5.18982
Save the 5.18982 in whatever way you want.
Susan
 

36.5 = 2^5.18982
Save the 5.18982 in whatever way you want.
Susan
sir how you got 5.18982 ? And also could you give the logarithmic number representation as a triplet {z,s,x} where z is a flag bit which is asserted when the original number is 0 since logarithm of 0 is undefined . S represents sign and x = log b(X) b is the base , X is the original number .
 

Answer to the math question:

2^x = 36.5
=>
ln(2^x) = ln(36.5)
=>
x * ln(2) = ln(36.5)
=>
x = ln(36.5) / ln(2) = 5.18982...

The calculation will also work with the 10-based logarithm:
x = log(36.5) / log(2) = 5.18982...
 
Answer to the math question:

2^x = 36.5
=>
ln(2^x) = ln(36.5)
=>
x * ln(2) = ln(36.5)
=>
x = ln(36.5) / ln(2) = 5.18982...

The calculation will also work with the 10-based logarithm:
x = log(36.5) / log(2) = 5.18982...

Thanks a lot . Now I clearly understood . So , now can I represent this 5.18982 in either fixed point or floating point binary form & proceed ?
 

And also could you give the logarithmic number representation as a triplet {z,s,x} where z is a flag bit which is asserted when the original number is 0 since logarithm of 0 is undefined . S represents sign and x = log b(X) b is the base , X is the original number .
The 'z' bit is easy - if(x==0) z = 1 else z = 0 - use whatever equivalent code is in your favourite language.
The 's' bit is either easy or not, depending on your point of view. The log of a negative number is not defined (strictly speaking it can be represented as a complex number but that is a whole new level of pain) so if the sign is negative then the rest of the value is irrelevant. However, sometimes it is useful to carry the sign separately in the calculation and just take the log of the absolute value. In my day, you represented the negative sign with a bar over the part of the log value to the left of the decimal point - you just had to remember to handle it correctly through the rest of the calculation e.g. any operation of the log number had to result in the correct "sign" of the result.
You have seen the 'x' bit already.
You have also been told how to calculate the log to any base above: log b(x) = log y(x)/log y(b) using the same notation you did: b = the log base, x is the number and y is whatever intermediate base is convenient, typically 10 or e
I must admit that I'm surprised that this question is being asked: if you know enough about maths to know there are logarithms then you should have been taught these very basic principles - I was in about 2nd year high-school (i.e. age about 14).
Susan
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top