Logic gates
แนะนำใหม่
22:37
คอมพิวเตอร์และส่วนประกอบ
เปิดคอมพิวเตอร์ใดๆ — ผ่านเคส ผ่านชิป ลงไปถึงซิลิคอน — คุณจะพบสวิตช์ ไม่ใช่พัน ไม่ใช่ล้าน แต่เป็นพันล้าน และแต่ละตัว…**
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| on-off relays | Switches that use electricity to open or close a circuit. |
| telephone exchanges | Centres that connect telephone calls between different telephone lines. |
| logical statement | A statement that has a value of either true or false. |
| circuit/ˈsɜːkɪt/ | A complete path through which electric current can flow. |
| switches | Devices that open or close a path for electricity. |
| AND/ænd/ | |
| processor/ˈprəʊsesə/ | The component that executes instructions and performs the operations of a computer or similar system. |
| truth table/truːθ ˈteɪbl/ | ตารางความจริง |
| logic gate/ˈlɒdʒɪk ɡeɪt/ | เกตลอจิก |
| Boolean/ˈbuːlɪən/ | บูลีน |
| operation/ˌɒpəˈreɪʃn/ | An action that uses one or more inputs to produce an output. |
| low voltage | An electrical level used to represent 0 in a logic circuit. |
| high voltage | An electrical level used to represent 1 in a logic circuit. |
| function/ˈfʌŋkʃn/ | The rule that describes the output for each possible set of inputs. |
| bubble | A small circle on a gate symbol showing that the output is changed from 0 to 1 or from 1 to 0. |
| XOR/ˈeksɔː/ | |
| exclusive OR | |
| logic expression/ˈlɒdʒɪk ekˈspreʃn/ | นิพจน์ลอจิก |
วิทยานิพนธ์ของอาจารย์ผู้สร้างโลกดิจิทัล
- ในปี 1937 นักศึกษาวัย 21 ปีชื่อโคลด แชนนอน สังเกตว่ารีเลย์เปิด-ปิดในชุมสายโทรศัพท์ทำงานเหมือนกับพีชคณิตค่าจริง-เท็จที่จอร์จ บูลเขียนไว้เมื่อหนึ่งศตวรรษก่อนทุกประการ
- วิทยานิพนธ์ของเขาแสดงให้เห็นว่าประโยคตรรกะใดๆ สามารถสร้างเป็นวงจรสวิตช์ได้, และวงจรสวิตช์ใดๆ อธิบายเป็นประโยคตรรกะได้
- โปรเซสเซอร์ทุกตัวที่ผลิตมาตั้งแต่บัดนั้นคือสวิตช์จำนวนมากมหาศาล จัดเรียงอยู่ในเกตตรรกะมาตรฐานไม่กี่ชนิด
- บทเรียนนี้คือกลุ่มน้อย: สี่เหลี่ยมหกชนิด, สัญลักษณ์, และตารางความจริง

Logic Gate คืออะไร
- Logic gate คือวงจรเล็กที่ทำ Boolean operation อย่างหนึ่ง ทุกอินพุตและเอาต์พุตคือ 0 (false, ความดันต่ำ) หรือ 1 (true, ความดันสูง)
- สำหรับแต่ละเกตคุณต้องรู้สามอย่าง: สัญลักษณ์, ฟังก์ชันเป็นคำพูด, และ ตารางความจริง, ซึ่งแสดงเอาต์พุตสำหรับทุกชุดอินพุต
- เกตทั้งหมดในรายวิชานี้มีสองอินพุตยกเว้น NOT ซึ่งมีหนึ่งอินพุต

เกททั้งหก: รูปร่างสำหรับแต่ละตัว, และฟองอากาศที่เอาต์พุตถูกผกผัน

Logic gates
output from the truth table
Toggle A and B through a gate and watch the truth table row light up.
NOT, AND, OR
- NOT ผกผันอินพุตเดียวของมัน: 0 กลายเป็น 1 และ 1 กลายเป็น 0
- AND ให้เอาต์พุต 1 เฉพาะเมื่อทั้งสอง อินพุตเป็น 1
- OR ให้เอาต์พุต 1 เมื่อ อย่างน้อยหนึ่ง อินพุตเป็น 1, ดังนั้นมันจะเป็น 0 เฉพาะเมื่อทั้งสองอินพุตเป็น 0
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
A NOT gate outputs 1 when its input is 0.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
NOT inverts: 0 → 1 and 1 → 0.
An AND gate outputs 1 when:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
AND outputs 1 only if every input is 1; otherwise 0.
An OR gate outputs 0 only when:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
OR is 1 if at least one input is 1, so it is 0 only when every input is 0.
NAND, NOR, XOR
- NAND คือ NOT AND: เอาต์พุตเป็น 0 เฉพาะเมื่อทั้งสอง อินพุตเป็น 1, และเป็น 1 ในกรณีอื่นๆ
- NOR คือ NOT OR: เอาต์พุตเป็น 1 เฉพาะเมื่อทั้งสอง อินพุตเป็น 0
- XOR (exclusive OR, เขียน EOR อีกแบบ) ให้เอาต์พุต 1 เมื่ออินพุต ต่างกัน, และเป็น 0 เมื่อเหมือนกัน
| A | B | A NAND B | A NOR B | A XOR B |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 |
A XOR gate outputs 1 when:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
XOR (exclusive OR) is 1 when the inputs differ (0,1 or 1,0) and 0 when they are the same.
A NAND gate outputs 0 only when:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
NAND = NOT AND, so it is 0 exactly when AND would be 1 (all inputs 1), and 1 otherwise.
A NOR gate with both inputs 0 outputs what value (0 or 1)?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
NOR = NOT OR. OR of (0,0) is 0, so NOR is 1. NOR is 1 only when all inputs are 0.
การ์ดนี้ได้รับการแก้ไขแล้ว จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะได้รับการอัปเดต
Worked example: building a truth table
- Task: construct the truth table 真值表 for a NOR gate.
- Write the input columns A and B and list every combination in binary counting order: 00, 01, 10, 11. Four rows, never three, never repeated.
- Apply the rule to each row. NOR is 1 only when both inputs are 0, so the output column reads 1, 0, 0, 0.
- Check that every input combination appears once and that its output is correct. Binary counting order makes this easier.

