LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1's complement

Solved!
Go to solution
Highlighted

Hi,

I want to convert my data into 1's complement so can anybody suggest any soluton for that. Here i have attached my vi so according to this if i put my knob at -1 i am getting data after hex conversion is FFF  and for +1, 001 but instead of that i want 000 and FFE repectively.

 

Thank you

0 Kudos
Message 1 of 5
(1,318 Views)
Highlighted
Solution
Accepted by topic author spv162

Hi spv,

 

seems you need to subtract 1 from your conversion result:

check.png

Atleast this works according to your examples…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 2 of 5
(1,311 Views)
Highlighted

This sort of does what you want except there are 4 characters Hex string when knob is greater than -1

 

Ken

0 Kudos
Message 3 of 5
(1,308 Views)
Highlighted

Thank you all i got my result.

0 Kudos
Message 4 of 5
(1,289 Views)
Highlighted

Hi spv,

 

according to Wikipedia "one's complement" is defined a little different to your explanation…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 5
(1,281 Views)