Docsity

Solutions to Problem Sets in Computer Organization, Fall 2007, Comp 411 - Prof. Leona Mcmi, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
Comp 411 Computer Orginization
Fall 2007
Problem Set #6 Solutions
Problem 1
a) The worst case input for this adder is adding 1111 1111 1111 1111 1111 to 0000 0000 0000 0000
0001. The critical path for this calculation involves each adder waiting on the carry from the
previous adder.
The formula for the delay is tPD = (tP D,XO R +tP D,AND +tPD,O R)+(N−2) ∗(tPD,OR +
tP D,AND ) + tP D,X OR . Thus, the delay would be 3 time units for the LSB, 2 time units for the
next 18 bits, and 1 time unit for the MSB. This results in a total delay of 40 time units.
It is worth noting that replacing the LSB adder with a half adder will decrease the delay
slightly.
b) The two circuits needed to form the block are:
P
P
P
P
P
P
G
G
G
G3
2
3
1
2
3
0
1
2
3
0,3
G
P
P
P
0
1
2
3
P
P0,3
c) Each adder will take 1 time unit to generate the needed G and P signals. The block generate and
block propagate signals take a further 2 units of time to generate P0,3and G0,3. Generating
Cout takes 2 more time units. The total operation takes 5 time units.
Doing this with a ripple carry would take 9 time units, since the carry must propagate through
4 adders (3+2+2+2).
d) The formula given in lecture to calculate the delay is Tpd = 2∗[K+ (N/K −2) + k]. This formula
gives the delay as 2*[4 + (20/4 -2) + 4] = 22 time units. This compares very favorably with
the 41 unit time for the ripple carry.
e) This type of adder allows the carry propagation to ’skip’ over groups of adder stages.
f) The size of the skip block influences the time it takes for the signal to pass through the block. The
size of the block also influences the distance of the ’skip’. For example, a 5-bit carry-propagate
block would take 4 time units to generate a carry out signal. In some cases, this extra delay
is worth the skipping of extra bits.
1
pf3
pf4
pf5

Partial preview of the text

Download Solutions to Problem Sets in Computer Organization, Fall 2007, Comp 411 - Prof. Leona Mcmi and more Assignments Computer Architecture and Organization in PDF only on Docsity!

Comp 411 Computer Orginization

Fall 2007

Problem Set #6 Solutions

Problem 1

a) The worst case input for this adder is adding 1111 1111 1111 1111 1111 to 0000 0000 0000 0000

  1. The critical path for this calculation involves each adder waiting on the carry from the previous adder.

The formula for the delay is tP D = (tP D,XOR + tP D,AN D + tP D,OR) + (N − 2) ∗ (tP D,OR + tP D,AN D) + tP D,XOR. Thus, the delay would be 3 time units for the LSB, 2 time units for the next 18 bits, and 1 time unit for the MSB. This results in a total delay of 40 time units.

It is worth noting that replacing the LSB adder with a half adder will decrease the delay slightly.

b) The two circuits needed to form the block are:

PP P P P

P

G

G

G G 3

2

3

1 2 3

01

23

G0,

PP P 012

3 P P 0,

c) Each adder will take 1 time unit to generate the needed G and P signals. The block generate and block propagate signals take a further 2 units of time to generate P 0 , 3 and G 0 , 3. Generating Cout takes 2 more time units. The total operation takes 5 time units. Doing this with a ripple carry would take 9 time units, since the carry must propagate through 4 adders (3+2+2+2).

d) The formula given in lecture to calculate the delay is Tpd = 2 ∗ [K + (N/K − 2) + k]. This formula gives the delay as 2*[4 + (20/4 -2) + 4] = 22 time units. This compares very favorably with the 41 unit time for the ripple carry.

e) This type of adder allows the carry propagation to ’skip’ over groups of adder stages.

f ) The size of the skip block influences the time it takes for the signal to pass through the block. The size of the block also influences the distance of the ’skip’. For example, a 5-bit carry-propagate block would take 4 time units to generate a carry out signal. In some cases, this extra delay is worth the skipping of extra bits.

Problem 2

a) A 1 A 0 B 1 B 0 P 3 P 2 P 1 P 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 1 0 0 1 S 0 = A 0 B 0 S 1 = A 0 B 1 A 1 B 0 + A 1 B 0 A 0 B 1 S 2 = A 1 B 1 A 0 B 0 S 3 = A 1 B 1 A 0 B 0

A

B

A

B

0

0

1

1

2

3

P

P

P

P

0

1

b) As seen in the following truth table, the circuit’s function is to multiply two 2-bit numbers.

e) The truth table for logic that computes a 2-bit unsigned square is:

A 1 A 0 Q 3 Q 2 Q 1 Q 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 0 1 Q 0 = A 0 Q 1 = 0 Q 2 = A 1 A 0 Q 3 = A 1 A 0

A

A

0

1

0

Q Q Q Q

0 1 2 3

Problem 3

a) An easy way to show this is via truth-tables.

V = An− 1 Bn− 1 Sn− 1 + An− 1 Bn− 1 Sn− 1 V = XOR(Cout, Cin) Cin Bn− 1 An− 1 Sn− 1 V 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 1 1 0 1 0 0 1 1 0 0 0 1 1 1 1 0

Cin Bn− 1 An− 1 Cout V 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 0

b) Both methods work identically. We must assume that the negative input values are not the smallest possible negative value, or the operation will always be incorrect.

Consider the case when a negative number is subtracted from a positive number, yielding a negative result. This is equivalent to adding two positive numbers. Both formulas give identical results: An− 1 = 0, Bn− 1 = 0, Sn− 1 = 1, Cout = 0, Cin = 1 V = 001 + 001 = XOR(0, 1) = 1

When a positive number is subtracted from a negative number and a positive number re- sults, it is the same as adding two negative numbers. Again, both methods give the same result.: An− 1 = 1, Bn− 1 = 1, Sn− 1 = 0, Cout = 1, Cin = 0 V = 110 + 110 = XOR(1, 0) = 1

c) Only C is needed. In the case that the MSB adder generates a Cout, the value is clearly too large to be represented in the finite byte stream.

d) The addu instruction can certainly be used for signed 2’s-complement arithmetic. The user must simply be aware, that there will be no indication if an operation’s results are not valid.

Problem 4

a) Yes, both circuits produce identical results.

b) Design #2 is faster; it can compute X + Y + Z in 5 units of time. Design #1 takes 6 units of time.

Design #2 also generates the LSB faster (1 unit) than Design #1 (2 units).

c) Remove the bottom right adder. Tie Z 0 to the Ci on the top right adder. Tie W 0 to the S output on the top right adder. Set the Ci on the W 1 adder to 0.

A B

S

C O CI

A B

S

C O CI

A B

S

C O CI

A B

S

C O CI

A B

S

C O CI

A B

S

C O CI

A B

S

C O CI

A B

S

C O CI

X3 Y3 X2 Y2 X1 Y1 X0 Y

0 Z3 Z

Z

Z

0

W5 W4 W3 W2 W1 W

Design #2 is still faster.

d) Design #2 is easier to add carry lookahead to. It has one carry path along the bottom, necessi- tating one CLA tree. Design #1 has two carry paths.