Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Let X be a 3-bit unsigned number represented by X_2 X_1 X_0 and let Z be a 9-bit

ID: 2080205 • Letter: L

Question

Let X be a 3-bit unsigned number represented by X_2 X_1 X_0 and let Z be a 9-bit unsigned number represented by Z_8 Z_7 Z_6 Z_5 Z_4 Z_3 Z_2 Z_1 Z_0. Assume that the only available components are: 8-bit adders and 4-bit times 4-bit multipliers (Schematics are shown below). Implement the function Z = X^2 + X +1 using the minimum number of available components. Implement the function Z = 2X^2 + 17X + 8 using the minimum number of available components. In this part of the problem, assume that we have a single 8-bit adder and a single 4-bit times 4-bit multiplier. We would like to implement the function Z = kX^2, where k is a constant. What is the maximum possible value of k that can be achieved? Show your implementation below for the determined maximum value of k.

Explanation / Answer

Solution:

Part (a)

Z=X2+X+1.

The above function cannot be split into its corresponding factors. It cannot be broken up into simpler terms. It can be implemented using the following components:

(a) 1 multiplier: to compute X2. Consider the multiplier as shown.

X is a 3-bit number hence set b3 and a3 to 0, b2 and a2 bits to X2, b1 and a1 to X1 and b0 and a0 to X0. Since the greatest unsigned 3-bit number is 111 (= 7), the maximum value of X2 is 49 (= 110001). Hence p7, p6 will always be 0.

(b) 1 adder: to compute the sum (X2+X+1). Consider the adder as shown.

Now in order to compute the sum X2+X+1, connect p5p4p3p2p1p0 of multiplier to a5a4a3a2a1a0 of adder respectively. Set a7a6 to 0. Set b2b1b0 of adder to X2X1X0. Set b7b6b5b4b3 to 0. Set c0 to 1 to account for 1 in the expression X2+X+1. The result obtained from adder is the required value of Z.

Part (b)

Z=2X2+17X+8

The above function can be split into simpler terms as shown below.

Z= 2X2+17X+8

= 2X2+16X+X+8

= 2X(X+8) + (X+8)

= (2X+1) (X+8)

Hence Z = (2X+1) (X+8)

Z can be implemented by computing the individual factors and multiplying them.

(2X+1) can be implemented as follows:

When an unsigned number X is multiplied by 2n, the bits of X shift to the left by n places and n ‘zeros’ are added at the end after the least significant bit (LSB).

For example consider, X=101 (=5). 2X=10 (= 1010). 4X=20 (= 10100).

Hence 2X+1 can be represented as a 4-bit number k3k2k1k0 as X2X1X0’1’.

In order to compute (X+8), 1 adder is required. Set a3a2a1a0 to 1000 respectively. Set a7a6a5 a4 to 0. Set b2b1b0 to X2X1X0. Set b7b6b5b4b3 to 0. Since the greatest unsigned 3-bit number is 111 (= 7), the maximum value of X+8 is 15 (= 1111). Hence s7, s6, s5, s4 will always be 0.

Now to compute the product, 1 multiplier is required. Connect s3s2s1s0 of adder to a3a2a1a0 of multiplier respectively. Set b3b2b1b0 of multiplier to k3k2k1k0 (considered previously).

The result obtained from multiplier is the required value of Z.

Part (c)

Initially, compute X2 using the multiplier as explained in Part (a). Since the maximum value of X2 is 49 (=110001), we can obtain the value of 4X2 (= 11000100) as explained in Part (b).

Now using the adder implement 4X2 + 4X2 = 8X2. Connect a7a6a5a4 a3a2 and b7b6b5b4b3b2 of adder to p5p4p3p2p1p0 of multiplier respectively. Set b1b0 and a1a0 of adder to 0.

The result obtained will be equivalent to 8X2. Hence the maximum value of k is 8.