01-11-2016 11:53 PM
Dear Sir,
Here I am receiving total 6 words of 32 bits Hex data from Logic Analyzer (from Keysight). Each word consists of different parameters and I have to separate the each parameter from LSB of each word.
For example the first word is 00D8 6720 = 00000000110110000110011100100000
From LSB, they are different parameters consists of 18 bits, 4 bits, 5bits, 1 bit, 1bit, 3 bits.
After that each parameter will be shown in Hex format like first 18-bits = 06720 and next 4-bits = 6, 5-bits = 03, 1-bit = 0, 1-bit = 0 and 3-bits 0.
I implemented this logic for one word using some of string functions buts it’s looking too lengthy.
Kindly let me know if there is any simple implementation to figure out like this.
Thanks & Regards,
S Nagaraju
Solved! Go to Solution.
01-12-2016 02:38 AM
01-12-2016 03:39 AM
Dear sir,
Thank you very much.
Can you please explain about array constant.
Because each word having different sizes and give some clarity of array constant values.
Regards,
S Nagaraju
01-12-2016 03:55 AM
Hi S,
the array constant defines the parts you want to "strip" (aka get the remainder from the Modulo operation) from your input "word" - it's simple math using hexadecimal numbers.
You can also calculate that array from your bit field sizes dynamically or use those bitfield size numbers directly in the loop.