2 Clocks, 2 Switches

Discussion in 'The Projects Forum' started by johnyradio, Nov 11, 2012.

  1. johnyradio

    Thread Starter Member

    Oct 26, 2012
    39
    1
    Hello

    I've got two switches, S1 and S2.
    And a clock C1. Every time the C1 goes High, it opens S1 and closes S2.
    There's a slower clock, C2. When C2 goes High, it opens S2 and closes S1.
    If C1 and C2 go high at the same time, C2 wins.

    How to do this?

    Thank You.
     
  2. johnyradio

    Thread Starter Member

    Oct 26, 2012
    39
    1
    this is a logic problem.

    not asking for wiring help. not asking about parts.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,415
    3,354
    This is difficult implementing in logic without thinking about parts.
    Edge triggered logic is implemented with flip-flops.
    From what you describe S1 is the opposite of S2. Hence a single flip-flop will do.

    Put C1 into the clock input of a D-type or J-K flip-flop.
    With D = 0, or J = 0 and K = 1, Q = S1 and Q' = S2.

    Feed C2 into a monostable multivibrator whose output drives the SET of the flip-flop.
     
  4. johnyradio

    Thread Starter Member

    Oct 26, 2012
    39
    1
    I appreciate that, but I'm slightly modifying my goal. This change, however, might not change your solution:

    I've got a SPDT switch, S1.
    And a clock C1. Every time the C1 goes High, it should drive S1 high (switch to position 1).
    There's a slower clock, C2. When C2 goes High, it should drive S1 low (switch to position 2).
    If C1 and C2 go high at the same time, C2 wins.

    I'm thinking the flip flip you described may drive the SPDT.
     
  5. johnyradio

    Thread Starter Member

    Oct 26, 2012
    39
    1
    also, not clear about how to config the monostable multivibrator.

    i THINK this is the circuit you described (not including the monostable multivibrator)

    [​IMG]

    Here's the output of my simulator. The traces are, from top to bottom:
    C1 (fast clock)
    C2 (slow clock)
    V3 (neg-Q, i think)
    V3 (pos-Q)

    [​IMG]

    problem: neither output trace shows desired behavior.

    Will the monostable multivibrator fix that?

    thanks
     
Loading...