Cấu trúc tổ hợp
Đã giới thiệuTrong bài học này
| English | Ý nghĩa |
|---|---|
| decoder/dɪˈkəʊdə/ | Bộ giải mã |
| adder/ˈædə/ | Cộng |
| multiplexer/ˈmʌltɪpleksə/ | Bộ chọn đa |
| combinational logic/ˌkɒmbɪˈneɪʃənl ˈlɒdʒɪk/ | combinational logic: mạch tổ hợp |
| full adder/fʊl ˈædə/ | Cộng đầy đủ |
| half adder/hɑːf ˈædə/ | half adder: bộ cộng nửa |
| hazard/ˈhæzəd/ | Rủi ro |
Four drinks, two buttons
- A vending machine picks one of four drinks from two button presses, lights the right number on its display and works out the change.
- Inside are a selector, a decoder and an adder: standard blocks built from gates, reused in nearly every digital system.
The multiplexer selects
- Combinational logic 组合逻辑 has outputs that depend only on the present inputs: no memory. Its most common block is the multiplexer 多路选择器 (MUX).
- A $2^{n}$-to-1 MUX has $n$ select bits. Read the select code as a binary number: it names the data input that reaches the output. With $S_{1}S_{0} = 10$, a 4-to-1 MUX passes $D_{2}$.
Multiplexer 4-đến-1 với tín hiệu chọn S1S0 = 10 sẽ đưa ra đầu ra —
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Mã chọn xác định đầu vào dữ liệu: $10_{2} = 2$, nên $D_{2}$ sẽ được truyền. MUX hoạt động như một công tắc và không xem xét nội dung dữ liệu.
The decoder raises one line
- A decoder 译码器 turns $n$ inputs into $2^{n}$ outputs, with exactly one output high: the one numbered by the input code.
- Each output is one minterm of the inputs, so a decoder plus an OR gate can build any function from its truth table.
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.
Bộ giải mã với 3 đầu vào có bao nhiêu đường ra?
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
$2^{3} = 8$ đường ra, mỗi đường ứng với một minterm, với đúng một đường cao tại một thời điểm.
Half and full adders
- A half adder 半加器 adds two bits: $S = A \oplus B$ and carry $C = A \cdot B$.
- A full adder 全加器 also takes a carry-in: $S = A \oplus B \oplus C_{in}$ and $C_{out} = A \cdot B + C_{in} \cdot (A \oplus B)$. Always $2C_{out} + S = A + B + C_{in}$.

Ghép nối mỗi khối với chức năng của nó.
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Bốn khối này, cộng thêm các thanh ghi, tạo thành phần lớn của một datapath.
Worked example: three ones in
- Set $A = B = C_{in} = 1$. Then $S = 1 \oplus 1 \oplus 1 = 1$ and $C_{out} = 1 + 1 \cdot 0 = 1$.
- Output $C_{out}S = 11_{2} = 3$: three ones in, three out. Checking $2C_{out} + S$ on all 8 rows verifies the circuit.
Cộng đầy đủ tại A = 1, B = 1, Cin = 1 cho đầu ra —
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
$2C_{out} + S = A + B + C_{in} = 3 = 2 + 1$: bit tổng 1, carry 1. Điều kiện tương tự cũng áp dụng cho tất cả tám hàng.
The ripple adder
- Chain $n$ full adders, each carry-out feeding the next carry-in, and you have an adder 加法器 for $n$-bit numbers.
- $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.
Bộ cộng lan truyền n-bit là —
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Mỗi giai đoạn truyền carry của nó sang giai đoạn tiếp theo: $11 + 01 = 100$ ($3 + 1 = 4$), được kiểm tra từng giai đoạn. Thiết kế mở rộng bằng cách lặp lại, và chuỗi carry đặt giới hạn tốc độ.
Một bộ cộng lan truyền 4-bit cộng 1011 và 0110. Bao gồm cả carry-out cuối cùng, kết quả là bao nhiêu trong thập phân?
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
$11 + 6 = 17 = 10001_{2}$: bốn bit tổng 0001 và một carry-out là 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. An extra, redundant K-map group covering the transition removes it.
Một mạch có rủi ro sẽ ổn định ở giá trị đầu ra sai.
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Đầu ra ổn định là chính xác; rủi ro chỉ là nhiễu ngắn khi tín hiệu đến theo các đường truyền với độ trễ khác nhau.
Three common slips
- Reading the MUX backwards. The select bits choose which data input passes; they are not the output value.
- Running the carry the wrong way. Carries flow from the least significant stage upwards.
- Calling a hazard a logic error. The steady output is right; only the transient is wrong.
Recap
| MUX | Decoder | |
|---|---|---|
| Inputs → outputs | $2^{n}$ data → 1 | $n$ → $2^{n}$ |
| The code | names the data input that passes | raises the one output it numbers |
| Builds any function with | the truth table on its data inputs | an OR of the minterm outputs |
- Full adder: $2C_{out} + S = A + B + C_{in}$; $n$ chained full adders make an $n$-bit ripple adder.
- Hazards are transient glitches from unequal delays; a redundant group covers them.
Đã xảy ra vấn đề gì? Chỉ đội ngũ trang web nhìn thấy thông tin này.