Lesson 70: Gates from switches
이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Logic you can build
- Logic gates are made from tiny electronic switches. You can build the idea with two push buttons.
- Series: one button after the other. The current needs both: that is AND.
- Parallel: two buttons side by side. Either one is enough: that is OR.
| A | B | AND (series) | OR (parallel) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
- 1 means the button is pressed, or the LED is on.
- The 10 kΩ pull-down resistor makes D2 read 0 when no path to 5V is closed (lesson 25).
English
In the exam
- 0478/22/M/J/23 Q2: link each logic gate (AND, OR, NAND, NOT) to its standard symbol. AND has a flat back and a round front; OR has a curved back and a pointed front.
- Use the table above for the AND and OR truth tables. Lesson 42 tests all six gates with code.
난이도 3/5 · 200코인 + 오늘 첫 완료 시 작은 보너스 추가
Build an AND gate from two buttons. Put them in series, one after the other, between the 5V row and the D2 row, and add a 10 kΩ pull-down resistor from D2 to GND (as in lesson 25). The sketch copies D2 to the LED on D13, which is already wired. The LED should light only when 두 가지 모두 buttons are pressed.
출력을 보려면 '실행'을 클릭하세요.
난이도 3/5 · 200코인 + 오늘 첫 완료 시 작은 보너스 추가
Now an OR gate: put the two buttons in parallel, side by side, each one from the 5V side to the D2 side. Keep the pull-down resistor. The LED should light when A 또는 B (or both) is pressed.
출력을 보려면 '실행'을 클릭하세요.