johnwasser:
It might simplify things somewhat to use 6 shift registers: Two four hours, two for Minutes, and two for Seconds. You wouldn't use all 16 bits for each number but it would save some of the complexity of packing the bit fields more closely.To convert from a number to a number of bits:
unsigned int bits = (1U<<number) -1;That will give you 0b0 for 0, 0b1 for 1, 0b11 for 2, 0b111 for 3, etc. All the way up to 0b0111111111111111 for 15. It won't work for values over 15 but you only need values up to 9.
I like this, but to add... you could do the actual counting using only shifts. For each digit, a count increment is just a left shift in a 1. Then clear the register and carry 1 to the next digit on overflow.