Você está na página 1de 4

Austin Schiller

Lab 6
10/27/2014

Stage 1:
Stage 1 is designed to take in the 32 bit instruction input. If reset is zero,
Stage 1 will set the Instruction to a 32 bit 0. Otherwise, stage 1 will pass the
instruction into the register section and into the ID module.

ID module:
The ID module takes the instruction from Stage 1 and picks apart the 32 bits.
Bits 20:16 of the Instruction are used to determine the first register that will
be used. Bits 15:11 determine the 2nd register that will be used in the ALU
operation. (note that certain instructions like move only use 1 register as an
input). The ID module then takes in the write enable from the instruction, the
write select, and the ALU operation selects that will be used. This module
then outputs the data read from the two (or 1) registers that were selected
from by the binary instruction bits 20:11. This module calls the Register file
and Stage 2.

Stage 2:
This stage is used to pass on the data recieved from the register File and to
separate out more bits that are needed from the Instruction. Stage 2 grabs
the immediate from the instruction bits 15:0, grabs the ALU operation from
bits 28:26, grabs the immediate enable fom bit 29, and grabs the register
number to write to from instruction bits 25:21. This stage also passes on the
read data frmo the registers in the ID module. If reset is zero, this module will
zet all of the values listed above to 0.

EX module:
This module calls the ALU, the 32 bit mux, and Stage 3. First, this module will
pass the immediate into the mux along with the value from the 2nd read
register. Using hte bit 29 from the istruction that was recieved in stage 2, the
mux will determine whether to use the immediate or the data from the 2nd
read register (1 means immediate 0 means register). The module will then
send the result of the mux and the data from the first read register into the
ALU. Using the ALU operation received from the instruction, the ALU will

perform one of 7 operations and output it's result to stage 3.


Stage 3:
Stage 3 takes in the output from the ALU as well as write enable and the
register number that will be written to. It will then assign the output of the
ALU to the register. If reset is enabled, it will set the ALU output and the write
select to 0.

Top Module:
This module first calls stage 1 and passes the output of stage 1 into the ID
module. The ID module will then receive the data from the register files that
is to have an ALU operation preformed on it. The module will then take this
data and pass it to the EX module. This module will preform the ALU
operation and output the result to the register that is given.

The picture above shows the begining of the output of the ALU (the value of
the written register). The test lines that were given before the lab were used.
The picture shows that the output started showing exactly 3 clock ticks after
the program was started. The numbers were converted to hex in order to
view and compare the numbers more easily.

The picture above shows more results from the lab. It shows the input on the
second line and the expected output on the top line. Again, this input and
solution follows the format that was given for testing the lab.

The picture above shows the last few solutions. As you can see, after the
program ends, the registers hold their values. This is as expected.

Você também pode gostar