07-04-2014 02:00 AM
Since it can take only one of two values, can it not be represented by a bit?
Solved! Go to Solution.
07-04-2014 02:03 AM
The memory controllers smallest unit is a byte, and reading from memory is done 32 bit at a time, so there's no benefit to use a single bit. If you use alot of bits, you can mask them into an I32 which is often done in e.g. C.
/Y
07-04-2014 02:14 AM
OK..I get it..I also felt there would be some thing like smallest unit or so..thank for clarifying..
07-04-2014 02:21 AM
The benefit of booleans is that even when you're wrong, you're only a bit off. 😉
/Y
07-04-2014 06:10 AM
@Yamaeda wrote:
The benefit of booleans is that even when you're wrong, you're only a bit off. 😉
/Y
Unless you are having fun with Type Casting
0 = False
Everything Else = True
07-04-2014 06:29 AM - edited 07-04-2014 06:38 AM
@crossrulz wrote:
@Yamaeda wrote:
The benefit of booleans is that even when you're wrong, you're only a bit off. 😉
/Y
Unless you are having fun with Type Casting
0 = False
Everything Else = True
I guess that's like arguing with girlfriend/wife; when all bits align you're right, else you're wrong! 😄
/Y
07-05-2014 03:31 PM
Early versions of LV did use packed bits but as processors became more powerful and memory became cheaper the overhead to pack and upack the bits outweighed the smaller memory footprint.
Lynn
07-05-2014 07:40 PM
Only for boolean arrays. And skalar booleans were 16 bit which was the standard boolean format on MacOS 6 + 7. The complication and performance loss with packing and unpacking, made the LabVIEW developers change the boolean representation in LabVIEW 5 to be byte sized, like most C++ compilers use too, and to forget about packing for boolean arrays.
07-05-2014 08:25 PM
Rolf,
Thank you for correcting the details.
Lynn