Adders and flip-flops
導入済み
14:50
RISC、パイプライン & ロジック
2人のチップデザイナーが同じ問題に直面しています:プログラムを高速に実行することです。一人はこう言います——強力な命令を作成して、1つの命令で多くの作業を行わせることです。もう一人はこう言います——keep…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| processor/ˈprəʊsesə/ | The component that executes instructions and performs the operations of a computer or similar system. |
| adder/ˈædə/ | A logic circuit that adds binary numbers. |
| gates | Electronic components that produce an output from one or more binary inputs. |
| sum digit | The digit written in one column after adding the bits and any carry-in. |
| carry/ˈkæri/ | Carry(進位) |
| half adder/hɑːf ˈædə/ | ハーフアダクター |
| full adder/fʊl ˈædə/ | フル加法器 |
| carry-in | A bit carried from the column to the right into an addition. |
| bit/bɪt/ | A binary digit, taking the value zero or one. |
| memory/ˈmeməri/ | Circuits that store data, such as registers, RAM and ROM. |
| flip-flop/flɪp flɒp/ | フリップフロップ |
| sum/sʌm/ | The bit produced in the current column when binary bits are added. |
| binary addition | The process of adding numbers written using the digits zero and one. |
| carry-out | A bit carried from an addition to the next column on the left. |
| ripple-carry adder/ˈrɪpl ˈkæri ˈædə/ | Ripple-carry 加法器(波伝送型加法器) |
| 4-bit adder | A circuit that adds two binary numbers with four bits each. |
| bistable/baɪˈsteɪbl/ | 双安定回路 |
| circuit/ˈsɜːkɪt/ | A complete path through which electric current can flow. |
| registers/ˈredʒɪstəz/ | A small, fast storage location within a processor used to hold data, addresses or instructions temporarily. |
| counters/ˈkaʊntəz/ | カウンタ |
| SRAM/ˈesræm/ | A type of RAM that uses flip-flops to store bits without needing refresh. |
| cells/selz/ | Small parts of memory that each store a bit of data. |
| SR flip-flop/ˌes ˈɑː flɪp flɒp/ | SRフリップフロップ |
| set/set/ | To make the output Q of a flip-flop become 1. |
| reset | To make the output Q of a flip-flop become 0. |
| cross-coupled NOR gates | Two NOR gates connected so each output feeds into the other gate's input. |
| JK flip-flop/ˌdʒeɪ ˈkeɪ flɪp flɒp/ | JKフリップフロップ |
| toggle/ˈtɒɡl/ | トグル |
| clock edge/klɒk edʒ/ | The moment when a clock signal changes from 0 to 1 or from 1 to 0. |
真と偽のみを知る機械がどうして計算を行うのか
- プロセッサには、数字を知る意味での加算器は存在しません。真か偽かを答えるゲートがあり、それ以外に何もないのです。
- しかし $1 + 1 = 10$ は二つのゲートから成り立ちます:XORゲートが和の桁(sum digit)を、ANDゲートが桁送り(carry)を与えます。これはミニチュア版の演算回路そのものであり、これらを連鎖させることで任意のビット幅の数の加算が可能になります。
- コンピュータのもう一つの側面は記憶であり、メモリの1ビットもまたゲートです。出力が入力に戻され、状態を保持するように配線されています。
- このレッスンはハーフ加算器、フル加算器、そしてビットを記憶するフリップフロップです。
ハーフ加算器
- ハーフ・アダラーは2つの単一ビット $A$ と $B$ を加算し、和 $S$ と 桁送り $C$ を生成します。
| A | B | S | C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
- 列を読み取ります:$S$ は入力 Exactly one が1の時に1になり、これが XOR です。$C$ は両方が1の時のみに1になり、これが AND です。したがって $S = A \oplus B$ と $C = A \cdot B$ となります。
- これには桁送りの入力(carry in)を無視するため、「半分の」加算器であり、単独では連鎖できません。

2つのゲート、および二進加算が存在する

The gates inside an adder
A half-adder's sum bit is an XOR gate and its carry is an AND gate — toggle A and B and watch the truth-table row light up.
In a half adder, the sum output S is produced by which gate?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
$S = A \text{ XOR } B$ (1 when the inputs differ); the carry is $A \text{ AND } B$.
In a half adder the carry output C is produced by which single gate?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
C is 1 only when both inputs are 1, which is AND. The sum S is 1 when exactly one input is 1, which is XOR.
フル・アダラー
- フルアダクタは3ビットを加算する:$A$、$B$、およびCarry-in(持ち込み)。結果としてSum(和)とCarry-out(持ち出し)を生成する。$S = A \oplus B \oplus C_{\text{in}}$。
- これは 2つのハーフ・アダラー+ORゲート で構成できます:最初のハーフ・アダラーが $A$ と $B$ を加算し、2番目がその和に桁送りの入力を加え、ORゲートが2つの桁送りを統合します。
- フル・アダラーを連鎖させ、各桁送りの出力を次の桁送りの入力につなげると、マルチビットのリプル・キャリア・アダラーが完成します。4つ連結することで2つの4ビット数を加算できます。

桁送りが移動しなければならないため、リプルと呼ばれます

