How to toggle and latch using logic gates?

Click For Summary

Discussion Overview

The discussion revolves around implementing a toggle and latch mechanism using logic gates for the game Dots and Boxes. Participants explore how to automate turn changes based on scoring conditions, focusing on the use of XOR gates and flip-flops in the circuit design.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes the need for a circuit that toggles output when a turn is moved without scoring and latches when a score is formed, using overlapping XOR gates.
  • Another participant provides a schematic for a JK flip-flop, noting its toggling behavior when both J and K are high.
  • Some participants express that their challenge lies in working with a continuous signal rather than a pulsing one, seeking to use both edges of the signal as triggers.
  • Suggestions are made to use D-flip-flops and XOR gates to create a pulse from the continuous signal, with one participant mentioning the use of an RC circuit to achieve the desired behavior.
  • One participant reports difficulties with the RC circuit, stating that it remains constant instead of pulsing, and questions whether their circuit design is correct.
  • Another participant notes that the effectiveness of the RC circuit may depend on the logic family being used, suggesting that resistor values may need to be adjusted based on whether TTL or CMOS logic is implemented.

Areas of Agreement / Disagreement

Participants express varying approaches to the problem, with no consensus on the best method to achieve the desired toggling and latching behavior. Some agree on the potential of using flip-flops and XOR gates, while others highlight challenges with specific circuit implementations.

Contextual Notes

The discussion includes limitations related to the assumptions about signal behavior, the specific components used, and the conditions under which the circuits operate. There are unresolved questions regarding the effectiveness of the proposed solutions.

OrlandoLewis
Messages
25
Reaction score
1
We're implementing Dots and Boxes to logic circuits and the we would like to automate the process of changing turns. If you know the game, the game changes turn when one move doesn't score a point or form two or more boxes. I was able to create overlapping XOR gates that alternates from high to low without considering the score. And also a set of latches which turns high when a box (score) or two is formed.

My question is, how can I implement the alternating turn in this game? Note that my set of latches which saves the state isn't a pulse but a constant output from combinatoric circuit. So basically, I want my output to toggle when a turn is moved but a score is not formed, and to latch when a turn is moved and a score is formed.
 
Engineering news on Phys.org
Here is the schematic for a JK flip-flop. If you keep J and K high, it will toggle.
7473%20Page%206-51%20crop%20small.jpg
 
Svein said:
Here is the schematic for a JK flip-flop. If you keep J and K high, it will toggle.
7473%20Page%206-51%20crop%20small.jpg
Yes, I totally get how JK flip flop toggles when both J and K are high and latches when J and K are low. My problem is I have a continuous signal, not a pulsing one. As I said, I want my pulse to be coming from the overlapping XOR gates which alternates from high to low whenever it changes turn. However, I want both of its edges to be the trigger
 
OrlandoLewis said:
Yes, I totally get how JK flip flop toggles when both J and K are high and latches when J and K are low. My problem is I have a continuous signal, not a pulsing one. As I said, I want my pulse to be coming from the overlapping XOR gates which alternates from high to low whenever it changes turn. However, I want both of its edges to be the trigger
There are several ways to do that, it depends on what you have available. If you have a clock somewhere, you can run your signal through two D-flip-flops and use an XOR from D to Q on the last flip-flop. The output of that XOR will the be high for one clock cycle after the signal has changed state.

In real life, you can do the same thing using an XOR on your signal, one part going directly to an input and the other delayed through an RC combination.
 
Svein said:
There are several ways to do that, it depends on what you have available. If you have a clock somewhere, you can run your signal through two D-flip-flops and use an XOR from D to Q on the last flip-flop. The output of that XOR will the be high for one clock cycle after the signal has changed state.

In real life, you can do the same thing using an XOR on your signal, one part going directly to an input and the other delayed through an RC combination.

I tried doing the RC circuit but it doesn't seem to work. The alternating input I stated earlier is connected to the XOR gate and two inverters which is also connected to the XOR gate. I added a resistor( 1K ohms ) and a capacitor between tose inverters but it seems that it also stays constant instead of pulsing. Am I doing the circuit right?
 
The RC circuit has some restrictions, related to the logic family you are using. If it is a standard TTL, the R must be small, for CMOS it can be larger. the circuit I mentioned is a variation of this:
upload_2016-12-11_11-12-3.png
 

Similar threads

Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 26 ·
Replies
26
Views
17K
  • · Replies 2 ·
Replies
2
Views
5K
Replies
5
Views
5K
  • · Replies 7 ·
Replies
7
Views
8K