05-08-2007 08:27 PM
05-08-2007 08:28 PM
05-09-2007 09:19 AM
05-09-2007 11:10 AM
05-09-2007 11:31 AM - edited 05-09-2007 11:31 AM
Message Edited by altenbach on 05-09-2007 09:33 AM
05-09-2007 11:49 AM - edited 05-09-2007 11:49 AM
Message Edited by smercurio_fc on 05-09-2007 11:50 AM
05-09-2007 12:14 PM - edited 05-09-2007 12:14 PM
(note that we get different results for some input values. Do you have the original documentation for the conversion?)
Message Edited by altenbach on 05-09-2007 10:25 AM
05-09-2007 12:28 PM
05-09-2007 01:38 PM - edited 05-09-2007 01:38 PM
@TMDATA wrote:
I am getting a 16.12 bit signed binary number. The first bit is multiplied by -2^3, the second bit is multiplied by 2^2, third bit by 2^1, fourth bit by 2^0 then the rest are of bits are multiplied by 2^-1, 2^-2, 2^-3... and so on until 2^-12 to convert them to decimal. Then all of these are to be added up. That is what I am trying to do. I am sure there is a better way to do this.
OK, that's exacty what my code posted above does! Simple enough? 🙂
(Even simpler, you can fold the power of two calculation into a diagram constant.)
The results are not always the same because you have a wiring mistake as shown in the picture.
Message Edited by altenbach on 05-09-2007 11:41 AM
05-09-2007 02:18 PM