The Flip-Flop
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:
The initial setup of the FF
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.