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.
実行ボタンをクリックして出力を確認してください。