It counts in one bit square wave to 1 to 4 decimal order. It toggles from the square-wave input to count it in binary code with a toggle flip flop(top logic gates), then it decodes the 2-bit binary to decode(bottom logic) it to decimal form. It's screwy at first, because it has no information yet.
BLUE RESULT----INPUT SQUARE WAVE
LEFT 2-LEDs------BINARY CODE
RIGHT 4-LEDs---1-4 DECIMAL