open switch to count down, close switch to count up.
while counting up, when the counter carry sends a pulse, it triggers a count in the opposite direction, causing the borrow to latch on and block any further count up pulses. vice versa for counting down.