Practice Homework 5 - Computer Organization | ENEE 350, Assignments of Computer Architecture and Organization

Material Type: Assignment; Professor: Franklin; Class: COMPTR ORGANIZATN; Subject: Electrical & Computer Engineering; University: University of Maryland; Term: Fall 2006;

Typology: Assignments

Pre 2010

Uploaded on 07/30/2009

koofers-user-3at
koofers-user-3at 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ENEE 350: Fall 2006
Home Work 5
1. Consider the 2-bus data path given in Chapter 6. Write a sequence of MAL instructions
needed to fetch and execute the following MIPS-extension instruction “sw rt, offset(rs),”
which means “copy the contents of register rt onto memory location whose address is given
by adding offset to the contents of general-purpose register rs”. The fields for the opcode,
rs, and rt are the same as in MIPS formats. However, the offset field is encoded as a
separate 32-bit word after the instruction word holding the opcode, rs, and rt fields.
2. Exercise 6.1 in the class notes.
3. Consider the following data path (which is a modified version of the data path we studied
in class for the MIPS-0 ISA). Consider the following ISA-level instruction, and its associated
meaning. Notice that this instruction uses memory indirect addressing.
sw rt, offset(rs) ; copy the value in register rt to memory location whose address is
; present in memory location {sign extended offset + contents of register rs}
Its encoding is given below.
rs rt offset
Pattern
for SW
Write a sequence of MAL instructions to interpret the above sw instruction using the given
data path. Write comments for each MAL instruction, indicating what it does.
(RF)
File
Register
AOR
AIR
ALU
offset
Main
Memory
IR
+/-
PC
MAR
MDR
ADD AND
ID
CPU
Internal Bus
4
Address Bus
Data Bus
SEXT
1
pf2

Partial preview of the text

Download Practice Homework 5 - Computer Organization | ENEE 350 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

ENEE 350: Fall 2006

Home Work 5

  1. Consider the 2-bus data path given in Chapter 6. Write a sequence of MAL instructions needed to fetch and execute the following MIPS-extension instruction “sw rt, offset(rs),” which means “copy the contents of register rt onto memory location whose address is given by adding offset to the contents of general-purpose register rs”. The fields for the opcode, rs, and rt are the same as in MIPS formats. However, the offset field is encoded as a separate 32-bit word after the instruction word holding the opcode, rs, and rt fields.
  2. Exercise 6.1 in the class notes.
  3. Consider the following data path (which is a modified version of the data path we studied in class for the MIPS-0 ISA). Consider the following ISA-level instruction, and its associated meaning. Notice that this instruction uses memory indirect addressing.

sw rt, offset(rs) ; copy the value in register rt to memory location whose address is ; present in memory location {sign extended offset + contents of register rs}

Its encoding is given below.

Pattern for SW rs rt offset

Write a sequence of MAL instructions to interpret the above sw instruction using the given data path. Write comments for each MAL instruction, indicating what it does.

(RF)

File

Register

AOR

AIR

ALU

offset

Main Memory

IR

+/- PC MAR

MDR

ADD AND

ID

CPU

Internal Bus

4

Address Bus

Data Bus SEXT

  1. Consider a computer system that has a cache with 512 blocks, each of which can store 32 bytes. Which cache set will the memory address 0xFBFC map to: (i) if it is a direct-mapped cache (ii) if it is an 8-way set-associative cache (iii) if it is a fully-associative cache.
  2. Consider a very small 2-way set-associative cache with a total of 2 sets and a block size of 16 bytes. The cache uses an LRU replacement policy. Assume that the cache is initially empty. The CPU access the following memory locations, in that order: c88H, 774H, 79cH, c00H, 784H, c80H, 718H, 738H, 770H, 774H. All addresses are byte addresses. To get partial credit, show clearly what happens on each access. (a) For each memory reference, indicate the outcome of the reference, either “hit” or “miss”. (b) What are the final contents of the cache? That is, for each cache set and each block frame within a set, indicate if the block frame is empty or occupied, and if occupied, indicate the tag of the main memory block that is currently present.
  3. Explain the role played by the CPU control unit in interpreting machine language instructions.
  4. Explain the advantage of using the direct-path based data path, compared to using bus-based data paths.
  5. Explain why we need a hierarchical memory organization at the microarchitecture level.
  6. The CPU in your computer produces 22-bit addresses, with each addressable item being 1 byte. The computer has 16Kbytes of physical memory. The page size is 4 Kbytes. (i) How many bits of the 22-bit address are used to determine the page offset? (ii) How many virtual pages exist? (iii) How many physical pages exist? (iv) How many entries will the page table have?
  7. The physical memory of a computer has only 4 pages. A program references the virtual pages in the order: 0, 120, 50, 120, 20, 121, 0, 120, 50. For each of these references, say if there will be a page fault or not, (a) assuming the LRU replacement policy (b) assuming the FIFO (first-in first-out) replacement policy