Revision: a water-logic binary counter takes much less space and machinery than shown above. All it takes per bit is one door and one bridge.
~~~
#B#
#D#
#^#
###
~ - pressurised water
B - raising bridge
D - Door
^- pressure plate reacting to 5-7 water
Both bridge and door are linked to the pressure plate itself, the door's also linked to the input signal. The pressure plate itself also activates the output - signal for the next toggle cell and potentially for the display.
Starting state: 7/7 water, door closed, bridge raised, pressure plate "on".
Toggling to "off":
1 - input turns "on": door opens, water lowers to 3-4, trigger condition for the plate no longer fulfilled
2 - after 100 steps, the plate turns off, closing the door and sending a "lower" signal to the bridge.
3 - after another 100 steps, the bridge lowers, water can't get through because the door's closed. "Off" state is reached.
4 - at some later point, the input will turn "off" again, sending another "close" signal to the door, which is ignored.
Toggling "on"
1 - input turns "on": door opens, temporarily lowering water depth even further, which does nothing, because it's below the trigger threshold anyway. Since the bridge is lowered, fresh water can reach the plate.
2 - water depth over the plate rises over the trigger threshold (reaches 7/7 when enough water is provided), plate turns "on", sending a redundant "open" signal to the door and a "raise" signal to the drawbridge. "On" state reached.
3 - 100 steps later, the bridge raises, cutting off water flow. Since the cell itself is full of water, height doesn't change.
4 - some time later, the input turns "off", closing the door. Once again, this doesn't change water depth over the plate.
So what this thing does is toggle state whenever the input changes state to "on". Exactly what you need for a toggle cell. I switched my four-bit counter to this design, and it works. It can be built on 5x2 tiles of floor and takes one door, one bridge, one pressure plate and three links per bit. Caveat: since it's the "on" signal that triggers toggles, a counter built from simple cells will count _down_. Adjust your logic accordingly if you don't want to fiddle with two-plate cells (one to regulate the cell itself and send the "true" output, an opposite-condition plate to manage the signal for the next cell).
Tested and proven.
PS: ah, found it - proposed old-school design for a one-bit counter:
http://www.bay12forums.com/smf/index.php?topic=30514.msg414841#msg414841Yikes. Massive (five floodgates, four bridges, four pressure plates), slow, multiple drains and still needs an input that reliably switches off again within 200 steps, or it'll just oscillate. As a minor saving grace, it drains only while switching, not in a "saved" state.