목차 보기
  1. 기본 게이트 여섯 가지
  2. 논리 레벨
  3. 출력으로 LED 켜기
  4. 쓰지 않는 입력과 게이트
  5. 74LS00 핀 배치
  6. 전원과 배치 요령
  7. 패턴도에서 확인하기
  8. 정리
Table of contents
  1. The six basic gates
  2. Logic levels
  3. Lighting an LED from the output
  4. Unused inputs and gates
  5. 74LS00 pinout
  6. Power and layout tips
  7. Checking in Patterndo
  8. Summary

디지털 회로의 기본 단위는 논리 게이트입니다. 스위치 두 개가 모두 눌렸을 때만 켜지는 조건, 둘 중 하나만 눌려도 켜지는 조건 같은 판단을 전자회로로 만든 것이 AND, OR, NOT 같은 게이트입니다. 만능기판에서는 74LS00, 74HC00 같은 14핀 로직 IC 하나에 게이트 네 개가 들어 있는 형태로 많이 씁니다. 이 글에서는 기본 게이트와 진리표, 74LS와 74HC의 차이, 논리 레벨, 쓰지 않는 입력과 게이트를 처리하는 방법을 정리합니다.

기본 게이트 여섯 가지

ANDORNOTNANDNORXOR원 모양(○)은 출력을 뒤집는다는 뜻입니다.The circle (○) means the output is inverted.
게이트 기호의 끝에 붙은 작은 원(○)은 출력을 뒤집는다는 뜻입니다.
게이트동작A=0, B=0A=0, B=1A=1, B=0A=1, B=1
AND둘 다 1이면 10001
OR하나라도 1이면 10111
NANDAND의 반대1110
NOROR의 반대1000
XOR서로 다르면 10110

NOT(인버터)은 입력이 하나인 게이트로 입력이 0이면 1, 1이면 0을 냅니다.

NAND와 NOR는 "보편 게이트"라서 이것만으로 모든 논리를 만들 수 있습니다. 예를 들어 NAND의 두 입력을 묶으면 NOT, NAND 뒤에 NOT을 붙이면 AND가 됩니다. 그래서 74LS00(NAND 네 개) 하나로 여러 실험을 할 수 있습니다.

논리 레벨

디지털 회로는 전압을 0과 1 두 구간으로 나눠 해석합니다.

항목74LS (TTL)74HC (CMOS)
전원5V (4.75 ~ 5.25V)2 ~ 6V
입력 Low로 인식0.8V 이하전원의 약 30% 이하
입력 High로 인식2.0V 이상전원의 약 70% 이상
출력 Low0.5V 이하(전류 8mA까지)거의 0V
출력 High2.7V 이상(전류 0.4mA까지)거의 전원 전압
입력 특성입력에서 약간 전류가 흐름입력이 매우 높은 임피던스(정전기 주의)
소비 전력상대적으로 큼매우 작음

74LS는 반드시 5V ±5%에서 쓰세요. 전원이 3.3V이면 정상 동작이 보장되지 않습니다. 74HC는 3.3V에서도 쓸 수 있습니다.

출력으로 LED 켜기

74LS 계열 출력은 Low로 당기는 능력(8mA)이 High로 내보내는 능력(0.4mA)보다 훨씬 큽니다. 그래서 LED는 +5V와 출력 핀 사이에 저항과 직렬로 달고, 출력이 Low일 때 켜지게 하는 것이 일반적입니다. 반대로 74HC는 양방향이 비슷하지만 약 4mA 정도로 전류가 작으니 LED 전류를 낮추거나 트랜지스터를 쓰세요(트랜지스터 스위치 회로).

쓰지 않는 입력과 게이트

