12-01-2024 02:18 PM - edited 12-01-2024 02:40 PM
The correct VI is:
12-01-2024 11:26 PM - edited 12-01-2024 11:35 PM
This was a 12 year old thread and I don't think your code is correct. For example if the tail booleans are all false, they would get dropped. Your To U8 can be omitted if we change the output configuration of boolean array to number accordingly.
Also using an IPE skeleton is a bit odd because it has no function.
12-01-2024 11:50 PM
If the array size is not divisible by 8, we need to pad with one element. (output A)
Note there is also the 4.x typecast, but the bits in each byte will be reversed (output B)
Of course if the array size is not divisible by 8, you need to somehow retain metadata about the original length, else we cannot correctly reverse the operation. It is very likely that the remainder is zero and we never need to worry about any of this.
12-17-2024 07:25 AM
12-17-2024 10:01 AM - edited 12-17-2024 10:05 AM
@Mumris did not write anything:
12-18-2024 10:14 AM
Agree with you. Your algorithm is more compact and even faster by 0.5 microseconds. You won!
12-20-2024 11:33 AM
@Mumris wrote:
Agree with you. Your algorithm is more compact and even faster by 0.5 microseconds. You won!
Speed depends on the size of the input array and the benchmarking procedure (very difficult, many landmines! Start here to learn more.)
Microseconds is not a unit of speed. Also relative times are more useful than absolute differences.
Case 1: A takes 1 nanosecond and B takes 0.5 microseconds.
Case 2: A takes 1 seconds and B takes 1.0005 seconds.
Both cases differ by 0.5 microseconds, but case 1 is much more impressive.
You still did not configure the output representation to U8, causing the creating of a blue array that takes twice as much memory (I16), which then gets coerced back to U8 at the terminal. Did you notice the red coercion dot?