Professional Documents
Culture Documents
Name(s) ____Dalton_Sherratt_and_Isaac_Klein____
Refer to the highlighted language in the Project A instruction for the context of the following questions.
a. [Part 1.a] Provide a description of how each of the control values in the architecture (i.e., the outputs of
the main control unit) is used.
For each output control signal, explain how it is used (i.e., what does it do?)
For the 6 MIPS instructions to support, ADD, ADDI, LW, SW, BEQ and J, complete the following
table.
1|Page
(continuing from the previous question) For each of the 6 MIPS instruction, explain why you set
the values as you described in the table above.
o ADD – reg-dest and reg-write are 1 because the added value is stored into a register.
o ADDI – ALU-src and reg-write are 1 because the integer source is from ALU and it is written
to the register.
o LW – mem-2-reg, ALU-src, and reg-write are all 1 because we are loading from memory and
writing it to a register using an integer from ALU as an offset.
o SW – mem-write and ALU-src are 1 because the reg value is written to memory using an
integer ALU offset.
o BEQ – reg-dest, branch, and ALU-op are all set to 1 because if two register values are equal it
branches to a set register destination.
o J – reg-dest and jump are 1 because it jumps to the register given.
b. [Part 1.a] How is the zero flag from the ALU used?
If an operation is output from the ALU that is equivalent to zero, a zero flag is activated which outputs
1 from the zero. That value is anded with the branch output so if they are both 1 then the jumping
process is activated, if either aren’t a 1 then the jump is bypassed.
c. [Part 2] Simulate your processor in ModelSim and run the provided program in imem.mif with the data
in dmem.mif.
The [projectA > ASM Files > test_with_data_seg.asm ] file has the assembly code with data
specified which is equivalent to the given imem/dmem.mif. Before simulating the final design,
just by studying the code, please explain
This program takes an array word which is 1-10 and for each number replaces each number
with its sum up todate until it reaches the end, so it should output:
1,3,6,10,15, 21,28,36,45,55
o Which values will be written on DMEM at the locations of the first 11 words staring from
the address 0.
o Which values will be written on the following registers: $8 (=$t0), $9 (=$t1), $10 (=$t2),
and $16 (=$s0).
2|Page
Provide a screenshot for each of the 6 MIPS instructions to support showing the correct
functionality and explain how the instruction is working in accordance with the screenshot
o ADDI
Adds an immediate value to the value at the address stored in dmem
o ADD
Attach a screenshot & explain
The add instruction takes the data in dmem in rs and adds it to the data in dmem at
rt
3|Page
o LW
Attach a screenshot & explain
Loads a word from the dmem into register file
4|Page
o SW
Attach a screenshot & explain
o BEQ
Attach a screenshot & explain
Branches when alu_op flag equals one. This is the same as the zero flag within the
ALU VHDL code.
5|Page
o J
6|Page
7|Page
8|Page
9|Page
Provide screenshots showing the final values of the dmem and registers
o DMEM (for the first 11 words starting from address 0)
o REGISTERS
10 | P a g e
11 | P a g e