입력 핀은 절대 떠 있게 두면 안 됩니다. 특히 CMOS(74HC, CD4000)는 입력이 떠 있으면 중간 전압에서 흔들리며 전류가 늘고 오동작합니다. TTL(74LS)은 떠 있으면 High로 읽히지만 잡음에 매우 약하니 역시 처리해야 합니다.

  • AND, NAND의 남는 입력: +V에 연결합니다(필요하면 1kΩ ~ 10kΩ을 거쳐). 또는 사용 중인 다른 입력과 함께 묶습니다.
  • OR, NOR의 남는 입력: GND에 연결합니다.
  • 쓰지 않는 게이트: 입력을 확실한 레벨에 묶어 두고 출력은 비웁니다. 입력을 방치하면 불필요하게 스위칭해 전류를 낭비합니다.
  • 같은 신호가 여러 입력에 필요하면 입력 핀을 서로 묶습니다.

74LS00 핀 배치

14핀 NAND 4개 IC의 핀 구성은 다음과 같습니다. 대부분의 쿼드 게이트(74LS08 AND, 74LS32 OR 등)가 같은 위치를 씁니다.

핀1234567
신호1A1B1Y2A2B2YGND
핀891011121314
신호3Y3A3B4Y4A4BVCC

A, B는 입력이고 Y가 출력입니다. 14번이 +V, 7번이 GND인 것에 주의하세요. 게이트 종류에 따라 핀 배치가 다른 IC(74LS02 NOR 등)도 있으니 데이터시트를 확인합니다(DIP IC 핀 번호 읽기, 데이터시트 읽는 법).

전원과 배치 요령

  • 모든 IC의 전원 핀에 100nF을 가까이 답니다. 디지털 IC는 스위칭할 때 순간 전류가 크므로 효과가 큽니다(전원 레일과 접지 설계).
  • 74LS와 74HC를 섞을 때는 74LS 출력(High 최소 2.7V)이 74HC 입력(5V 전원이면 3.5V 이상 필요)을 만족시키지 못할 수 있습니다. 이런 경우 풀업 저항을 달거나 74HCT(TTL 호환) 제품을 쓰세요.
  • 스위치 입력에는 풀업·풀다운과 디바운스를 잊지 마세요(택트 스위치와 풀업·풀다운 저항).

패턴도에서 확인하기

패턴도의 내장 IC에는 74LS00(NAND), 74LS02(NOR), 74LS04(NOT), 74LS08(AND), 74LS32(OR), 74LS86(XOR), 74HC00, CD4011 같은 게이트 IC가 있습니다. 스위치 두 개를 입력에 달고 LED를 출력에 달아 진리표대로 동작하는지 시뮬레이션으로 확인해 보세요. 조합한 예는 74LS90 + 74LS47 + FND로 숫자 카운터 만들기에 있습니다.

정리

게이트는 AND·OR·NAND·NOR·XOR·NOT이 기본이고 NAND만으로 모두 만들 수 있습니다. 74LS는 5V 전용이고 출력으로 LED를 구동할 때는 Low 출력으로 당기는 쪽이 유리합니다. 입력은 절대 떠 있게 두지 말고, 쓰지 않는 입력은 AND·NAND는 +V에, OR·NOR는 GND에 연결하세요.

The basic unit of a digital circuit is the logic gate. Gates like AND, OR, and NOT are electronic circuits for decisions such as "on only when both switches are pressed" or "on when either is pressed". On perfboard, they are most often used in the form of a 14-pin logic IC such as the 74LS00 or 74HC00 with four gates in one chip. This article covers the basic gates and truth tables, the difference between 74LS and 74HC, logic levels, and how to handle unused inputs and gates.

The six basic gates

ANDORNOTNANDNORXOR원 모양(○)은 출력을 뒤집는다는 뜻입니다.The circle (○) means the output is inverted.
The small circle (○) at the end of a gate symbol means the output is inverted.
GateOperationA=0, B=0A=0, B=1A=1, B=0A=1, B=1
AND1 if both are 10001
OR1 if either is 10111
NANDThe opposite of AND1110
NORThe opposite of OR1000
XOR1 if they differ0110

NOT (an inverter) is a gate with a single input that outputs 1 if the input is 0 and 0 if it is 1.

NAND and NOR are "universal gates", so you can make any logic with just one of them. For example, tying the two inputs of a NAND makes a NOT, and putting a NOT after a NAND makes an AND. That is why a single 74LS00 (four NANDs) lets you do many experiments.

Logic levels

