01-09-2020 08:32 PM
OK, here's some very simple code:
(nothing hidden, constants formatted as %016b, representations exactly as indicated(U8, U16, I8))
Without using LabVIEW (i.e. paper&pencil), what are the results for Numeric A and Numeric B?
(Now wire it up and see if you were right. Explain the result. :D)
01-09-2020 09:46 PM
I'd say read the detailed help for Boolean Array to Number, but the key ingredient is missing from the documentation. For a hint, right-click on a Boolean Array to Number Function. Second-nature to bit-bangers but easy to see the potential for confusion.
01-10-2020 02:27 AM - edited 01-10-2020 02:38 AM
The I8 is -1, so when converted, apparently it becomes a -1 16 bit signed number before becoming unsigned. So, it becomes 0xFFFF, or b1111111111111111... Of course, To Unsigned Word Integer also does this.
It met my expectation, but that expectation a was biased with suspicion from this question. It would be easy to get lost when found in the wild.
I had to deal with similar stuff fairly recent. Signed and unsigned Integers with arbitrary nr of bits, need to be converted to I64's (as a general container).
It's weird that there is a IEEE for floating point (conversion), but not for integers.
These functions are available on the CPU, as CBW, CWD and CDQ. AFAIK, in assembler, there's no distinguishing between signed and unsigned values (on normal, non mmx\fp registers), this must come from the way you deal with the values.
01-10-2020 07:23 AM
My answer to this case would have been wrong!