Dividing the CLK frequency by 8

  • Thread starter Thread starter STEMucator
  • Start date Start date
  • Tags Tags
    Frequency
Click For Summary
SUMMARY

The forum discussion centers on the correct method to divide a clock frequency by 8 using D flip-flops. Participants agree that three rising edge-triggered D flip-flops are necessary to achieve this division, as one flip-flop divides the frequency by 2 and two flip-flops by 4. The conversation also highlights the distinction between synchronous and asynchronous counters, with emphasis on the simplicity of using three D flip-flops without additional gates or inverters. The original proposed solution, which involved a ring counter, was deemed incorrect for not meeting the requirement of dividing the clock frequency by 8.

PREREQUISITES
  • Understanding of D flip-flops and their operation
  • Knowledge of synchronous and asynchronous counters
  • Familiarity with clock frequency division concepts
  • Basic principles of digital logic design
NEXT STEPS
  • Research the design and implementation of synchronous counters using D flip-flops
  • Learn about the operation and applications of ring counters
  • Explore the differences between synchronous and asynchronous counters
  • Investigate the use of CD4022 and other related ICs for frequency division
USEFUL FOR

Electronics students, digital logic designers, and engineers working on clock frequency division and counter design will benefit from this discussion.

STEMucator
Homework Helper
Messages
2,076
Reaction score
140

Homework Statement



The question and provided answer are given:

Screen Shot 2015-02-26 at 11.12.00 AM.png


Homework Equations

The Attempt at a Solution



I disagree with the answer. Shouldn't there only be three rising edge triggered d flip-flops?

I say this because I know if I only had one d flip-flop with the inverter, the clock frequency would be cut in half.

Similarly, I would assume that having two d-flip flops with the inverter would cut the clock frequency by 1/4.

So would I not need three d flip-flops to cut the frequency by 1/8?
 
Physics news on Phys.org
Zondrina said:
I disagree with the answer. Shouldn't there only be three rising edge triggered d flip-flops?
You can do it several ways, but if the clock input is common to all FFs, you need a more complicated gating than mere inverters can supply.
04353.png

This is an example of a synchronous counter.
ee17.GIF

If the clock inputs are freely available, you can make an asynchronous counter like this.

BTW, the solution you have been presented with is usually called a ring counter. It is simple to create, but it has several illegal states which must be dealt with - and they have not been dealt with.
 
You know. After just sitting around for a while, I just made a pretty important connection between FSM design and this problem.

I realize a state graph would be appropriate, from which a state table and corresponding circuit could be derived. Since the output relies on the clock, Moore outputs would be appropriate. Here's another way of producing the circuit, it uses more gates, but it works:

IMG_0547.JPG


Produced with saving the environment in mind.
 
You are on your way to discovering the Grey coding. In a binary counter, several bits may change at the same time (011→100), but in the Grey code sequence, only one bit changes in each step. A three-bit Grey counter may go like this: 000→001→011→010→110→111→101→100(→000).
 
"I disagree with the answer. Shouldn't there only be three rising edge triggered d flip-flops?"

Yes.

What does one D flip-flop do?
How do you connect "three rising edge triggered d flip-flops" so that they do what you want.

Please forget about synchronous counters, ring counters, binary codes, etc. All you want to do is divide by 8.
 

Merlin3189 said:
"I disagree with the answer. Shouldn't there only be three rising edge triggered d flip-flops?"
Yes.

The answer circuit is correct assuming that the Q output of each latch is connected to the D input of the next (and you add a reset input to all the latches).

The Q outputs follow this pattern...

0000
1000
1100
1110
1111
0111
0011
0001
0000
etc
So the any of the Q outputs are equivalent to clk/8.

If there was only three latches the pattern would be

000
100
110
111
011
001
000
etc

You could build one using three latches but I think it would be somewhat different to the answer circuit.
 
CWatters said:

The answer circuit is correct assuming that the Q output of each latch is connected to the D input of the next (and you add a reset input to all the latches).
I'm a bit puzzled. The "answer" looks like a sort of shift register, which certainly wouldn't divide by 8. I said OP was correct in saying that answer was wrong. OP's argument that one flip flpo divides by 2 , so 3 flip flops divide by 8 is exactly correct.

I still don't see what all those tables of binary codes have to do with dividing by 8. What OP needs is to take a serial pulse stream and produce a symmetric output pulse stream with 1/8 the number of pulses - no codes, no binary.
And they can do that simply with 3 D flip flops, no inverters, no gates, no feedback, no maths beyond what they've already said - 23 = 8.

If OP is still interested, maybe they could show how they divide by 2 using one D flip flop, and LABEL the input clock signal and the output clock signal.
 
Merlin3189 said:
I'm a bit puzzled. The "answer" looks like a sort of shift register, which certainly wouldn't divide by 8. I said OP was correct in saying that answer was wrong. OP's argument that one flip flpo divides by 2 , so 3 flip flops divide by 8 is exactly correct.
Well, no. The "answer" is a ring counter, a simple synchronous circuit. The ring counter is characterized by:
  • Only one bit changes at each clock pulse, which means no glitches on the outputs
  • If you have n FFs, the circuit divides by 2n, not by 2n
  • If n > 2, a full circuit incorporates a watchdog circuit to eliminate illegal internal states
