From: Walter Roberson on
ANITHA SHUKLA wrote:
> "ANITHA SHUKLA" <shuklapatela(a)gmail.com> wrote in message
> <hrev78$qop$1(a)fred.mathworks.com>...
>> Hello everyone,
>>
>> am looking for the matlab code for converting NEGATIVE FRACTIONS TO
>> BINARY.
>>
>> example fractions like------ - 0.432937622070313,
>> -0.131301879882813, -0.312225341796875.
>>
>> so could any one plz help me out how to convert from
>> negative fractions to binary.
>
> IN FIXED-POINT FORM
> THE MAIN PROBLEM IS I NEED TO GENERATE THE RECEIVED SIGNAL
> STRENGTH(RSSI) OF 16-BIT IN FIXED POINT.
>
> FOR SUPPOSE IF I GOT ADC VALUES BETWEEN -32768 TO +32767, ASSUME LIKE
> -29312, -4565, 65433, 12345, -12343
> THEN PLZ TELL ME HOW TO GET RSSI USING FIXED POINT ALGORITHM IN MATLAB

That's the opposite of your original question. In your original
question, you had fractions that you needed converted to binary, and in
this question you effectively have binary that you need to convert to
fractions.

Unfortunately, there are an infinite number of possible answers, as we
do not know where the decimal point has been fixed.

If the fixed point is immediately before the first bit of the 16 bits,
so that the range of values is from -1 to just a hair less than 1, then
just divide the 16 bit value by 32768 .
From: ImageAnalyst on
On May 5, 5:30 pm, "ANITHA SHUKLA" <shuklapat...(a)gmail.com> wrote:
> FOR SUPPOSE IF I GOT ADC VALUES BETWEEN -32768 TO +32767, ASSUME LIKE
>   -29312, -4565, 65433, 12345, -12343
--------------------------------
And how is 65433 between -32768 and +32767?

I agree with the others that there is not enough info. Even if you
did supply it, it's so trivial (simple scaling and offsetting) that
I'm not sure where your difficulty comes in.