# Detecting rising edges from two different inputs

I want to build a circuit with two inputs A and B and one output Q with the following behavior:

• assume A and B are never high at the same time
• on the rising edge of A, Q must become low (A means "clear")
• on the rising edge of B, Q must become high (B means "set")

Do I need to have a clock for such a simple circuit? It seems I cannot directly use (A or B) as the clock of a J-K flip-flop and at the same time use A and B as the inputs of the flip-flop because it would violate the setup time.

Is it acceptable practice to just use A as the clear and B as the preset of a flip-flop without using the clock and inputs of the flip-flop?

Finally, let's now remove the assumption that A and B are not high at the same time. How do I detect the rising edges of both inputs, again without a clock?

• DC blocking capacitors can be used to filter out edges. Then logic gates. May 21, 2020 at 20:45
• Since A = SET and B = RESET then for your final condition of both high you need to decide which overrides the other is it an SR latch (reset wins) or an RS latch (set wins). Hit the edit link. May 21, 2020 at 20:48
• I still want to detect the rising edges of A or B, not their level, so the last edge wins May 21, 2020 at 20:57
• There are such things as Set-Reset latches - en.wikipedia.org/wiki/… - they sound ideal. May 21, 2020 at 21:53