Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksToolsOpen the lab →

7404 (74LS04, 74HC04): the hex inverter chip, live

The 7404 is a 14-pin chip with six independent inverters (NOT gates), which is what "hex inverter" means: each output nY is the opposite of its input nA. The 74LS04 and 74HC04 share the same pinout, with VCC on pin 14 and GND on pin 7. This live chip has all six inverters.

Six inverters in one package are handy because so many signals arrive in the wrong polarity: active-low chip selects and enables (like those of the 74LS138 or the 74HC595), a complement for a multiplexer's select line, or the NOT in front of a flip-flop's clock. The pinout alternates input and output up the left side (1A, 1Y, 2A, 2Y, 3A, 3Y) and output and input down the right (4Y, 4A, 5Y, 5A, 6Y, 6A), so check which pin is which before wiring. Each inverter here is a real CMOS inverter: one PMOS and one NMOS, exactly one of them on. All 64 combinations of the six inputs are checked before the page is built.

Live circuit: click the inputs to toggle them and watch the outputs update. It runs the real simulator, right here on the page.

Open this circuit in the lab →

What you need

Step by step

  1. Power the chip: VCC on pin 14 and GND on pin 7 (5 V for the 74LS04; 2 V to 6 V for the 74HC04).
  2. Each inverter has one input nA and one output nY; find their pins in the pinout below.
  3. Tie every unused input to VCC or GND: TI's 74HC datasheets say unused inputs must be terminated, because a floating CMOS input can drift and draw current.
  4. Toggle 1A: 1Y always shows the opposite value. Each of the six inverters works on its own.

7404 pinout

PinNamePinName
11A14VCC
21Y136A
32A126Y
42Y115A
53A105Y
63Y94A
7GND84Y

NOT truth table (each gate)

AY
01
10

Pin numbers are for the DIP and SOIC packages (TI SN74HC04 and SN74LS04 datasheets, checked 2026-10-25). See also the NOT gate truth table.

You can also read the full theory in the lesson on the NOT gate. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.

Build more parts from gates

half adderfull adderhalf subtractorfull subtractor2:1 multiplexer4:1 multiplexerXOR gate from NAND gates2-to-4 decoderSR latchD flip-flopJK flip-flopT flip-flop4-bit shift register4-bit ripple carry adderD latch1-to-4 demultiplexer4-bit magnitude comparator4-bit ring counter4-bit Johnson counter4-to-2 priority encoder4-bit synchronous counter3-to-8 decoder8-to-1 multiplexer4-bit carry lookahead adderhalf adder from NAND gates2-bit comparatorBCD to 7-segment decoder4-bit up/down counterdecade counter2-bit multiplier4-bit ALU4-bit array multiplierNOT, AND, OR and NOR from NANDNOT, OR, AND and XOR from NORfull adder from NAND gatesSR latch from NAND gatesparity generator and checker4-bit adder/subtractorBCD adder4-bit universal shift registermod-6 counter4-bit ripple counterbinary to Gray code converterhalf adder from NOR gatesfull adder from NOR gates4-bit register with parallel load1011 sequence detectorbinary to BCD converterD flip-flop from NAND gates1-bit ALUCMOS inverterCMOS NAND gateCMOS NOR gatePISO shift registerSR flip-flop from NAND gatesBCD to excess-3 code converterHamming (7,4) code encoder and correctortraffic light controller4-bit barrel shifterCMOS AND gateCMOS OR gateCMOS XOR gate1-bit magnitude comparatorhalf subtractor from NAND gatesfull subtractor from NAND gates8-to-3 encoderGray to binary converter4-to-16 decoderfull adder using 4:1 multiplexersedge detectorserial adder4-bit carry-select adder4-bit Kogge-Stone adder4-bit carry-skip adder4x4 Wallace tree multiplier8-bit adderfrequency divider (by 2, 4 and 3)switch debouncer (SR latch)3-bit Gray code counterMealy machine (1011 detector)master-slave JK flip-flop (NAND)half subtractor from NOR gates1-to-8 demultiplexerexcess-3 to BCD code convertervending machine FSM4-bit carry-save adder3-bit synchronous counter (JK)CMOS transmission gatetri-state buffer (CMOS)2-to-1 mux from transmission gatesmod-5 counterflip-flop conversion (JK to D)8-bit ALUdecimal to BCD encoderBCD to decimal decoder4-to-1 mux from 2-to-1 muxesXOR gate from NOR gates4-bit LFSR74LS138 decoderBCD subtractor74181 ALUCMOS AOI gate (AOI21)D latch vs D flip-flop74LS47 BCD to 7-segment decoder74HC595 shift register7400 quad NAND gate chip7402 quad NOR gate chip7408 quad AND gate chip7432 quad OR gate chip7486 quad XOR gate chip7474 dual D flip-flop74HC165 shift registerCD4017 decade counter74LS283 4-bit adder74LS90 decade counter74HC161 4-bit counter

Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.

Open the 7404 hex inverter chip in the lab →

Frequently asked

What does hex inverter mean?

Hex means six: the 7404 contains six independent inverters (NOT gates) in one 14-pin package, each turning a 1 into a 0 and a 0 into a 1.

What is the 7404 pinout?

Pin 1 1A, 2 1Y, 3 2A, 4 2Y, 5 3A, 6 3Y, 7 GND, 8 4Y, 9 4A, 10 5Y, 11 5A, 12 6Y, 13 6A, 14 VCC.

What is the difference between the 74LS04 and the 74HC04?

The same six inverters and pinout. The 74LS04 is TTL for a 5 V supply; the 74HC04 is CMOS, runs from 2 V to 6 V and draws far less current.

How many transistors does a CMOS inverter use?

Two: a PMOS transistor from VDD to the output and an NMOS from the output to ground, with their gates tied together as the input. Exactly one conducts at a time, so the output is always driven.