07-26-2017 03:33 PM
I have a byte array - meaning all the numbers are between 0 - 255.
I need to add all of them in a binary/ hex addition format. Meaning the summation will still be an 8 bit number and stay between 0 - 255. The extra bit (9th bit) that is created with summation of two numbers will be ignored.
Example: 254 + 254 = 508 in decimal summation
254 + 254 = 253 in binary addition
Is there a way to solve this with a single vi, and not manually implementing the algorithm.
Solved! Go to Solution.
07-26-2017 03:42 PM
How about this?
07-26-2017 03:43 PM - edited 07-26-2017 03:46 PM
True this works, but I am seeking an array addition of all elements, where I have like 20 elements.
IT is a byte array.
07-26-2017 03:49 PM
Something like this?
07-26-2017 03:52 PM
Hi RTSLVU
Not really, I want to add all the elements in a single array. For example the first array you have with eleemnts: 255 254 253 252 253 ; I want to add all those five and get the result to do manipulations with that later on in my code.
07-26-2017 03:57 PM
Ohh... Right off the top of my head I would do this...
07-26-2017 04:46 PM
or this...
07-26-2017 05:14 PM - edited 07-26-2017 05:15 PM
@RTSLVU wrote:
Ohh... Right off the top of my head I would do this...
Unless you initialize that shift register, surprises will happen 😮 Not good!
(yes, I would just go withe the "add array elements" above)
07-26-2017 05:19 PM
You know I was looking for Add Array elements and for the life of me I could not find it in the pallette
07-26-2017 06:16 PM
@RTSLVU wrote:
You know I was looking for Add Array elements and for the life of me I could not find it in the pallette
Yes, it is surprising that it is NOT in the array palette :D.