The AND gate and the OR gate are basic building blocks that will be used to construct more complex logic functions. the OR gate is sometimes called the "Either/Or Both" gate and the AND gate is sometimes called the "Coincidence" gate. These two gates, when combined with the NOT gate, can be used to construct about any logic function desirable.
The output waveform can most easily be determined if the input signals are first broken up into time segments where in each time segment the inputs are constant. Whenever an input changes, mark another time segment. Then, for each time segment determine the state of the output from the truth table for that logic gage. If this is repeated for each time segment then the result should be a continuous waveform on the output.
The NAND and the NOR logic gates are sometimes called the universal logic gates because the three basic building blocks of all logic (AND, OR and Inverter) can be accomplished using only NAND gates or using only NOR gates. All complex logic functions can be achieved using AND, OR and Inverter gates. If NAND and NOR gates are universal, then all complex functions can be accomplished using only NAND gates or using only NOR gates. This makes the NAND gate and the NOR gate very powerful gates. For this reason, many logic families will use a large number of NAND gates or a large number of NOR gates. The TTL logic family, for example, has a large number of the available circuits that are NAND logic gates.