# Logic with TTL gates

Discussion in 'General Electronics Chat' started by melmac82, Jul 22, 2009.

1. ### melmac82 Thread Starter New Member

Jul 18, 2009
9
0
I have been racking my brain for almost a week now and seem to be getting nowhere.

I need to design a part of a logic circuit that does the following:

There are 5 inputs (A, B, C, D, E) and 5 outputs (a, b, c, d, e)
A goes high, a goes high; B goes high, b goes high, etc...

However, there is a twist.

No matter what any of the other inputs are, the last input to go high produces a high on its output and ONLY its output.
For example C is made high so c is high, then B goes high (with C still high) causing b to go high and c to go low. Then if D goes high (with B and C still high) d goes high and both b and c are low.

This is easy when it goes in order, but the problem I am running into is that when I mix things up and randomly select and deselect inputs every circuit that I have built so far causes oscillations.

Is there a way to do this? The closest I have gotten is when I use XOR gates or latch combinations. So any ideas on what to possibly use to make this work?

2. ### RiJoRI Well-Known Member

Aug 15, 2007
536
29
Look at the station selector switches on your car radio. Dunno if they are currently using micros, but my Dad's '49 Plymouth sure didn't!

THis is an interesting problem....

--Rich

What you need to do is trap the rising edge of the active button, while ignoring the steady-state buttons.
What if the signals are OR'd together to trip a timer chip, and each signal passes through a cap with a bleed-off resistor to ground after it. The spike is fed into a latch, which is gated from the timer. Depending on the inter-switch timing, you may be able to do it that way.

--RR

Last edited: Jul 23, 2009
3. ### DC_Kid AAC Fanatic!

Feb 25, 2008
792
17
i would think that for any input, its output serves as the reset for the others.

as example:

you press A 'a' goes high causing a reset on B C D E
you then press B 'b' goes high causing a reset on A C D E
etc

some latches that have resets seems should get the job done?

4. ### mentaaal Senior Member

Oct 17, 2005
451
0
have you done out a truth table for this circuit?

5. ### millwood Guest

yeah, a flip-flop trigger by edges, not levels.

6. ### melmac82 Thread Starter New Member

Jul 18, 2009
9
0
I think I left out a couple of things in the first post... the circuit is an analog circuit and I don't have a clock signal to use with flip-flops. (At least all of the flip-flops that I have dealt with use a clock.) Also, the switches for each input are manual (like a light switch).

I've had ideas about sending the signal from the switch to the S input of an RS latch with the signals from the other switches going to the Reset through a diode. Then I have problems because there would be an unstable condition on the latch, so I have to turn off the signal from the switch even if the switch is still engaged. (Haven't figured out how to do this yet though) Am I thinking in the right direction?

7. ### KL7AJ AAC Fanatic!

Nov 4, 2008
2,182
415

Ever seen the selector bars on a Model 28 teleprinter? YIKES!

8. ### melmac82 Thread Starter New Member

Jul 18, 2009
9
0
Anyone else have any ideas?

9. ### RiJoRI Well-Known Member

Aug 15, 2007
536
29
I fooled with the problem using Liberty BASIC, and got the following. Attached is a possible implementation with TTL logic. Note that the lines are actually 3-line buses, which should be expanded to 5.

--Rich
Code ( (Unknown Language)):
1.
2. ' This assumes only one switch closure at a time.
3. '  Multiple simultaneous switch closures are
4. '  rare in the real world.
5.
6. [Start]
7. ' Replace this with hardware read
8.     do
9.         input InSw
10.     loop until InSw <> History
11.
12.
13. ' See which switch changed
14.     ChgSw = InSw xor History
15.
16. ' Save Input Switches
17.     History = InSw
18.
19. ' Light only for the changed switch
20.     ChgSw2 = ChgSw and InSw
21.
22.
23.     if ChgSw2 > 0 then
24.         OldSw = ChgSw2
25.     end if
26.     gosub [ShowSw]
27.
28.     goto [Start]
29.
30. [ShowSw]
31.     if OldSw AND 4 then
32.         print "1";
33.     else
34.         print "0";
35.     end if
36.
37.     if OldSw AND 2 then
38.         print "1";
39.     else
40.         print "0";
41.     end if
42.
43.     if OldSw AND 1 then
44.         print "1";
45.     else
46.         print "0";
47.     end if
48.     print ""
49.     return
50.

File size:
96.3 KB
Views:
27
File size:
841 bytes
Views:
14