跳到主要内容

東京大学 情報理工学系研究科 コンピュータ科学専攻 2016年2月実施 問題4

Author

kainoj

Description

The majority gate M3\text{M}_3 is a binary logic gate defined as follows: M3\text{M}_3 has 33 inputs and 11 output. The output is 11 if two or three of the inputs are 1; and 0 otherwise.

When you answer circuit designs in the questions below, you can use NOT gates and constants 00 and 11 in addition to M3\text{M}_3 gates, but other gates such as AND or OR cannot be used. You should draw an M3\text{M}_3 gate as a rectangle labeled with M3\text{M}_3, and a NOT gate as a circle, as shown in the following example:

Answer the following questions. Try to make M3\text{M}_3-levels (i.e. the maximum number of serially connected M3\text{M}_3 gates) as small as possible in your answers.

(1) Design and depict the following logic circuits:

  • (a) AND of 22 inputs,
  • (b) OR of 22 inputs,
  • (cc) XOR of 22 inputs.

(2) A 1-bit full adder FA1\text{FA}_1 is defined as follows: FA1\text{FA}_1 has 33 inputs and 22 outputs called S\text{S} (sum) and C\text{C} (carry), respectively. S\text{S} and C\text{C} are defined so that 2C+S2\text{C} + \text{S} is equal to the sum of the 33 input bits.
Design and depict a 11-bit full adder FA1\text{FA}_1. Answer its M3\text{M}_3-level, too. You can use the circuits you have designed in Question (1).

(3) Design and depict a 44-bit full adder FA4\text{FA}_4. Answer its M3\text{M}_3-level, too.

Here FA4\text{FA}_4 takes, as inputs: (i) two unsigned 44-bit integers, and (ii) a carry bit.
It outputs the 55-bit sum. You can use the circuits you have designed in Questions (1) and (2).

(4) Design and depict a 44-bit multiplier MUL4\text{MUL}_4. Answer its M3\text{M}_3-level, too.

Here MUL4\text{MUL}_4 takes two unsigned 44-bit integers as inputs. It outputs the 88-bit product of the inputs. You can use the circuits you have designed in Questions (1), (2), and (3).

Kai

(1)

  • OR(x,yx, y) = majority(0,x,y)majority(0, x, y)
  • AND(x,yx, y) = majority(1,x,y)majority(1, x, y)
  • XOR(x,yx, y) = AND( OR(x,yx,y), NOT( AND(x,yx, y) ) = majority[1,majority(0,x,y),notmajority(1,x,y)]majority[1, majority(0,x,y) , not\:majority(1, x, y)]

XOR is "22-M3\text{M}_3-level".

(2)

Classic 11-bit full adder. Just draw a table and then depict the circuit. Let a,b,cina,b,c_{in} be inputs.

S=abcinC=(ab)(cin(ab))\begin{aligned} S = a\veebar b \veebar c_{in} && C = (a\land b) \lor (c_{in} \land (a \lor b)) \end{aligned}

SS yields 44-M3\text{M}_3 level (2x XOR). CC yields 33-M3\text{M}_3 level (OR with 2-level AND). Thus, FA1\text{FA}_1 has 44-M3\text{M}_3 level.

Bonus: C=majority(cin,a,b)C = majority(c_{in}, a,b). Thanks Igor!

(3)

Connect 44 FA1\text{FA}_1 in series. It's M3\text{M}_3 level is 44=164\cdot4 = 16.

(4)

Classic 44-bit multiplier (google for images). Connect three 44-bit adders in series and try not to get messed with connections. M3\text{M}_3 level is: 316+813\cdot 16 + 8\cdot 1: each of three FA4\text{FA}_4 has level 1616 and there's one level of 88 AND gates preceding FA4\text{FA}_4's.