Put the rows of a two-input truth table in binary counting order.
ความยาก 3/5 · 200 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Binary counting order: 00, 01, 10, 11. The output column is then compared with the mark scheme row by row.
ตัวอย่างวิธีทำ: การนิยามเกตด้วยคำพูด
- ภาระงาน: นิยามการทำงานของเกต XOR
- คำตอบในเกณฑ์การให้คะแนน:เอาท์พุตจะเป็น 1 เมื่ออินพุต แตกต่างกัน หรือเทียบเท่ากับการมีอินพุตเป็น 1 เพียงหนึ่งตัว; เอาท์พุตจะเป็น 0 เมื่ออินพุตทั้งสองเหมือนกัน
- สำหรับเกต NAND: เอาท์พุตจะเป็น 0 ก็ต่อเมื่อทั้งสองอินพุตเป็น 1 เท่านั้น สำหรับเกต NOR: เอาท์พุตจะเป็น 1 ก็ต่อเมื่อทั้งสองอินพุตเป็น 0 เท่านั้น
- คำว่า "ก็ต่อเมื่อ" (Only when) และ "อย่างน้อยหนึ่ง" (at least one) เป็นคำสำคัญที่สร้างเงื่อนไขในประโยคเหล่านี้ หากตัดออกนิยามนี้จะอธิบายเกตอื่นได้เช่นกัน
การอ่านสัญลักษณ์
- AND has a flat back and a rounded front, like a D. OR has a curved back and a pointed front. XOR is OR with an extra curved line across its inputs.
- วงกลมเล็กๆ ที่เรียกว่า บับเบิล (bubble) บนเอาท์พุตหมายถึง "กลับค่า" AND ที่มีบับเบิลคือ NAND, OR ที่มีบับเบิลคือ NOR
- เกต NOT เป็นรูปสามเหลี่ยมพร้อมบับเบิล: มีอินพุตหนึ่งช่องและเอาท์พุตหนึ่งช่อง

ด้านหลังแบนสำหรับ AND, ด้านหลังโค้งสำหรับ OR, เส้นเพิ่มสำหรับ XOR, บับเบิลสำหรับ NOT

Match each description of a symbol to its gate.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The back of the shape says AND or OR; the extra line says exclusive; the bubble says inverted.
การระบุเกตจากคอลัมน์เอาท์พุต
- อ่านคอลัมน์เอาท์พุตจากแถว 00 ลงมาจนถึงแถว 11
- 0 0 0 1 คือ AND, 0 1 1 1 คือ OR, 0 1 1 0 คือ XOR
- 1 1 1 0 คือ NAND, 1 0 0 0 คือ NOR เกตที่ถูกกลับค่าจะเริ่มด้วย 1 ในขณะที่คู่ของมันเริ่มด้วย 0

For inputs A = 0 and B = 1, which gates output 1? Select ทั้งหมด that apply.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
One input is 1, so OR and XOR give 1; both are not 1, so AND gives 0 and NAND gives 1; both are not 0, so NOR gives 0.
การเขียนนิพจน์ตรรกะ
- นิพจน์ตรรกะ เขียนเกตเป็นคำพูด:
X = A AND B,X = A OR B,X = NOT A,X = A NAND B,X = A NOR B,X = A XOR B - วงเล็บแสดงลำดับการทำงานก่อนเมื่อเกตเชื่อมต่อกัน:
X = (A AND B) OR C - นิพจน์, ตารางความจริง และวงจร คือมุมมองสามมิติของฟังก์ชันเดียวกัน บทเรียนถัดไปจะรวมเกตเข้าเป็นวงจรและเปลี่ยนผ่านระหว่างทั้งสามรูปแบบนี้

A circuit outputs 1 only when both of its inputs are 1. Which logic expression describes it?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
"Only when both" is the AND definition. NAND is its inverse, OR needs only one input, XOR needs them to differ.
การ์ดนี้ได้รับการแก้ไขแล้ว จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะได้รับการอัปเดต
Marks that slip away
- XOR is not OR. For inputs 1 and 1, OR gives 1 and XOR gives 0.
- NAND is NOT (A AND B), not (NOT A) AND B. The bubble 反相小圆圈 is on the output.
- List every input combination once, with its correct output. Binary counting order 00, 01, 10, 11 makes the table easy to check.
- A NOT gate has one input. Every other gate in this course has exactly two.
คุณเข้าใจแล้ว
- เกต ทำ-operation布尔 (Boolean operation) กับอินพุต 0 และ 1; ต้องรู้สัญลักษณ์ ฟังก์ชัน และตารางความจริงของแต่ละชนิด
- AND = ทั้งคู่เป็น 1 · OR = อย่างน้อยหนึ่งเป็น 1 · NOT = กลับค่า · NAND = 0 ก็ต่อเมื่อทั้งคู่เป็น 1 · NOR = 1 ก็ต่อเมื่อทั้งคู่เป็น 0 · XOR = อินพุตต่างกัน
- บับเบิล บนสัญลักษณ์ทำให้เอาท์พุตถูกกลับค่า; ตารางความจริงเรียงตาม 00, 01, 10, 11
- นิพจน์ตรรกะ เขียนฟังก์ชันเดียวกันเป็นคำพูด:
X = A NAND B
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้