東京大学 情報理工学系研究科 コンピュータ科学専攻 2017年2月実施 専門科目 問題4
Author
Codex
Description
Let us consider implementing a linear recurrence sequence generator as a sequential circuit. Assume that the clock is an ideal rectangular wave without skew, and that the gate delays are negligible. The clock signal must be used for the Clock inputs of all the flip-flops, and must not be used otherwise.
Let and be positive integers. Given initial values , the value of for is defined by the recurrence equation:
where , and represents the exclusive-or (XOR) operator.
You can use AND, OR and NOT gates and positive-edge-triggered D flip-flops in your circuit design. Recall that a positive-edge-triggered D flip-flop has two inputs and Clock, and one output . At the positive-edge of the Clock signal, the input is sampled and stored as the current value of . The value of is kept unchanged until the next positive-edge of the Clock signal. A flip-flop is depicted as the following figure in this problem.

Answer the following questions.
(1) Design a 2-input XOR circuit with AND, OR and NOT gates.
(2) Consider the following circuit and the Input and Clock signals depicted by the timing diagram below. Assume that the initial values of and are zeros. Depict the timing diagram for and along with the Input and Clock signals.

(3) Suppose that we have 512 positive-edge-triggered D flip-flops and . Assume that initially stores the value of and stores 1 if and 0 otherwise, for . Design a circuit so that stores the value of at the th clock cycle.
(4) Modify the circuit you have answered in question (3) as follows, in order to enable the initialization of the flip-flops. It is enough to show only the difference. Add three inputs , and . At the positive edge of Clock, the circuit should execute the following. If input signal is 0, the value of is moved to , and the value of is moved to , for . If input signal is 1, the circuit works as described in question (3).
题目描述
考虑用时序电路实现一个线性递推序列生成器。假设时钟为无偏斜的理想矩形波,门延迟可忽略。时钟信号必须用于全部触发器的 Clock 输入,且不得用于其他用途。
设 及 为正整数。给定初值 ,对 ,由递推式
定义 ,其中 , 表示异或运算。
设计电路时可使用 AND、OR、NOT 门和上升沿触发的 D 触发器。上升沿触发的 D 触发器有两个输入 、Clock,以及一个输出 。在 Clock 信号的上升沿,对 输入采样并存储为 的当前值。 的值保持不变,直到 Clock 信号的下一个上升沿。本题以如下图形表示触发器。

回答下列问题。
(1) 用 AND、OR、NOT 门设计一个双输入异或电路。
(2) 考虑下图电路以及时序图所示的 Input 和 Clock 信号。假设 初值均为0。画出 的时序图,并同时画出 Input 和 Clock 信号。

(3) 假设有512个上升沿触发的 D 触发器 和 。对于 ,初始时 存储 ;若 , 存储1,否则存储0。设计电路,使 在第 个时钟周期存储 。
(4) 为了能够初始化触发器,按下述要求修改你在 (3) 中设计的电路。只须表示改变的部分。增加三个输入 。在 Clock 上升沿,电路应执行:若输入信号 ,则对 ,将 的值移入 ,将 的值移入 ;若 ,电路按 (3) 中所述方式工作。
Kai
(1)
For two input bits ,
Use two NOT gates, two AND gates and one OR gate. The two AND outputs are disjoint: the result is one precisely for or .
(2)
At every rising edge, all flip-flops sample their inputs simultaneously. If is the external input at the -th edge, then
All three outputs retain their values between rising edges. With the given initial zeros:
| Rising edge | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Input | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 | 0 | |
| 0 | 1 | 1 | 0 | 1 | 0 | |
| 0 | 0 | 1 | 1 | 0 | 1 |
(3)
Let and also denote the current output bits of their flip-flops. Form the combinational feedback
A cascade or tree of 255 two-input XOR circuits from (1) implements this expression; each tap term requires an AND gate. Connect the D inputs as follows:
All 512 flip-flops share the unchanged clock. Each retains its initialized tap bit.
To prove correctness, suppose that after edges, . Immediately before edge ,
Thus the next value of is , and for the next value is
The initialization supplies the induction base .
(4)
A multiplexer selecting when and when can be implemented as
Use it at the D inputs:
Here are external inputs. For , both modes require the same shift of , so no selection gate is needed there. The tap registers shift in load mode and retain their values in recurrence mode. The clock continues to connect only to the flip-flop clock pins.
To load prescribed values , keep for 256 rising edges and supply at edge . After the final load edge, all registers contain their prescribed values; set to begin generation.