Merlin3189 said:
And they can do that simply with 3 D flip flops, no inverters, no gates, no feedback, no maths beyond what they've already said - 23 = 8.

If OP is still interested, maybe they could show how they divide by 2 using one D flip flop, and LABEL the input clock signal and the output clock signal.
See post #2.
 
Merlin3189 said:
I'm a bit puzzled. The "answer" looks like a sort of shift register, which certainly wouldn't divide by 8.

Yes it does.

I said OP was correct in saying that answer was wrong. OP's argument that one flip flpo divides by 2 , so 3 flip flops divide by 8 is exactly correct.

The answer circuit is not wrong it's just different to your proposal.

Presumably you are proposing an asynchronous (aka ripple) counter? That works but has some limitations. Are you proposing to make a synchronous counter? I think you need additional gates and for this question you are only allowed inverters for free.

The answer circuit is synchronous and only uses an inverter.

I still don't see what all those tables of binary codes have to do with dividing by 8.

Look again. Perhaps it helps if I add headings Q1 to Q4..

Q
1234
0000
1000
1100
1110
1111
0111
0011
0001

You have four outputs Q1 to Q4 all of which are 1/8th of the clock. (eg they are low for four clk cycles and high for four clock cycles). The outputs are also synchronous with the input clk. The problem statement didn't limit you to three latches.
 
  • #10
It's not really a question for me, rather for the OP, but I still don't understand why you are all getting so complicated.
The original "problem statement, all variables and given/known data" simply asked to produce an output which had 1/8 the frequency of the input clock - a very common circuit requirement. There was no requirement for synchronous output, but an apparent desire for simplicity and a specific requirement to minimise extra gates.
While I do not know that a bog standard 3-stage ripple counter is the desired answer (if indeed there is a specific required answer), it is a pretty good guess.
As for the suggested answer (in the words of Wikipaedia, a "type of circular shift register." known as a ring counter), I simply agreed with the OP that this answer was wrong - it does not meet the problem specification, because, (1) it has no output, (2) it does not divide by 8 and there is no point in that circuit where a clk/8 signal COULD be taken from, and (3) it is not a minimal solution having an extra gate and an extra FF.
I still cannot understand the CWatters comment, "The answer circuit is correct assuming that the Q output of each latch is connected to the D input of the next (and you add a reset input to all the latches)." As there are 4 FFs, even connecting them correctly either divides by 16 or wastes gates. And saying that an answer is "correct" IF you change the connections and add extra circuitry, seems to be stretching the meaning of "correct" rather a long way!

I did not deny that any of your complex circuits would do something and in fact I did no more than glance at them to see that they were irrelevant to the problem.

I hope I did not propose a circuit (as CWatters suggested in his, "The answer circuit is not wrong it's just different to your proposal.") OP was almost there in giving a full and complete answer to the original question and just needed encouragement to pursue their own ideas to the logical conclusion. I was dismayed by all the irrelevant erudition in other posts, which could only serve to obscure the issue and distract OP from a good simple solution along the lines they were already thinking. And to use 4 bit counters seemed like deliberate misinformation.

Since OP is no longer participating, I think I shall leave you to it, as there is nothing to be gained by our arguing about anything.
 
  • #11
Merlin3189 said:
As for the suggested answer (in the words of Wikipaedia, a "type of circular shift register." known as a ring counter), I simply agreed with the OP that this answer was wrong - it does not meet the problem specification, because, (1) it has no output, (2) it does not divide by 8 and there is no point in that circuit where a clk/8 signal COULD be taken from, and (3) it is not a minimal solution having an extra gate and an extra FF.
I suggest you check out the data sheet for CD4022.
 
  • #12
Svein said:
I suggest you check out the data sheet for CD4022.
Yes, a lovely circuit, as are all the 7400 and CD4000 range. I bet many youngsters these days would automatically reach for a microcontroller to do the jobs that some of these chips did.

But I'm getting off the point. I think we must be a bit at cross purposes. Whatever this chip does, it takes 4 FFs and I think I count 14 extra gates, so for me it is hardly a good answer to the question, which can be answered with 3 FFs and 0 extra gates.

I had assumed the OP was doing some sort of electronics course and learning about logic - in the abstract sense. Perhaps you have taken the question as a more practical one like, what chip should I use to do this job with minimum package count. In that case, you may well be right and I could only complain that, 1- there is no indication of where the output can be taken, and 2- the circuit as originally sketched is very incomplete, so it is still not a good answer.

And as I said, OP is long gone, you obviously know at least as much as me (& probably much more) about this topic, so there is no point in our arguing about what they might have wanted. We both came here to help and now the need has disappeared, let's move on.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
6K
Replies
1
Views
3K
Replies
1
Views
4K
  • · Replies 31 ·
2
Replies
31
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
5
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
3
Views
2K