How to select option for binary coded value?

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

Why don't you start by telling us what system you're using, what language you're using, and showing us what you've tried so far?

Hello Don,

Initially because is not to complex, I'm trying with Matlab code.

To hecode only from hex to dec the first bytes is easy, but when
the byte is "binary coded" and the descrioption is in a table like I show in previous post, is not a direct conversion, because is based in a table and
I'm don't know if it is better to do several IF's for this.

This is what I have so far.

fid = fopen('C:\Binary_file');
x0 = fread(fid, [1,1],'*char');% Byte 0, Numeral 1, (ISO coded=Hex)
x1 = fread(fid, [1,22],'*char');% Bytes 1-12, (ISO coded)
x2 = fread(fid, [1,1],'*char'); %Byte 23,(Binary coded B0-B3).
x3 = dec2hex(fread(fid, [8,1])); %Byte 24.

x0 = fread(fid, [1,1],'*char');% Byte 25, (ISO coded=Hex)
x1 = dec2hex(fread(fid, [1,10]));% Byte 26, (ISO coded)

x2=hexToBinaryVector(x1,8);

disp(x2);
fclose(fid);

Thanks for any advice