東京大学 情報理工学系研究科 創造情報学専攻 2008年8月実施 筆記試験 第2問
Author
Description
Consider an digit decimal counter specified as follows:
a. A one digit decimal is represented by 4 bits.
b. The counter is synchronous and has a clock CK, bit outputs where .
c. The initial value of the counter is 0, namely, where .
d. The value of the counter increases by 1 at every input of the clock. When the value of the counter reaches the maximum value, the next clock input sets the output to be 0.
For example, the following figure depicts the input (the clock CK) and the output () representing a decimal number with digits.
(1) Draw a table or a diagram showing the state-transition for the case .
(2) Construct the logic circuit of the counter for the case using AND, OR, NOT gates and D flip-flops.
(3) Construct the logic circuit of the counter for the case using 4 counters based on (2) with AND, OR and NOT gates.
(4) For a given , describe a method to construct the logic circuit of the counter whose delay time is . Approximate the delay time by the number of AND, OR and NOT gates between the output and the input of D flip-flops.
题目描述
设计一个满足下列规格的 位十进制计数器。
- 每一位十进制数用 4 位二进制表示。
- 计数器为同步电路,输入为时钟 ,输出为 位 ()。
- 初值为 0,即所有 。
- 每输入一个时钟,计数值加 1;达到最大值后,下一个时钟使输出回到 0。
原文图示给出了 时的时钟输入与 输出。
- 对 画出状态转移表或状态转移图。
- 仅用与门、或门、非门和 D 触发器构造 的计数器逻辑电路。
- 使用四个由第 2 问得到的计数器模块,再配合与门、或门、非门,构造 的计数器逻辑电路。
- 对一般的 ,说明如何构造延迟为 的计数器逻辑电路。延迟以 D 触发器输出到输入之间经过的与、或、非门数量近似衡量。
Kai
各桁は8421 BCDとし、第 桁の4ビットを (重み1)から (重み8)までと定める。 が十進の最下位桁である。全Dフリップフロップは同じ の有効エッジで更新し、初期値0に設定されているものとする。
(1)
1桁について の順に書く。
| 現在の十進値 | 現状態 | 次状態 |
|---|---|---|
| 0 | 0000 | 0001 |
| 1 | 0001 | 0010 |
| 2 | 0010 | 0011 |
| 3 | 0011 | 0100 |
| 4 | 0100 | 0101 |
| 5 | 0101 | 0110 |
| 6 | 0110 | 0111 |
| 7 | 0111 | 1000 |
| 8 | 1000 | 1001 |
| 9 | 1001 | 0000 |
1010〜1111は初期状態0からは到達しない。以下の回路では、計数を許可した場合にこれらを0000へ戻すよう定義する。
(2)
を「4ビット が整数 のBCDと一致する」信号とする。例えば
各 は必要なビットをNOTで反転し、4入力AND(または2入力ANDの木)で構成できる。状態表の次ビットが1になる行をORして、
を得る。4個のD入力へ をつなげばよい。これはAND・OR・NOTだけの組合せ回路である。
多桁への連結用に、計数許可信号 を備えた一般形を示す。各D入力の前に
というAND/OR/NOTの選択回路を置く。本問の1桁カウンタでは に固定する。 なら同じ状態を保持する。
(3)
第 桁が9である信号を
とする。4桁の許可信号を
とし、(2)の許可付きカウンタ4個へそれぞれ入力する。全16個のDフリップフロップのクロックは同じ に接続する。桁上がり信号を次の桁のクロックにしてはならない。
current digit0 -- is9 --> T0 ------------------------> enable digit1
current digit1 -- is9 --> T1 -- AND(T0,T1) ----------> enable digit2
current digit2 -- is9 --> T2 -- AND(T0,T1,T2) --------> enable digit3
constant 1 -----------------------------------------> enable digit0
common CK ------------------------------------------> all four digit counters
ある桁を増やすのは、現在値でそれより下位の全桁が9のときだけである。例えば0099では下位2桁が0に戻り、第2桁だけが0から1になって0100となる。9999では全桁が同時に0へ戻る。すべての判定は更新前の状態に基づく。
(4)
一般には である。このANDを直列に並べると 段になるので、2入力ANDの並列接頭辞回路で計算する。まず とし、 で
とする。各段は同時に計算し、段を進むごとに扱う下位桁数が倍になる。最後には が得られるので、, と接続する。
9の検出、1桁の次状態関数、許可選択器はいずれも定数段であり、接頭辞回路は 段である。従ってDFF出力から入力までの遅延は ( なら )。この構成のゲート数は である。全桁の許可信号を別々の平衡AND木で作る方法でも、ゲート数は増えるが同じ遅延の条件を満たせる。