A digital circuit interprets voltage as two ranges, 0 and 1.

Item74LS (TTL)74HC (CMOS)
Supply5 V (4.75 – 5.25 V)2 – 6 V
Input read as Low0.8 V or belowAbout 30% of supply or below
Input read as High2.0 V or aboveAbout 70% of supply or above
Output Low0.5 V or below (up to 8 mA)Nearly 0 V
Output High2.7 V or above (up to 0.4 mA)Nearly the supply voltage
Input behaviorSome current flows at the inputVery high impedance input (mind static)
Power consumptionRelatively largeVery small

Always use the 74LS at 5 V ±5%. At a 3.3 V supply, normal operation is not guaranteed. The 74HC can also be used at 3.3 V.

Lighting an LED from the output

On the 74LS family, the ability to pull Low (8 mA) is much greater than the ability to output High (0.4 mA). So it is usual to put the LED in series with a resistor between +5 V and the output pin, lit when the output is Low. The 74HC is similar in both directions but the current is small, about 4 mA, so lower the LED current or use a transistor (Transistor Switch Circuits).

Unused inputs and gates

Never leave an input pin floating. On CMOS (74HC, CD4000) especially, a floating input wobbles at an in-between voltage, the current rises, and it misbehaves. TTL (74LS) reads a floating input as High, but it is very weak to noise, so it must be handled too.

  • Spare inputs of AND and NAND: connect to +V (through 1 kΩ to 10 kΩ if needed). Or tie them together with another input that is in use.
  • Spare inputs of OR and NOR: connect to GND.
  • Unused gates: tie the inputs to a firm level and leave the output open. Leaving the inputs alone makes the gate switch needlessly and waste current.
  • If you need the same signal on several inputs, tie the input pins together.

74LS00 pinout

The pins of the 14-pin quad NAND IC are as follows. Most quad gates (the 74LS08 AND, the 74LS32 OR, and so on) use the same positions.

Pin1234567
Signal1A1B1Y2A2B2YGND
Pin891011121314
Signal3Y3A3B4Y4A4BVCC

A and B are inputs and Y is the output. Note that pin 14 is +V and pin 7 is GND. Some ICs have a different pinout depending on the gate type (such as the 74LS02 NOR), so check the datasheet (Reading DIP IC Pin Numbers, How to Read a Datasheet).

Power and layout tips

  • Put a 100 nF close to the power pins of every IC. Digital ICs draw large momentary currents when switching, so the effect is big (Power Rails, Grounding, and Decoupling Capacitor Placement).
  • When mixing 74LS and 74HC, a 74LS output (minimum High of 2.7 V) may not satisfy a 74HC input (which needs 3.5 V or more with a 5 V supply). In that case add a pull-up resistor or use a 74HCT (TTL-compatible) part.
  • Do not forget pull-ups, pull-downs, and debounce on switch inputs (Tact Switches and Pull-Up/Pull-Down Resistors).

Checking in Patterndo

Patterndo's built-in ICs include gate ICs such as the 74LS00 (NAND), 74LS02 (NOR), 74LS04 (NOT), 74LS08 (AND), 74LS32 (OR), 74LS86 (XOR), 74HC00, and CD4011. Put two switches on the inputs and an LED on the output, and check by simulation that it behaves as the truth table says. A combined example is in A 0–9 Digit Counter with a 74LS90, 74LS47, and Seven-Segment Display.

Summary

The basic gates are AND, OR, NAND, NOR, XOR, and NOT, and NAND alone can make them all. The 74LS is 5 V only, and when driving an LED from the output it is better to pull with a Low output. Never leave an input floating, and connect unused inputs to +V for AND and NAND and to GND for OR and NOR.

이 글은 학습 목적의 일반적인 안내입니다. 부품마다 규격과 핀 배열이 다를 수 있으니 실제 작업 전에는 사용하는 부품의 데이터시트를 확인하세요. 안전과 관련된 작업은 항목별 주의 사항을 먼저 읽고 진행하세요.This article is general guidance for learning purposes. Specifications and pinouts differ between parts, so check the datasheet of the part you use before real work. For safety-related work, read the cautions for each item first.