# 1 Counter/Multiple Clocks -or- Mixing 4 Clocks To 1 Clock

• posted

An XOR gate will change it's output whenever an input changes. If you use an XOR gate for each pair of clocks, and feed the outputs into another XOR gate, then if any time any of the clocks change, the output will change. Thus, a counter which uses that as a clock will count the pulses.

The problem with this is that if the clock input transistions occur too close together, the input to the counter can change too quickly, and violate the setup or hold times. Also, if clocks change together, you'll miss a pulse.

I think this works. You may wish to take a few moments to verify it.

Regards, Bob Monsen

• posted

Hi,

I've been trying to come up with a simple circuit to do the following: Accept 4 clock inputs and count the total number of pulses from each of the 4 clocks OR take the

4 clock inputs and output a single clock I can use with a regular counter.

I have 4 square wave clocks that I want to count. They vary from about 3 KHz to 40 KHz. This is what they look like (excuse my drawing skills).

Clock 1: ____----____----____ Clock 2: -____----____----____ Clock 3: --____----____----____ Clock 4: ---____----____----____

You get the idea. None of the rising or falling edges will ever interfere with each other. However, there are times when one or more clocks may be off (held low) like this:

Clock 1: ____----____----____ Clock 2: ___________________ Clock 3: --____----____----____ Clock 4: ---____----____----____

I want to end up with an accurate count of all the pulses from the 4 clocks. Does anyone have a simple solution to this? It's been driving me crazy but maybe I'm missing the obvious.

• posted

```--
CLOCK1>---+-------------A
|            AND Y-----A```
• posted

```--
Or, more simply:

CLOCK1>----[C]--+--[1N4148>]---+--->OUTPUT TO COUNTER```
• posted

If you change those ORs to XORs it would at least reduce the chance of missing a pulse because it overlaps with the pulse from another AND.

I think the only way to do it seriously is to have 4 counters and add them. The Laws of Form could make a minimal solution with the same performance as

4 counters and adders, but it seems nobody ever figured out the Laws of Form. I will re-read the book some day. Maybe a light bulb will go on.
```--