(D-Problems discussed on Thursday, 20-Mar-2008)
(Q-Problems due on Tuesday, 25-Mar-2008)
[Note: Q2 added, A9 expanded. 22/3]
Discussion Problems: -- Prepare (individually)
for tutorial discussion.
T8-D1: (MAR) (Practice Prob 1 & 2 of S5.2.1 of [SG3].)
Assume that our memory unit is organized as a 1,024 x 1,024 two dimensional
array.
(a) How big does the MAR register have to be?
(b) How many bits of the MAR must be sent to the row decoder?
To the column decoder?
T8-D2: (ALU and MUX) (Problem 9 of Ch.4 of [SG3].)
Assume that we have an arithmetic/logic unit (ALU) that can carry out
20 distinct operations. Describe exactly what kind of multiplexor
circuit would be needed to select exactly one of those 20 operations.
(Note: The ALU given in the lectures (Figure 5.12, p210 of [SG3])
only carries out 4 distinct operations.)
T8-D3: IR [Instruction Register] (Problem 15 of Ch.5 of [SG3].)
Consider the following structure of the instruction register.
| op code | address-1 | address-2 |
| 6 bits | 18 bits | 18 bits |
T8-D4: (Translating algorithm for machine execution.)
In this exercise, we illustrate how to translate
a simple algorithm into a sequence of machine instructions.
|
|
|
1 MOVE 200,203 // sum-sf <-- 0; 2 MOVE 201,204 // k <-- 1; 3 COMPARE 204, 202 // while-loop compare(k,100) 4 JUMPGT 8 // jump out of while-loop 5 ADD 203,204,203 // sum-sf <-- sum-sf + k 6 ADD 204,201,204 // k <-- k + 1 7 JUMP 3 // endwhile 8 MOVE 203,205 // sum <-- sum-sf |
Problems to be Handed In for Grading by the Deadline:
(Note: Please submit hard copy to me. Not just soft copy via email.)
T8-Q1: (10 points) (Building a slightly better 32-bit ADD circuit) T8-Q2: (15 points) (Modified from Problem 16 of Ch.5 of [SG3])
In Section 4.4.3 of [SG3], the details of
how to build a 32-bit ADD circuit was presented (circuit shown
in Figure 4.27, p176).
It makes use multiple use (32 times to be precise)
of an abstraction of a 1-bit ADD circut shown in Figure 4.26, p.175).
The 32-bit ADD circuit uses a total of 700 gates (or 2,208 transistors).
Note that the circuit for 1-ADD given in Figure 4.26 is not optimized.
Optimize the circuit for 1-ADD (by applying logic laws or otherwise)
to reduce the gate count and the transistor counts
of the 32-bit ADD circuit.
(b) Set v to the value of (w+x)-(y+z).
(Note: Assume the existence of the machine language command
SUBTRACT X,Y,Z that computes
CON(Z) = CON(X) - CON(Y). Also, you can use the registers
to store the intermediate results.)
| (c) | if (v >= w) then
set x to y
else
set x to z
|
(d) | Set y to 0
while y < z do
set y to the value (y + w + z)
set z to the value (z + v)
endwhile
set answer to the value of y
|
(Note: Please check out Practice Problem 1-4 in Section 5.2.4 and also their answers at the end of the book [SG3].)
A9: (Faster ADD circuits)
The n-bit ADD circuit
given in Section 4.4.3 of [SG3] is called a
ripple carry adder since the carry bit ripples through the
individual 1-bit ADD circuits, one step at a time from the 0th bit
to the 0th bit. It therefore takes a total of n time steps
to complete the addition, and for large n (say n=32 or 64), this
makes for a rather slow n-bit ADD circuit.
Design a faster n-bit ADD circuit that takes only lg n time steps.
(Note: You may have to use more gates to achieve this.)