LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make this in labview : find the numbers of overlapping between bits

Solved!
Go to solution

Altenbach, I agree. I just know on certain RT systems (*cough cough* cRIO) I have had to switch from boolean to bitwise comparissons because the number to boolean array was hurting my timing. So, I just wanted to throw this possible solution out there in case that is a requirement for anyone. On a PC or beefy PXI controller, the readability of the boolean array plays the trump card on the bit twiddling without a doubt. But, I have seen it negatively effect performance in certain cases.

0 Kudos
Message 11 of 14
(397 Views)

Greg, Now i am thinking why number to boolean array causes problem some time on dedicated system.

Is that because you already have bits ( some value ) stored in memory and now you are building an array so basically adding a 32 bit header and following same bits again so conversion does not play any importance in terms of calculation ( actually adds overhead ) because however we interpret it computer or hardware will see only 0 and 1.

 

Right, wrong or absolutally wrong   

0 Kudos
Message 12 of 14
(390 Views)

Someone can probably give a better answer than I, but I assume it has to do with the fact that in memory a U32 takes up 4 bytes (i.e. 32 bits), but because each boolean in LabVIEW takes up a byte, not a bit, there is some additional overhead converting from one to another. So, a 32 bit number, when converted to a boolean array now becomes 32 bytes. I don't know what the overhead associated with this is, or when it no longer becomes negligible (i guess that is application specific), but I'm just commenting on what I've seen.

0 Kudos
Message 13 of 14
(379 Views)

A boolean array is very wasteful because only one of every eight bits carries any useful information. The rest just wastes memory.

Message 14 of 14
(377 Views)