you didn't get the bit operations at all.
Unfortunately they're not easy to explain. Look at this:
for what type of bit operators exists.
Ok, what does this do:
unsigned char x : 4; // This are the lower 4 bits in a byte
unsigned char y : 4; // This are the higher 4 bits in the same byte
unsigned char z : 4; // This are the lower 4 bits in a second byte
// it is possible to use other types like unsigned int which would lead to  usable bytes
// You can use it as follows
a.x = 5; // The code for this would be: byte value = 5 | (y & 0xf0)
// what would happen if a.x = 20? Well: it exceeds the 4 bit capacity and would overwrite y!
a.y = 5; // The code for this would be: byte value = (5 << 4) | x
// the byte value: 0x55
int b = a.x // resolves to: byte value & 0x0f
int c = a.y // resolves to: byte value >> 4
if you write the hex value 0xf0 as binary it would be 11110000
The point is that c/c++ knows 3 number system: decimal, hexadecimal, and (rarely used) octal.
But unfortunately not
binary. So if you want to manipulate a certain bit (like the third: 00000100) you have to convert it. Using the calculator: The third bit has the value 4.
does the following 1 | 0 = 1 (this is just 1 bit, but it can be use for multiple bits)
does the following 1 & 0 = 0
shifts the bits (5 -> 101) x (four in this case) times left -> (bin: 1010000 = dec: 80 = hex: 50)
shifts the bits x (four) times right
hope the explanation helped somewhat (and i didn't make a mistake somwhere).
I suggest that (both) you check that out and play with some values to get the feeling for that
Thist may help: