74LS·74HC 로직 게이트 기초와 미사용 입력 처리74LS and 74HC Logic Gate Basics and Handling Unused Inputs
AND·OR·NAND·NOR·XOR 진리표, 74LS와 74HC의 차이, 전원 핀 위치, 쓰지 않는 입력과 게이트를 처리하는 방법을 한 번에 정리했습니다.Truth tables for AND, OR, NAND, NOR, and XOR, the difference between 74LS and 74HC, power pin locations, and how to handle unused inputs and gates, all in one place.
디지털 회로의 기본 단위는 논리 게이트입니다. 스위치 두 개가 모두 눌렸을 때만 켜지는 조건, 둘 중 하나만 눌려도 켜지는 조건 같은 판단을 전자회로로 만든 것이 AND, OR, NOT 같은 게이트입니다. 만능기판에서는 74LS00, 74HC00 같은 14핀 로직 IC 하나에 게이트 네 개가 들어 있는 형태로 많이 씁니다. 이 글에서는 기본 게이트와 진리표, 74LS와 74HC의 차이, 논리 레벨, 쓰지 않는 입력과 게이트를 처리하는 방법을 정리합니다.
기본 게이트 여섯 가지
게이트 기호의 끝에 붙은 작은 원(○)은 출력을 뒤집는다는 뜻입니다.
게이트
동작
A=0, B=0
A=0, B=1
A=1, B=0
A=1, B=1
AND
둘 다 1이면 1
0
0
0
1
OR
하나라도 1이면 1
0
1
1
1
NAND
AND의 반대
1
1
1
0
NOR
OR의 반대
1
0
0
0
XOR
서로 다르면 1
0
1
1
0
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% 이상
출력 Low
0.5V 이하(전류 8mA까지)
거의 0V
출력 High
2.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 등)가 같은 위치를 씁니다.
핀
1
2
3
4
5
6
7
신호
1A
1B
1Y
2A
2B
2Y
GND
핀
8
9
10
11
12
13
14
신호
3Y
3A
3B
4Y
4A
4B
VCC
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
The small circle (○) at the end of a gate symbol means the output is inverted.
Gate
Operation
A=0, B=0
A=0, B=1
A=1, B=0
A=1, B=1
AND
1 if both are 1
0
0
0
1
OR
1 if either is 1
0
1
1
1
NAND
The opposite of AND
1
1
1
0
NOR
The opposite of OR
1
0
0
0
XOR
1 if they differ
0
1
1
0
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.
Item
74LS (TTL)
74HC (CMOS)
Supply
5 V (4.75 – 5.25 V)
2 – 6 V
Input read as Low
0.8 V or below
About 30% of supply or below
Input read as High
2.0 V or above
About 70% of supply or above
Output Low
0.5 V or below (up to 8 mA)
Nearly 0 V
Output High
2.7 V or above (up to 0.4 mA)
Nearly the supply voltage
Input behavior
Some current flows at the input
Very high impedance input (mind static)
Power consumption
Relatively large
Very 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.
Pin
1
2
3
4
5
6
7
Signal
1A
1B
1Y
2A
2B
2Y
GND
Pin
8
9
10
11
12
13
14
Signal
3Y
3A
3B
4Y
4A
4B
VCC
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).
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.
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.
에디터에서 직접 해 보기Try it in the editor
읽은 내용을 패턴도 에디터에서 바로 확인해 보세요. 회원가입 없이 열리고, 납땜 전에 배치와 배선을 몇 번이고 고쳐 볼 수 있습니다.Try what you just read right in the Patterndo editor. It opens without sign-up, and you can rework the layout and wiring as many times as you like before you solder.
이 글은 학습 목적의 일반적인 안내입니다. 부품마다 규격과 핀 배열이 다를 수 있으니 실제 작업 전에는 사용하는 부품의 데이터시트를 확인하세요. 안전과 관련된 작업은 항목별 주의 사항을 먼저 읽고 진행하세요.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.