Hello everybody,
I looking for advice.
I'm trying to decode a binary file. Some parameters are "Binary coded", that means that if a byte in hexadecimal is "0A", then in binary is 00001010. So, to decode this Byte I need to refer to the table below (depending the value in binary format, the description applies for parameter A or for parameter B).
For this Byte (00001010), match the 3rd option "PARAMENTER A active".
So, my question is: What do you experts suggest me to do?, insert 6 IF Statements depending the value of the Byte, or put the table in another file?
Any other option?
*There are several bytes, where their decoding is explained in tables like I show here.
PARAMENTER A PARAMENTER B
B7 B6 B5 B4 B3 B2 B1 B0 Description
X X X X 0 0 0 0 PARAMENTER A not provided
X X X X 1 0 0 0 PARAMENTER A provided
X X X X 1 0 1 0 PARAMENTER A active
0 0 0 0 X X X X PARAMENTER B not provided
1 0 0 0 X X X X PARAMENTER B provided
1 0 1 0 X X X X PARAMENTER B active
Thanks in advance for your help.
Regards