The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: data conversion
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List

Posts: 22
Registered: 2/16/11
data conversion
Posted: Apr 7, 2011 3:35 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

hi all,
i am getting some problem in data conversion
if i give the hex string like 'C34D' the output is 3.3
C34D =11000 01101001101
here first five bits N = 11000 = -8 and remaining 11 bits mantissa Y= 845
i used this formula X=Y.2^N to solve the upper equation. here the N value is always binary signed integer

it is working fine. if i give the input as 3.3 how to get it back my hex string like 'C34D'
always Ymax = 1023;

and X= 3.3 % given value

ymax/X = 1023/3.3 = 310 ;

max(2^-N) <310 ==> 256;

here N = -8 = 11000b

===> X*2^-N == 3.3*2^8 ==844.8 ==845 ==> 01101001101 ==>Y

if i combined two bytes it will get hex string

like 1100001101001101 = C34D

how can i get it..
plz help me..

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.