LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why does Labview take 8 bits to represent a Boolean?

Solved!
Go to solution

Since it can take only one of two values, can it not be represented by a bit?

0 Kudos
Message 1 of 9
(2,738 Views)
Solution
Accepted by topic author AJ_CS

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

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 2 of 9
(2,733 Views)

OK..I get it..I also felt there would be some thing like smallest unit or so..thank for clarifying..

0 Kudos
Message 3 of 9
(2,727 Views)

The benefit of booleans is that even when you're wrong, you're only a bit off. 😉

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 4 of 9
(2,720 Views)

@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


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 9
(2,675 Views)

@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

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 6 of 9
(2,668 Views)

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

0 Kudos
Message 7 of 9
(2,624 Views)

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.

Rolf Kalbermatter
My Blog
Message 8 of 9
(2,611 Views)

Rolf,

 

Thank you for correcting the details.

 

Lynn

0 Kudos
Message 9 of 9
(2,602 Views)