LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary Conversion...

Hi All,
 
Ok this is quite a hard scenario to explain so I hope I make sense...
 
Basically I want to convert a number to binary but each bits value is multiplied by something I specifiy.
 
For example:
 
Say I have the number 63,500 and want each bit multiplied by 500, I want the binary for this to be:
 
1 1 1 1 1 1 1
 
Where the sum of these added up would be 127 then multiplied by my value of 500 = 63,500.
 
Can anyone think of a quick way of doing this?
0 Kudos
Message 1 of 3
(3,101 Views)
Just divide your integer by 500 (I assume your number is a multiple of 500, so use quotient and remainder for the division) and display it in binary format. 🙂
0 Kudos
Message 2 of 3
(3,097 Views)

Hi thanks for your reply,

That method does work perfectly.

Another method I tried out succesfully was using the format to string and specifying % myNum b - where myNum is the amount of bits you want shown. I took my original number and divided it by 500 and use that method.

Just thought I would let everyone know that your way and mine works 🙂

 

Thanks

0 Kudos
Message 3 of 3
(3,064 Views)