東京大学 情報理工学系研究科 電子情報学専攻 2019年8月実施 専門 第2問
Author
Description
Let us design a circuit that obtains a 4-bit signed integer by calculating 4-bit addition/subtraction of a 4-bit signed integer and a 2-bit signed integer . The integers and are expressed in two's complement. The types of logic gates that you can use are NOT, AND , OR, and XOR, each of which is equipped with as many inputs as the design requires. Answer the following questions.
(1) Show the maximum and minimum values of and in decimal form.
(2) Show a circuit that calculates to obtain by combining logic gates. Organize the adder as a ripple carry adder. You can use signals from , supply voltage , and grounding voltage GND as inputs, The output should be . To simplify the diagram, use the "half-adder" blocks and the "full-adder" blocks after showing gate-level designs of both blocks.
(3) Consider adding an overflow detection mechanism to the circuit designed in (2). Show the overflow detection circuit by combining the logic gates. You can use signals from and as inputs. The output should be a 1-bit signal named ; it should be '1' when the overflow occurred, or '0' otherwise.
(4) Show a circuit that calculates to obtain by combining logic gates. Organize the adder as a ripple carry adder. You can use signals from and GND as inputs. The output should be . Use the "half-adder" blocks and the "full-adder" blocks in (2).
(5) Show all the input patterns that cause overflows for the calculation designed in (4).
题目描述
设计一个电路,对 位有符号整数 与 位有符号整数 做 位加/减运算,得到 位有符号整数 。 均用二进制补码表示。可用的门为 NOT、AND、OR、XOR,每种门的输入数可按设计需要确定。
(1) 用十进制写出 、 各自的最大值和最小值。
(2) 用逻辑门组合出计算 的行波进位加法器。可使用 、、电源电压 和地电压 GND 作为输入,输出为 。先给出半加器和全加器的门级设计,随后可用二者的模块符号简化总图。
(3) 为 (2) 的电路增加溢出检测。用 、、 中的信号组合逻辑门,输出一位信号 ;发生溢出时 ,否则 。
(4) 用逻辑门组合出计算 的行波进位加法器。可使用 、、 和 GND,输出为 ,并使用 (2) 中的半加器、全加器模块。
(5) 列出 (4) 所设计减法运算中会造成溢出的全部输入模式。
Kai
(1)
最大値のビット表現は 、最小値は である。
(2)
半加器は 、全加器は を実現する。
を4ビットに符号拡張して とする。下図の を GND()に接続すれば、4段の全加器で が得られる。最下位段は なので半加器に置き換えてもよい。
(3)
加算の符号付きオーバーフローは、二つの入力の符号が同じで、結果の符号がその符号と異なるときに発生する。 の符号ビットは なので
(4)
(2) の回路で を ()に接続する。二つの XOR ゲートにより を反転し、 を上位2段にも入力する。最下位のキャリー入力は とする。4段の全加器から が得られる。
(5)
または となる組を列挙すればよい。全入力パターンは次の4通りである。
| 真の | ||||
|---|---|---|---|---|
0110 | 10 | |||
0111 | 10 | |||
0111 | 11 | |||
1000 | 01 |
減算時の検出式は である。