# Counter example

I am building a digital 1 bit counter.

The function of the bit counter is:

I have stored a value somewhere. I take this value and add 1(digital) if the stored value was 0 then the output value will be 1 and it will be stored in the storage place. If the stored value was 1 then then output value will be 0 and it will be stored in the storage place.

How can I achieve this?

I have tried using XOR Gates and DRAM cells together which didn't work, a kind of Not logic gate circuit and even flip flops.

• this sounds extremely straightforward, as this is really just a toggle – you'd negate the your stored bit. A NOT gate can be implemented using an XOR gate and a constant true value, for example. It's not clear how you've failed so far, so I'll describe this question as "too vague". Oct 6, 2020 at 21:51
• A single D flip flop is a one bit storage. and a not gate in the input would do the thing. how did you fail? Oct 6, 2020 at 21:58
• I don't understand how to do it since I don't have a clock source. Oct 6, 2020 at 22:06
• Use the data as the clock. Feed the output back to the input. Oct 6, 2020 at 22:57
• Isn't this a T flip-flop, or a D flip-flop plus a NOT gate? Oct 7, 2020 at 6:35