+2 votes
608 views
in Software by Sugandh Pratap Singh (18 points)

Hi,
I'm trying to convert both positive and negative integers to 32-bit binary using booleans in Typhoon HIL.

The Boolean Split works fine for unsigned integers, but when I input negative values, all outputs turn to zero.

Could you please suggest a way to convert signed integers (including negatives) into 32-bit boolean representation correctly?

1 Answer

+4 votes
by Luka Jovančić (272 points)
selected by Sugandh Pratap Singh
 
Best answer

Hello,

Using data type conversion should work in this case. Like so: 

In this example the output is 0xFFFFFFFF which is exactly -1 in the two's complement system.

by Sugandh Pratap Singh (18 points)
Thank You @ Luka Jovančić. My problem is resolved.
Welcome to the Typhoon HIL user forum. Please check self-service support resources before posting a question.

HIL Specialist 2.0 courses
Documentation
Knowledgebase (Legacy)
Video support on demand
Youtube tutorials

For subscription-based support visit Typhoon HIL Support Center
...