Dividing the CLK frequency by 8

  • Thread starter STEMucator
  • Start date
  • Tags
    Frequency
In summary, 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).
  • #1
STEMucator
Homework Helper
2,076
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
  • #2
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.
 
  • #3
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.
 
  • #4
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).
 
  • #5
"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.
 
  • #6

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.
 
  • #7
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.
 
  • #8
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.
 
  • #9
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.
 

Related to Dividing the CLK frequency by 8

1. What is the purpose of dividing the CLK frequency by 8?

The purpose of dividing the CLK frequency by 8 is to slow down the clock signal and reduce the frequency of operations or data transfers in a circuit or system. This can be useful in situations where a slower clock speed is needed for proper operation or to conserve power.

2. How does dividing the CLK frequency by 8 affect the performance of a system?

Dividing the CLK frequency by 8 can decrease the overall performance of a system as it reduces the number of operations or data transfers that can be completed in a given time frame. However, it can also improve stability and power efficiency in certain cases.

3. What are the potential drawbacks of dividing the CLK frequency by 8?

The main drawback of dividing the CLK frequency by 8 is that it reduces the speed and performance of a system, which can be problematic for applications that require high processing speeds. Additionally, in some cases, it can introduce timing issues or cause data errors if not implemented properly.

4. How is the CLK frequency divided by 8 in a circuit or system?

The CLK frequency can be divided by 8 using a divider circuit or by programming a microcontroller or FPGA to divide the frequency by 8. The specific method used will depend on the design and requirements of the system.

5. Are there any advantages to dividing the CLK frequency by 8?

Yes, there can be several advantages to dividing the CLK frequency by 8. It can help reduce power consumption, improve stability, and allow for easier timing and synchronization in certain systems. It can also be useful for creating slower clock speeds for testing and debugging purposes.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
31
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
7K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
19K
Back
Top