Shifts and masks can pack two small fields into one byte-sized integer.

Packed Fields

packed_fields.c
#include <stdio.h>

int main(void) {
    unsigned int high = ;
    unsigned int low = 5;
    unsigned int packed = (high << 4) | low;
    unsigned int unpackHigh = packed >> 4;
    unsigned int unpackLow = packed & 15;

    printf("packed=%u high=%u low=%u\n", packed, unpackHigh, unpackLow);
    return 0;
}
#include <stdio.h>

int main(void) {
    unsigned int high = ;
    unsigned int low = 5;
    unsigned int packed = (high << 4) | low;
    unsigned int unpackHigh = packed >> 4;
    unsigned int unpackLow = packed & 15;

    printf("packed=%u high=%u low=%u\n", packed, unpackHigh, unpackLow);
    return 0;
}
#include <stdio.h>

int main(void) {
    unsigned int high = ;
    unsigned int low = 5;
    unsigned int packed = (high << 4) | low;
    unsigned int unpackHigh = packed >> 4;
    unsigned int unpackLow = packed & 15;

    printf("packed=%u high=%u low=%u\n", packed, unpackHigh, unpackLow);
    return 0;
}
pack Shifting a field creates room for another field in the low bits.
unpack Shifts and masks recover each field from the packed value.