Combinational building blocks
แนะนำใหม่
8:05
การออกแบบตรรกะดิจิทัล
Digital logic needs only two voltage levels, a handful of gates, and time. A three-input function has just eight rows, so checking every row is free, on paper…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| decoder/dɪˈkəʊdə/ | ตัวถอดรหัส |
| adder/ˈædə/ | ตัวบวก |
| multiplexer/ˈmʌltɪpleksə/ | มัลติเพลกเซอร์ |
| combinational logic/ˌkɒmbɪˈneɪʃənl ˈlɒdʒɪk/ | ตรรกะแบบผสม |
| full adder/fʊl ˈædə/ | เครื่องบวกแบบเต็ม |
| half adder/hɑːf ˈædə/ | ฮัลฟ์แอดเดอร์ |
| circuit/ˈsɜːkɪt/ | |
| hazard/ˈhæzəd/ | อันตราย (ฮาซาร์ด) |
สี่เครื่องดื่ม ปุ่มสองปุ่ม
- เครื่องขายอัตโนมัติเลือกเครื่องดื่มหนึ่งจากสี่ชนิดด้วยการกดปุ่มเพียงสองครั้ง แล้วแสดงตัวเลขที่ถูกต้องบนหน้าจอและคำนวณเงินทอนให้
- ภายในประกอบด้วยตัวเลือก ตัวถอดรหัส และเครื่องบวก: บล็อกมาตรฐานที่สร้างจากเกต ใช้ซ้ำในระบบดิจิทัลเกือบทุกประเภท
มัลติเพลกซ์เตอร์เลือก
- ลอจิกแบบคอมบินేชัน มีเอาต์พุตที่ขึ้นอยู่กับอินพุตปัจจุบันเท่านั้น: ไม่มีหน่วยความจำ บล็อกที่พบบ่อยที่สุดคือ มัลติเพลกซ์เตอร์ (MUX)
- MUX จาก $2^{n}$-ถึง-1 มี $n$ บิตสำหรับเลือก อ่านค่ารหัสการเลือกเป็นเลขฐานสอง: จะระบุอินพุตข้อมูลที่ส่งไปยังเอาต์พุต เมื่อมี $S_{1}S_{0} = 10$, MUX จาก 4-ถึง-1 จะส่งผ่าน $D_{2}$
A 4-to-1 MUX with select S1S0 = 10 outputs —
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The select code names its data input: $10_{2} = 2$, so $D_{2}$ passes. The MUX is a switch and does not look at the data.
ตัวถอดรหัสยกเส้นเดียว
- ตัวถอดรหัส แปลง $n$ อินพุต เป็น $2^{n}$ เอาต์พุต โดยมีเอาต์พุตที่เป็นสูงเพียงเส้นเดียว: คือเส้นที่มีหมายเลขตรงกับรหัสอินพุต
- แต่ละเอาต์พุตคือมินเทอมของอินพุตหนึ่ง ดังนั้นตัวถอดรหัสรวมกับเกต OR สามารถสร้างฟังก์ชันใดๆ จากตารางความจริงได้
Same code, a data value or one high line
$i=2S_1+S_0,\quad Y_{MUX}=D_i$
With S₁S₀ = 10, the MUX passes D₂ while the decoder raises Y₂. Set D₂ to 0 or 1 without changing the code, then change an unselected data bit and compare the outputs. The table shows every select code for the current data.
How many output lines does a decoder with 3 inputs have?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
$2^{3} = 8$ outputs, one per minterm, with exactly one high at a time.
ตัวบดว่และตัวบวกเต็ม
- ตัวบดว่ บวกบิตสองตัว: $S = A \oplus B$ และ carry $C = A \cdot B$
- ตัวบวกเต็ม ยังรับ carry-in เข้ามาด้วย: $S = A \oplus B \oplus C_{in}$ และ $C_{out} = A \cdot B + C_{in} \cdot (A \oplus B)$. เสมอจะมี $2C_{out} + S = A + B + C_{in}$


