compare 4 digits in a boolean array

I have a 21-digit boolean array, and need to compare positions 10-13 to a 4-bit CHAR. How do I do this?

boolean sensorNoData[20];

sensorNoData[0] = false; 
sensorNoData[1] = false;
sensorNoData[2] = false;
sensorNoData[3] = false;
sensorNoData[4] = false;
sensorNoData[5] = false;
sensorNoData[6] = false;
sensorNoData[7] = true;
sensorNoData[8] = false;
sensorNoData[9] = true;
sensorNoData[10] = false;
sensorNoData[11] = true;
sensorNoData[12] = false;
sensorNoData[13] = true;
sensorNoData[14] = true;
sensorNoData[15] = false;
sensorNoData[16] = false;
sensorNoData[17] = false;
sensorNoData[18] = false;
sensorNoData[19] = false;
sensorNoData[20] = false;

How can you have a four-bit char ? Even the Hawaiian alphabet needs more bits than that.

I thought a char was 4 bits. I am only looking to compare 4 bits.

I don't know where you got the idea that a char is four bits. Four bits can have only 16 different values. How could you represent a "character" with sixteen different values ?

Well you get a byte, and you put your four bits of information into it, and leave the other four bits as zero.

And then you get another byte, and you set four bits in that byte according to the desired elements of your boolean array, and leave the other four bits as zero.

And then you compare those two bytes, and if they are the same, then you have a match. The usual way to compare them, is to subtract one byte from the other byte, and see if the result is zero.