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 convertion
Replies: 24   Last Post: Apr 8, 2011 12:23 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

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

hi sir,

for calculating the exponent i have a formula like this
here x= 3.3 %user can enter the value like this
ymax = 1023
N =int(log2(x/ymax)) = -8
there is a another way to get the N value also
like this Ymax/X = 1023/3.3 =310
max(2^-N) <310 ==> 256 % 2^-N value is always less then the result
so N=-8 = 11000

and finding the 11-bit mantissa
i am calculating like this
==> X*2^-N = 3.3*256 =844.8 =845 == 01101001101 =Y

finally i am adding this two binary like ==> 11000 01101001101
if i convert this binary value into hex it will give like 'C34D'

i tried with formula to finding the N value its giving the error like
??? Undefined function or method 'int' for input arguments of type 'double'.

how can i solve this problem..

thank you,

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.