Match each block to what it does.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
These four blocks, plus registers, make up most of a datapath.
ตัวอย่างวิธีทำ: สามอินพุตเป็นหนึ่ง
- ตั้งค่า $A = B = C_{in} = 1$. จากนั้น $S = 1 \oplus 1 \oplus 1 = 1$ และ $C_{out} = 1 + 1 \cdot 0 = 1$.
- เอาต์พุต $C_{out}S = 11_{2} = 3$: สามอินพุตเป็นหนึ่ง, สามเอาต์พุตเป็นหนึ่ง การตรวจสอบ $2C_{out} + S$ ในทุก 8 แถวเพื่อยืนยันวงจร
A full adder at A = 1, B = 1, Cin = 1 outputs —
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
$2C_{out} + S = A + B + C_{in} = 3 = 2 + 1$: sum bit 1, carry 1. The same check holds on all eight rows.
ตัวบวกแบบripple
- เชื่อมต่อ $n$ ตัวบวกเต็มเข้าด้วยกัน โดยแต่ละเอาต์พุตcarry ส่งต่อไปยังcarry-in ของตัวถัดไป จะได้ ตัวบวก สำหรับตัวเลขขนาด $n$ บิต
- $11_{2} + 01_{2}$ ($3 + 1$): the low bits $1 + 1$ give $S_{0} = 0$, carry 1; the high bits $1 + 0 + 1$ give $S_{1} = 0$, carry 1. Output $100_{2} = 4$. The carry must ripple through every stage, which limits the speed.
Follow the carry from the low bit upward
$2C_{out}+S=A+B+C_{in}$
The worked 11₂ + 01₂ addition produces low sum bits 00 and a final carry 1, giving the full 100₂ result. Inspect either stage in the full-adder truth table, compare three ones entering one stage, and extend the chain to four bits.
An n-bit ripple adder is —
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Each stage feeds its carry to the next: $11 + 01 = 100$ ($3 + 1 = 4$), checked stage by stage. The design scales by repetition, and the carry chain sets its speed limit.
A 4-bit ripple adder adds 1011 and 0110. Including the final carry-out, what is the result in decimal?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
$11 + 6 = 17 = 10001_{2}$: four sum bits 0001 and a carry-out of 1.
การ์ดนี้ได้รับการแก้ไขแล้ว จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะได้รับการอัปเดต
Hazards: brief glitches
- When an input changes, signals reach the output along paths with different delays. The output can flash the wrong value for a moment: a hazard 冒险.
- The final value is still correct. A glitch matters when something samples it, such as a clock input. For a static hazard in a two-level circuit, an extra, redundant K-map group covering the transition can remove it.
A circuit with a hazard settles to the wrong output value.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The steady output is correct; a hazard is only a brief glitch while signals arrive along paths of different delay.
ข้อผิดพลาดทั่วไปสามประการ
- การอ่าน MUX กลับด้าน บิตเลือก (select bits) ใช้เพื่อบอกว่าข้อมูลอินพุตตัวใดจะถูกส่งต่อไป ไม่ใช่ค่าของเอาต์พุตเอง
- การนำสัญญาณถ่วงcarry ไปในทิศทางที่ผิด สัญญาณ carry จะไหลจากสเทจที่มีนัยสำคัญน้อยที่สุดขึ้นไปยังสเทจที่สูงขึ้น
- การเรียก hazard ว่าเป็นความผิดพลาดทางลอจิก เอาต์พุตที่คงที่นั้นถูกต้อง; มีเพียงช่วง transient เท่านั้นที่ผิด
สรุปทบทวน
- MUX: รหัสเลือกใช้ระบุชื่อข้อมูลอินพุต Decoder: มีเอาต์พุตหนึ่งต่อ minterm
- Full adder: $2C_{out} + S = A + B + C_{in}$; การเชื่อมต่อกันเป็นลูกโซ่ $n$ ตัวทำให้เกิด ripple adder ขนาด $n$-บิต
- Hazards คือ glitches ชั่วคราวจากความหน่วงที่ไม่เท่ากัน; กลุ่มที่ซ้ำซ้อนสามารถครอบคลุมและแก้ไขปัญหานี้ได้
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้