There is this this nice small (and incomplete) set of rules about digital circuits, about the little balls to be more precise:
- little balls can travel around over wires (not always at T sections)
- little balls can travel across logic gates
- little balls neutralize each others when they collide
The second needs a little expansion. If you have a little ball on the output of an AND gate, thus making it a NAND gate, you can take the ball, double it, put the new balls in the input and turn the AND in an OR. Things are similar if you start with an OR gate (that with its little ball is a NOR gate).
Someone call this rule De Morgan's Laws if you ever have to explain this to a teacher.
Back to your circuit: take the two little balls, cross the NAND gates (splitting the balls). Now you've got two OR gates and four balls. Remembrer that a ball represents a NOT gate:
simulate this circuit – Schematic created using CircuitLab
Now as you see R and S are negated as soon as they enter the circuit. We can agree and "simplify" NOT3 with R and call that input nR, and similarly with S and NOT2.
Now let's push NOT4 till the T crossing: what happens there? Well you can negate the AND output, and to keep the downstream value of nQ you should put a not there also.
A diagram is worth a thousand words:
simulate this circuit
Now you can simplify Q and NOT1 and label that output nQ, and simplify nQ and NOT2 and label that output Q. Does the circuit look more familiar now? Your second circuit is just like the same, only what you call set and reset changes.
The real question is: why did I bother with the whole "small balls" story? You could have just written down the truth table and "easily" see what was going on. Well I think that sliding little balls around helps quite a lot in solving simple problems and even a little more complicated ones. Plus it's fun.