Reference no: EM132247766
Computer Organization Assignment -
Instructions -
Explain your answers clearly and be concise. Do not write long essays.
Make sure your answers are legible and your final answer is clearly indicated.
Questions -
1A. Starting with the single cycle implementation of ANNA discussed in class, make necessary modifications to support the jalr instruction. You cannot modify the ALU, register file, or either memory. The other twelve instructions must work in the modified data path.
A. Describe your changes. Your changes may include but are not limited to:
- Adding a mux. Indicate where the mux is located, the inputs to the mux and define a control line.
- Adding an input to existing mux. Indicate the mux that you are adding the control line. Add the new input to the bottom (highest value) of the mux.
- Modifying or adding combinational logic. Potential targets include the branch detection unit, the extension units, and the logic needed to compute the target address. Describe any changes you make in this regard.
Fill in the blanks below:
Connect the output of Src1 from the register file to the __________mux.
Add combination __________ to BranchType that will select the__________input of the PC select mux.
Connect the output of PC+ 1 to the bottom input of ___________mux. The corresponding control line________(name of control line here) will expand to _________ bits with _________ selecting this new input.
Add a mux just before the __________input of the register file. The corresponding new control line is called DestSel: 0 selects ________, 1 selects__________.
B. List the value for each control signal in the ANNA processor when executing the jalr instruction. Include any new control signals defined in part (a).
Opcode
|
Src1 Sel
|
WB Sel
|
Src2 Sel
|
Reg Write
|
OpSel
|
ALUOp
|
Branch Type
|
memEn
|
Mem Write
|
The new field
|
Jalr
|
|
|
|
|
|
|
|
|
|
|
2. Assume that ANNA files can now be assembled into object files and linked. Consider the following ANNA program and answer the following questions. For your convenience, addresses precede each instruction. They are not part of the instruction.
# Code section
0 start: lli r1 &count
1 lui r1 &count
2 lw r2 r1 0
3 lli r3 &total
4 lui r3 &total
5 sw r2 r3 0
6 lli r4 0
7 lli r5 8
8 begin: sub r7 r4 r5
9 bgz r7 &end
10 lli r7 &compute
11 lui r7 &compute
12 jalr r7 r6
13 sw r3 r1 0
14 lli r2 &tally
15 lui r2 &tally
16 lw r3 r2 0
17 addi r3 r3 1
18 sw r3 r2 0
19 addi r4 r4 1
20 bez r0 &begin
21 end: lli r7 &output
22 lui r7 &output
23 jalr r7 r6
24 .halt
25 output: out r3
26 jalr r6 r0
# Data section
27 count: .fill 10
28 total: .fill &score
A. Assuming that all labels are visible, what would be the contents of the entry point table?
B. What would be the contents of the external reference table?
C. What would be the contents of the relocation dictionary?
3. Compilers and Assemblers translate each source file individually to generate object code files. Hence the object files need to be linked together before they can be executed. Theoretically, however, it is possible to skip the linking step and directly have compilers generate the final executable file. What would be the down side of taking the latter approach?
4. What is contained in an activation record?
5. How are two dimensional arrays represented in memory using row-major ordering?
6. In the class example of activation records, we saw that every function's activation record stored the frame pointer value of the previous function's activation record, but not the stack pointer. Why do we not need to store the previous function's stack pointer value?
Attachment:- Assignment File.rar