Davy wrote...
How to Build a Clock divider by 3 with 50% duty cycle?
Input and output are listed below.
Clkin
__--__--__--__--__--__--
Clkout
______------______------
This topic comes up every now and then on s.e.d. Here's an
answer I gave seven years ago, along with some others.
First my 1997 post, which uses two types of flip flops, one with
positive-going clocking and one with negative-going clocking. I
suppose you could use one type of flip-flop with a clock inverter.
From: Winfield Hill (
[email protected])
Subject: Re: Divide by 3 Clock
Newsgroups: sci.electronics.design, sci.electronics.cad
Date: 1997/04/14
Anson Chi Fung at
[email protected] says...
I was given a task to design a Divide by 3 clock output
using a minimum number of D flip-flops and logic.
To be specific, please take a look of the following figure:
Input CLK
-- -- -- -- -- -- --
-- -- -- -- -- -- --
------ ------ ------
------ ------
Output CLK
Since no one has answered, Anson, I will. We do have a
divide-by-3 circuit in our book (AoE fig 8.59), but it doesn't
meet your specific symmetrical square-wave waveform requirement.
To meet it, the output must change state on both rising and
falling clock edges (and of course, the input clock must be a
square wave).
I made a design with this feature - matching your waveforms, in
1979 for a wave recorder at Sea Data. I don't know if it was a
_minimum_ part design, since it employs 3 flip flops rather than
two, but it has an additional feature of starting at a proper
phase after a reset. I hope there aren't any transcription
errors in this ACSII drawing!
,---------------------- J Q ----- out
clk* --+------------------------------------ CLK*
| | gnd --- K Q* -,
| | R* |
| | | |
| .-------------+------------------------------'
| | | |_ res*-- S* |
| '- D Q --+___ NOR ------ D Q |
+--- CLK ,---- CLK |
| Q*--, | Q*---'
res* ------ R* '-------------- R*
'-----------------------'
The D flops can be a HC74 and the JK flop a HC107 section, etc.
You can also use a cPLD, if it allows an inverter before a
register clock, since the JK flop must clock on an opposite
phase from the D flop.
Well, lunch hour is over - back to work! Let me know if this is
helpful, or if you come up with a better circuit.
-------------------------
From:
[email protected] (Jeroen Belleman)
Organization: CERN, European Laboratory for Particle Physics
The following equations describe a divide-by-three circuit which
will have a 50% duty cycle output, provided the clock also has
50% duty cycle, exactly as in the diagram above. Signal 'A' is
your output. '+' is OR and '&' is AND. '/' is inversion.
A = Ck & A + Ck & B + /Ck & A & C;
B = Ck & B + /A & B + /Ck & /A & C;
C = /A & C + A & B + Ck & /A + /Ck & C;
That's about twelve gates or so, not counting the inversions, and
no explicit flip-flops. There's a bit of redundancy in some
equations. You figure out where and why.
------
From:
[email protected] (Sam Goldwasser)
Here is one that I think will work using JK flip flops positive edge
triggered. My recollection was hazy and I had to rederive it.
+------+ +------+
+ ---| J Q |---+----| J Q |--+----> Divide by 3 out
+-|> | | +-|> | |
+ -|-| K Q'| +--|-| K Q'| |
_____ | +------+ | +------+ |
CLK >--| | | | |
| XOR |--+---------------+ |
+-|_____| |
| |
+--------------------------------------+
By inverting the clock on each transition of the output, this circuit
effectively removes two half periods from the divide by 4 circuit which
this would be without the XOR. Assuming the two flip flops come from
the same IC (meaning the propogation delays are reasonably well matched),
the output will be symmetric and the circuit is glitch and hazard free.
From: Winfield Hill (
[email protected])
Subject: Re: Divide by 3 Clock
Newsgroups: sci.electronics.design
Date: 1997/04/15
That reminds me of the timeworn phrase, "That's idea's so-oooo crazy, it
just might work!" As a fan of XOR gates, I remember thinking of an XOR
approach when I worked on this 20 years ago, but was nervous about the
glitch factor when playing with the input to an edge-sensitive flop.
Analyzing the circuit now, it looks pretty good. It even has the "start
after three half-cycles" phase reset feature of my more complicated
circuit. Sure, the XOR gate output makes an alarming "runt" clock pulse
at every output transition, but its length is 2 propagation delays and
should reliably fire both flops.
--
Winfield Hill
[email protected] _/_/_/ _/_/_/_/
The Rowland Institute for Science _/ _/ _/_/ _/
Cambridge, MA USA 02142-1297 _/_/_/_/ _/ _/ _/_/_/
_/ _/ _/ _/ _/
http://www.artofelectronics.com/ _/ _/ _/_/ _/_/_/_/
From: Aroosh R. Elahi (
[email protected])
Subject: Re: Divide by 3 Clock
Newsgroups: sci.electronics.design
Date: 1997/04/16
Sam Goldwasser said:
Here is one that I think will work using JK flip flops positive
edge triggered. [ snip ]
You don't get glitches and hazards in synchronous ccts.!
Aroosh R. Elahi
[email protected]
Faculty of Engineering, Carleton University
From: Sam Goldwasser (
[email protected])
Subject: Re: Divide by 3 Clock
Newsgroups: sci.electronics.design
Date: 1997/04/16
Aroosh R. Elahi said:
You don't get glitches and hazards in synchronous ccts.!
Since the clock passes through an XOR, both are possible but this
implementation should not have them.
Glitches might occur if the clock were forced to change multiple times
based on feedback terms. This might result in one or more outputs going
through two transitions very quickly. Also note that textbook descriptions
are fine but in the real world, you have unequal propogation delays and other
effects which can really mess up your entire day!
.
--- sam : Sci.Electronics.Repair FAQ:
http://www.paranoia.com/~filipg/REPAIR/
-----------------
From: "Myron Loewen" <
[email protected]>
If you have not yet been rushed into a solution, you may consider the
following 50% duty cycle /3 with only 2 D flip flops and an XOR gate.
It creates the output CLK from the input CLK as you indicated.
.. Input CLK ---->
.. XOR >----> CLK D <-|
.. |--> FF1 |
.. | |-< Q /Q >-|
.. | |
.. | |
.. | |-> CLK D <-|
.. | FF2 |
.. |------------< Q /Q >-|
.. |
.. |-------------------------> Output CLK
Myron Loewen, Design Engineer, Norscan Instruments