CircuitNote

Quick electronics calculators for lab work and circuit design. Free, no sign-up, works in your browser.

한국어

Lab guide

Building AND, OR and NOT from NAND or NOR gates (measured)

Output voltages of gates built from a 7400 and a 7402, checked against logic level limits.

NAND and NOR are "universal" gates: either one alone can make AND, OR and NOT. These are real measurements from circuits built with a 7400 (NAND) and a 7402 (NOR), switching the inputs between 0 V and 5 V and reading the output on a multimeter.

1. How to wire them

Built fromGateWiringGates
NANDNOTNAND(A, A)1
NANDANDNAND(NAND(A, B), NAND(A, B))2
NANDORNAND(NAND(A, A), NAND(B, B))3
NORNOTNOR(A, A)1
NORORNOR(NOR(A, B), NOR(A, B))2
NORANDNOR(NOR(A, A), NOR(B, B))3

Every wiring in the table is checked in code against all four input combinations. AND is simplest from NAND and OR is simplest from NOR, at two gates each; the other way round takes three.

2. Measurements

CircuitInputMeasured outputExpectedMatch
NAND → AND00−1.68 mV0✓
NAND → AND010.01 mV0✓
NAND → AND100.01 mV0✓
NAND → AND114.9774 V1✓
NAND → OR000.11 mV0✓
NAND → OR014.9956 V1✓
NAND → OR104.9590 V1✓
NAND → OR114.9873 V1✓
NAND → NOT04.9254 V1✓
NAND → NOT10.00 mV0✓
NOR → AND00−0.16 mV0✓
NOR → AND010.12 mV0✓
NOR → AND10−0.28 mV0✓
NOR → AND114.9557 V1✓
NOR → OR009.96 mV0✓
NOR → OR014.8822 V1✓
NOR → OR104.8852 V1✓
NOR → OR114.8847 V1✓
NOR → NOT04.9125 V1✓
NOR → NOT19.75 mV0✓

Reading anything at or below 0.8 V as 0 and at or above 2.0 V as 1 (74LS limits), all 20 readings match. High outputs were 4.88 to 5.00 V and Low outputs −1.68 mV to 9.96 mV, far inside the output limits (High ≥ 2.7 V, Low ≤ 0.5 V). Nothing else was connected to the outputs, so the values are close to ideal.

3. Switching threshold

Driving the input with a slowly changing voltage and overlaying input and output on an oscilloscope, the output switched at about 1.5 V. That has to lie between the Low limit of 0.8 V and the High limit of 2.0 V, and it does. The datasheet leaves this band undefined because the threshold varies a little from chip to chip and with temperature.

4. When a square wave looks tilted on the scope

During the lab the square wave input looked tilted instead of flat. The usual cause is the channel being set to AC coupling. AC coupling is a high-pass filter that blocks DC, so the flat tops sag toward 0 V over time. Assuming a 10 Hz coupling corner, the sag is:

Square wave frequencySag over each half-cycle
50 Hz46.7%
100 Hz27.0%
500 Hz6.1%
1 kHz3.1%
10 kHz0.3%

Logic waveforms depend on their DC level, so switch the channel to DC coupling. A probe that is out of compensation (adjusted with the screw while touching the scope's calibration terminal) also makes the corners look rounded or spiky.

5. In your lab report

For multi-bit circuits, get the expected values first with the number base converter and the 4-bit ALU calculator.