キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Offset binary to 2's complement

Hello.

 

How can I convert 12-bit offset binary word to 12-bit 2's complement word? Thanks.

0 件の賞賛
メッセージ1/4
2,379件の閲覧回数

Hi Valentin,

 


@Valentin87 wrote:

How can I convert 12-bit offset binary word to 12-bit 2's complement word? Thanks.


What is a "12-bit offset binary word"?

What is a "12-bit 2's complement word"?

 

When it comes to LabVIEW datatypes a "word" typically is a 16-bit entity, like U16/I16. So you need to explain your input datatype and the expected result more clearly before we can help you…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ2/4
2,373件の閲覧回数

For example, I have dec value = 3754 (U16). I must  get value in I16 in 2's complement code.

0 件の賞賛
メッセージ3/4
2,366件の閲覧回数

Lots of options, but this does the trick:

 

wiebeCARYA_0-1643025416848.png

 

If the intention is to convert to double (the 'resolution' of 0.0625 is just an example):

12 bit 2th complement.png

メッセージ4/4
2,349件の閲覧回数