Logic ICs

Need help with a project? Trying to find a component? Post any general technical questions here.
Post Reply
TomNunez123
Posts: 3
Joined: Tue Jan 12, 2016 7:55 pm

Logic ICs

Post by TomNunez123 » Tue Jan 12, 2016 8:25 pm

Hello All,

I've been studying electronics for just over a year, however I have been predominantly focusing on general theory with little practical circuit design work. Regardless, I saw a video of a 'Tic-Tac-Toe' Circuit that someone had designed. I thought I would take my own approach at this.

Without boring you with the whole design idea, I have one question:

I want to first create a circuit that involves 9 switches going into 9 inputs of a chip. So when any switch is pressed, its state changes. What I basically want to happen is for the output of the chip to change when any one of the 9 switches is pressed.

For example:
0 switches on = output low
1 switch on = output high
2 switches on = output low
3 switches on = output high
4 switches on = output low
etc....

The reason being is that this change in output state will cause a SPDT relay to either energise or relax. This will connect one circuit branch, while disconnecting another (and vice versa); the two branches of which will provide a different voltage to an bi-colour LED through a potential divider network. Whenever a switch is pressed, the LED will therefore change colour.

I'd be extremely grateful if anyone has any ideas for this.

Kind Regards

Tom

Pauldf
Posts: 170
Joined: Mon Jun 10, 2013 7:42 pm

Re: Logic ICs

Post by Pauldf » Wed Jan 13, 2016 5:28 pm

I don't have a circuit emulator at the mo, I'm thinking possibly use a series of XOR gates in a line, input 1 and 2 to A and B the first, then the output C of that to input A on the next, input 3 to B, output C to A on the next one and so on.
If someone else has an emulator please can they check this works?

TomNunez123
Posts: 3
Joined: Tue Jan 12, 2016 7:55 pm

Re: Logic ICs

Post by TomNunez123 » Wed Jan 13, 2016 6:52 pm

Thanks very much Pauldf.

I have by coincidence found this video which I believe to be an exact replica of the what you have just suggested.
https://www.youtube.com/watch?v=BTh91RYXhqQ

The guys who created this seem to have implemented the circuit using entirely logic chips. I guess this is the best to do this without using micros? Do you however think it'll be too arduous of a task to do it using some analogue circuitry as well as logic chips? I don't want to do it exactly as the video has because otherwise my design skills won't improve...

Tom

Pauldf
Posts: 170
Joined: Mon Jun 10, 2013 7:42 pm

Re: Logic ICs

Post by Pauldf » Wed Jan 13, 2016 9:13 pm

It is very similar to what I was describing, i was thinking one straight line and theirs is more like a pyramid but the result ought to be the same. As in the video, this is only a small part of the whole circuit!

TomNunez123
Posts: 3
Joined: Tue Jan 12, 2016 7:55 pm

Re: Logic ICs

Post by TomNunez123 » Thu Jan 14, 2016 5:58 pm

Yes, I understand that is only a small portion of the circuit. Was just looking for some pointers on that bit initially.

Do you have a suggestion on how each switch is assigned to a specific LED? As after the NOR gates the end result is one output that changes with a switch press. Would you run a wire from the switch, through an LED and then connect it to the output of the XOR circuit? With a chip in-between the LED and the XOR circuit output to lock an LED once it has been lit?

Pauldf
Posts: 170
Joined: Mon Jun 10, 2013 7:42 pm

Re: Logic ICs

Post by Pauldf » Sat Jan 16, 2016 4:57 pm

The Lock (aka latch) bit you talk of is done using RS flip flops, once set they stay set until a reset signal is sent.
Each switch will need to go to a RS flip flop, this flip flop gated to another 2 flip flops so only one can change state (depending on wether it is O or X's turn.)
This needs to go back and inhibit the opposite persons flip flop so it can not change state.
The output of the O or X flip flop for each of the 9 squares can run the LEDs for those squares.
The XOR system goes after the first RS flip flop to count the number of turns which has been taken and outputs to gates to direct the O or X to the correct flip flop (which is what I meant by gated above)

computer blind
Posts: 20
Joined: Mon Mar 21, 2016 12:54 am

Re: Logic ICs

Post by computer blind » Mon Mar 21, 2016 3:10 am

Just wait till your putting the ai into the gates, then ur wippin butt.
I suggest if your doing that doing the thing with truth tables, before u put it into the finished gates. Just in case u didnt know.

David
Posts: 220
Joined: Sun Oct 04, 2015 6:18 pm

Re: Logic ICs

Post by David » Tue May 17, 2016 4:25 pm

A fascinating project! It boils down to seeing if the number of switches on is even or odd. An obvious solution is to program a PIC or other MPU, but a part analogue and part digital system could be as follows. It has only a single five input OR gate, although it requires one op amp, and five comparators.
All the resistors are the same value, say 220k and of reasonably close tolerance, and the op amp should be supplied from at least 12v rails. In operation, with no switches on, its output is zero. As a switch is turned on, the output rises by 1v (because the input resistors are supplied by -1v). Suppose five switches are on – the output will be 5v. If the comparators each have a small amount of hysteresis so that they respond to a voltage between about ±0.2v of their nominal voltage (to allow for tolerances), the 5v comparator will respond and turn on the OR gate. It will not respond to even numbers of switches (including zero). In practice, there may be a need to trim the op amp for a zero output when there is no input (i.e. all switches off) and depending on the comparators and OR gate inverters may also be needed. Note on the diagram the comparators should be set to ≈1v, ≈3v, ≈5v, ≈7v, ≈9v. Sorry - just noticed an error with the schematic. There should be a resistor (same value as the others) from the op amp output to the inverting (-) input.

Hope this helps.
Misc002.jpg

computer blind
Posts: 20
Joined: Mon Mar 21, 2016 12:54 am

Re: Logic ICs

Post by computer blind » Sun May 22, 2016 10:35 pm

I bet that or would last through a war.

i do strange things with orderless subtraction with just conduction, i figure i can put it through a cap stampede and actuaully get it useful!

Post Reply