Logic gates

The principles of digital logic govern the operation of all modern computers. Logic gates that implement the basic Boolean operations of NOT, AND and OR comprise the building blocks of more sophisticated combinatorial circuits such as XOR gates, 1-of-N decoders, flip-flops and data latches. The SR flip-flop has some combinations of input states that lead to logically inconsistent, or 'illegal' output states. To get around this issue, a single input D that only operates when a 'gate' input E is asserted, is added to the SR block. The logic unit is known as a data flip-flop.

These circuits in turn can be used to construct sequential logic modules such as counters and shift registers that change state at times determined by a synchronizing clock pulse. Further integration of all these functional blocks results in microprocessors that control the operation of devices such as microwave ovens, automobiles, cell phones and laptops.

During this lab session you will explore the synthesis of some logic operations using combinations of NAND gates. As part of each exercise, sketch a schematic diagram of the gate arrangement, the accompanying switches and output LEDs. Label all the pin connections. Then assemble the circuit as shown in the schematic diagram, step through the possible input combinations and summarize your results in a truth table. Comment on any issues that you would have noted.

Prelab preparation

To proceed with this lab session, you need to have on hand the circuits diagrams for a logic inverter (NOT), an OR gate, an XOR gate, a half-adder, SR and D (data) flip-flops, each implemented using only NAND gates. Consult your notes and the web to determine the arrangement of each of these NAND-equivalent circuits and their corresponding truth table.

To construct these equivalent circuits, you can use Boolean algebra or the following visual approach. With a bubble at the pin of a gate representing an inversion of the logic state at that pin, an OR gate can be drawn as an AND gate with bubbles on all the pins, equivalent to the Boolean equation: A*B=(A"+B")". A bubble can be moved between the input and output of two connected gates.