Hey guys. I have to create a sequential circuit using D flip flops that counts 0, 2, 4, 6 repeatedly when input is 1, and 6, 4, 2, 0, when input is 0.
I have no idea how to do this and I have been working on it all day and I can't seem to understand how to do this. Can anyone help me out here?
Here is what I have so far.
The table is set up with Current state - input - next state - flip flops (d1, d2, d3)
000 - 1 - 010 - 010
010 - 1 - 100 - 100
100 - 1 - 110 - 110
110 - 1 - 000 - 000
000 - 0 - 110 - 110
110 - 0 - 100 - 100
100 - 0 - 010 - 010
010 - 0 - 000 - 000
I have no idea how to do this and I have been working on it all day and I can't seem to understand how to do this. Can anyone help me out here?
Here is what I have so far.
The table is set up with Current state - input - next state - flip flops (d1, d2, d3)
000 - 1 - 010 - 010
010 - 1 - 100 - 100
100 - 1 - 110 - 110
110 - 1 - 000 - 000
000 - 0 - 110 - 110
110 - 0 - 100 - 100
100 - 0 - 010 - 010
010 - 0 - 000 - 000
-
The first thing that strikes me is that what you actually want is a 2-bit counter that goes 0-1-2-3 or 3-2-1-0. The outputs of the 2 flip-flops are bits 1 and 2 of your 3-bit output code. Bit 0 is always 0, so it's basically a wire to ground!
So it's basically a 2-bit up/down counter with the input being the up/down control. Maybe an oscillator to clock it, if you want it to run on its own. A 2-bit counter will roll over automatically from 3 to 0 (up) or 0 to 3 (down) so you don't need any special circuit to make it do that.
So you have your 2 D flip-flops each having the /Q output wired to the D input to give you the toggle function. Use some simple logic to select the source of the flip-flop 2 clock pin:
Up counter:
FF1 clock from oscillator output
FF2 clock from FF1 output
Down counter:
FF1 clock from oscillator output
FF2 clock from inverted FF1 output
I think that will work.
So it's basically a 2-bit up/down counter with the input being the up/down control. Maybe an oscillator to clock it, if you want it to run on its own. A 2-bit counter will roll over automatically from 3 to 0 (up) or 0 to 3 (down) so you don't need any special circuit to make it do that.
So you have your 2 D flip-flops each having the /Q output wired to the D input to give you the toggle function. Use some simple logic to select the source of the flip-flop 2 clock pin:
Up counter:
FF1 clock from oscillator output
FF2 clock from FF1 output
Down counter:
FF1 clock from oscillator output
FF2 clock from inverted FF1 output
I think that will work.