Exercise 10 (21 pts)
int power(int x, int n) {
int i, result;
result = 1;
i = n;
while( i != 0)
{ result = result * x;
i = i
- 1;
}
return result;
}
Use the C++ power function above as a guide for the computation
to be performed.
-
(3 pts) Registers
-
How many registers would be required (assume that inputs x and n do not
need registers)?
-
Which variables require registers?
-
What control signals are needed?
-
(3 pts) Multiplexers
-
How many multiplexers?
-
Group the assignment statements controlled by each multiplexer.
-
What control signals are needed?
-
(6 pts) Computational units
-
Assuming maximum concurrency, how many computational units are required?
-
Assume that the AU used in Chapter 13 notes can do multiplication also.
Give a diagram that shows:
-
Multiplexers.
-
Registers.
-
AUs.
-
The data connections between multiplexers, registers, and AUs.
-
The control connections to multiplexers, registers, and AUs.
-
(3 pts) Give the VHDL fragment for:
-
Each of the assignment statement groupings (registers and multiplexers).
-
AUs using the example from Chapter 13.
-
Define a reasonable ENTITY for the interface to this data subsystem.
-
Control Subsystem
-
(1 pt) List:
-
Names of control inputs (conditions tested).
-
Names of control outputs, include a means to signal when computation is
complete.
-
(3 pts) Give a diagram that shows:
-
States.
-
Transitions and input conditions.
-
Outputs.
-
(3 pts) VHDL of FSM that implements the control subsystem.