Комбинационные базовые элементы
ВведеноВ этом уроке
| 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ə/ | Полуаддитор |
| hazard/ˈhæzəd/ | переключение |
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}$.
Мультиплексор с переключением от 4 к 1 при управляющем сигнале S1S0 = 10 выводит —
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Код управления указывает на свой вход данных: $10_{2} = 2$, поэтому проходит $D_{2}$. Мультиплексор работает как переключатель и не анализирует данные.
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.
Сколько выходных линий имеет декодер с 3 входами?
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$2^{3} = 8$ выходов, по одному на минтерм, при этом одновременно активен ровно один высокий уровень.
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}$.

Соотнесите каждый блок с его функцией.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
Эти четыре блока, вместе с регистрами, составляют основную часть пути данных.
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.
Полный сумматор при A = 1, B = 1, Cin = 1 выдает —
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
$2C_{out} + S = A + B + C_{in} = 3 = 2 + 1$: бит суммы 1, перенос 1. То же правило действует для всех восьми строк.
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.
n-разрядный сумматор с переносом — это —
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Каждая ступень передает свой перенос следующей: $11 + 01 = 100$ ($3 + 1 = 4$), проверяется последовательно. Масштабируемость достигается за счет повторения, а цепочка переносов определяет предел скорости.
Ripple-сумматор на 4 бит складывает 1011 и 0110. Включая итоговый перенос наружу, каков результат в десятичной системе?
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$11 + 6 = 17 = 10001_{2}$: четыре бита суммы 0001 и перенос наружу 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.
Схема с опасностью устанавливается в неверное значение выхода.
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Установившееся значение выхода верно; опасность — это лишь кратковременный глитч во время поступления сигналов по путям с разной задержкой.
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.
Что пошло не так? Это увидит только команда сайта.