1
\$\begingroup\$

I'm new to using flip-flops, and making them into shift registers, but what I'm trying to do is turn on a logical AND gate based off the input of two flip-flops. The scenario is: first, a room light goes on, second a room light goes off, then an AND gate turns on. So what I'm doing is trying to build a shift register to recognize this sequence of events. When I turn the D input of the first flip-flop HIGH, the Q output of this is fed into the D input of the next flip-flop. When the first flip-flop then goes LOW, its Q(inverted) output is HIGH for the AND gate. So now both inputs to the AND gate are HIGH. So, by my calculations, it's like a "1" followed by a "0" fed through the shift-register. This should turn on the gate.

The results I get, however, are that while following these steps, the AND gate is turned on, but it's only for a flicker. I would have thought it would be turned on for the three seconds of the clock signal (the flip-flops are positive-edge triggered).

Is it that flip-flops can't use an analog sine wave for their clock? Or is it something else? I could be wrong, but watching my voltmeter, it seems like both flip-flops are getting set to HIGH simultaneously, rather than the second one waiting for the next positive edge to come along after the first. That would explain why the AND gate only stays open for a flicker. The bits are shifting through the register too quickly?

Hopefully I've explained the problem clearly. If not, I'll try to clarify.

enter image description here

\$\endgroup\$
1
\$\begingroup\$

There may have been a wire in the wrong place or something. I did have it spread across three breadboards. I sketched everything out in a schematic, then pulled all the wires out and started over, following the schematic. Then things worked! Here's the schematic I used. The LED only lights up once the D input to the first flip-flop has gone HIGH and then LOW, which is how it should work.

enter image description here

\$\endgroup\$
0
\$\begingroup\$

In your figure you have inverted sets and resets meaning that in the current schematic you both set and reset the flip-flops simultaneously.

Now, given that it is just a drawing issue, my best bet would be the clock issue. Either that you have to long rise time and/or you have different threshold voltages for the two flip-flops leading to that they "clock" at different time instances. For the latter, I would suggest changing places of the flip-flops and it may work. For the former (and latter), just connect a comparator or an OP-amp to sharpen the edges.

\$\endgroup\$
  • \$\begingroup\$ When I attach a voltmeter to the 555 timer, it has about a 3 second rise time up to HIGH and then a matching lowering time down to LOW. Is that what you mean by a long rise time? I don't understand the part about inverted sets/resets. I have Q(inverse) feeding into the AND gate so that when that first flip-flop goes LOW, it will turn that gate input ON, while the second flip-flop should by that time have the ON bit shifted over to it, and also have its gate input ON. Is that correct? \$\endgroup\$ – NickRamirez Feb 23 '14 at 21:24
  • \$\begingroup\$ The Set and Reset (or Clear) inputs are active-low. The schematic shows them tied to ground (low), so the flip-flops are trying to set and clear themselves simultaneously - this is an undefined condition. You should connect the Set and Clear inputs to the positive supply to allow the flip-flops to work correctly. \$\endgroup\$ – Peter Bennett Feb 23 '14 at 22:27
  • \$\begingroup\$ Okay, weird, after trying a few different things, including the comparator idea and also tying the SETs and RESETs to high, and then putting everything back the way it was, it started working. I don't know why yet! I've got a lot of wires and I'll have to map them. Thanks for the help! If I figure out what went right, I'll post it here or mark this answer as the winner. \$\endgroup\$ – NickRamirez Feb 24 '14 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.