Match each building block to what it does.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Adders add bits (chain full adders for multi-bit addition); flip-flops store a bit (the JK fixes the SR forbidden state).
How does a full adder differ from a half adder?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
A full adder adds A, B and a carry-in (so adders can be chained) — built from two half adders plus an OR gate.
worked example: フル・アダラーを使う理由、ハーフ・アダラーではない
- なぜ4ビット加算器はハーフ・アダラーではなくフル・アダラーで構成されるのか説明してください。
- 2つの4ビット数を桁ごとに加算する場合、右端以外のすべての桁は、右隣の桁からの 桁送り を受け取ることがあるため、加算の入力が 3つ となり、2つではありません。
- ハーフ・アダラーには桁送りの入力がなく、第3の入力を処理できないため、桁送りは失われてしまいます。
- 最下位桁のみが桁送りの入力を持たないため、そこにはハーフ・アダラーが使えますが、実際にはすべてフル・アダラーを使用し、最初の桁送りの入力は0に固定されます。

Why must a 4-bit adder use full adders rather than half adders?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
A half adder does produce a carry; what it lacks is a carry-in, so it cannot accept the carry arriving from the previous column.
Put the construction of a 4-bit ripple-carry adder in order.
難易度 3/5 · 200 コイン + 今日初回達成時の小ボーナス
Gates make a half adder, half adders make a full adder, full adders chain into a word-width adder. The carry rippling along is what gives it its name.
フリップフロップ
- フリップフロップとは バイスタブル(双安定)回路です。0と1の2つの安定状態を持ち、現在置かれている状態を 記憶 します。正確に1ビットを格納します。
- これは レジスタ、 counters、および SRAMセルの基本的な要素であり、$n$ ビット means $n$ フリップフロップです。
- 加算器のように現在の入力のみに依存せず、フリップフロップの出力は 過去の 入力にも依存します。これが回路レベルにおける記憶の意味です。
A flip-flop is used to:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
A flip-flop has two stable states and holds one bit — the building block of registers and SRAM.
A flip-flop is bistable — it has two stable states and remembers one bit — which makes it the building block of registers and SRAM.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Chaining flip-flops gives registers and counters; SRAM cache is built from them (no refresh needed, unlike DRAM).
SRおよびJK
- SRフリップフロップ SRは、入力 S(セット)と R(リセット)、出力 $Q$ と $\overline{Q}$ を持ち、2つのクロスカップルNORゲートで構成されます。
S=1, R=0は $Q$ を1に セット します。S=0, R=1は $Q$ を0に リセット します。S=0, R=0は現在の状態を ホールド (保持)し、これが記憶機能です。S=1, R=1は 無効 です:セットとリセットを同時に要求するためです。- JKフリップフロップは、
1,1入力の意味をトグル(Toggle)として与えることでこの欠陥を解消し、出力を反転させる。これによりカウンタに最適であり、トグル動作するフリップフロップの連鎖は二進数でカウントする。 - JKフリップフロップは通常 クロック 化されており、入力はクロックエッジの時にのみ作用するため、マシン内のすべてのフリップフロップが同期して動作します。

無効だった入力が有効なものに変換された

For an SR flip-flop, which statements are correct? Select すべて that apply.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Toggling on 1,1 is the JK's improvement. On an SR that input asks for set and reset at once and is invalid.
The JK flip-flop's toggle behaviour is what makes it suitable for building counters.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
A chain of flip-flops each toggling on its input counts in binary. Clocking them keeps every stage in step.
worked example: SRフリップフロップのトレース
- $Q$ は現在0です。S=1, R=0、次に S=0, R=0、最後に S=0, R=1 の入力後における $Q$ を示してください。
- S=1, R=0 で セット されるため、$Q$ は1になります。
- S=0, R=0 で ホールド されるため、$Q$ は1のままです。これが記憶であることを示すステップです:入力が何も言っていないのに、出力は持続しています。
- S=0, R=1 で リセット されるため、$Q$ は0になります。もし S=1 かつ R=1 が適用された場合、答えは値ではなく入力が 無効 であるというものです。

見落としやすいポイント
- $S = A \oplus B$ と $C = A \cdot B$ :和には XOR 、桁送りには AND 。これらを入れ替えると両方のマークを失います。
- 「半分」とは「ビットの半分」ではなく「桁送りの入力なし」を意味します。
- フル・アダラーは 2つのハーフ・アダラー+ORゲート であり、ORゲートが2つの桁送りを統合します。
- SRフリップフロップにおいて、
0,0は ホールド し、1,1は 無効 です。JKの改善点は、1,1が トグル することです。
理解できましたか
- ハーフ・アダラー:2ビット入力、XORからの $S = A \oplus B$ とANDからの $C = A \cdot B$ 、桁送りの入力なし
- フル・アダラー:3ビット入力、2つのハーフ・アダラー+ORゲートで構成。連鎖させ、桁送りの出力を桁送りの入力につなげ、リプル・キャリア・アダラー を形成
- フリップフロップ は バイスタブル で1ビットを格納;$n$ 個のフリップフロップで $n$ ビットのレジスタを作成し、これらはSRAMのセルです
- SR:セット、リセット、
0,0はホールド、1,1は無効 · JK:1,1は トグル 、これがカウンタの基盤であり、同期するためにクロック化されている
何が問題でしたか?この内容はサイトの運営チームだけが確認します。