This page has details about the flip-flop. The flip-flop is a composite logic gate usually made from NANDs or NORS. As
with the half adder, without flip-flops modern computing wouldn't exist.
Once you have a nice simple working NOR or NAND gate then building Flip-Flops
(FF) becomes a simple matter. In computing FFs are pretty important
since they form the basis of memory. A FF is a device made with either two NOR or two
NAND gates. Most FFs are made using NAND gates and there are several different
types. The basic operation takes the output of one gate as the
input of the other gate and vice versa. This means a FF has two inputs and two
outputs. The pictures of the LEGO FF should show what's going on along with the description below.
The initial set up of the FF is Set=1, Clear=1 and Q=1, Qbar=0.
Pulse Clear to 0. This makes Q=0 and Qbar=1, notice now that since the right hand
NAND output is 1, Clear will have no effect on either Q or Qbar.
Now pulse Set to 0. This turns Q=1 and Qbar=0. In this case the left hand
NAND gate output is 1 and so changing the value of Set will not do anything.