ECS154A Homework #4
- Lab assignment due Sunday, March 1st, 11:59 PM.
- Written homework due by 4:30 PM on Friday, February 27th.
LAB Assignment:
-
- See
lab4.html
WRITTEN Assignment:
- How do subroutine and an interrupt-service routines differ? List at least
5 things that have to be changed in the hardware of a processor in
order to support interrupts.
- Assume you have a 64-bit microprocessor, with a 32 bit external data bus,
driven by a 3.0 GHZ input clock. This microprocessor has a bus cycle whose
minimum duration equals 125 input clock cycles. What is the maximum data
transfer rate that this microprocessor can sustain? To increase its
performance, would it be better to make its external data bus 64 bits or to
double the external clock frequency supplied to the microprocessor? State any
assumptions you make, and explain.
- Assume that in the
Daisy-chained arrangement we discussed in class the processor keeps asserting
BusGrant (BG) as long as BusRequest (BR) is asserted. When
device i is requesting the bus, it becomes the bus master only when it
receives a low-to-high transition on its BusGrant (BGi) input.
a. Assume that devices are allowed to assert the BusRequest signal at any
time. Give a sequence of events to show that the system can enter a deadlock
situation, in which one or more devices are requesting the bus, the bus is
free, and no device can become the bus master.
b. Suggest a rule for the devices to observe in order to prevent this
deadlock situation from occuring.
-
How would the timing in an asynchronous bus be affected if the distance between
the processor and the I/O device is increased? How can this increased distance
be accomodated in the case of a synchronous bus?
-
Draw and explain a timing diagram for a PCI write operation (similar to figure
3.23)
-
Here is a string of hex address references given as byte addresses:
2,1,3,1A,A,1B,16,14,3,10,9,23,3A,5,19,1,9
a. Assuming a direct mapped cache with 16 one-byte blocks that is initially
empty, label each reference in the list as a hit or miss and show the final
contents of the cache tag array. Compute the hit rate for this example.
b. Show the hits and misses and final cache
contents for a direct mapped cache with four-byte blocks (lines) and a *total*
size of 16 bytes. Compute the hit rate for this example.
c. Show the hits and misses and final cache
contents for a two-way set associative cache with one-byte blocks (lines) and a
*total* size of 16 bytes. Assume LRU replacement. Compute the hit rate for
this example.
d. Show the hits and misses and final cache
contents for a fully associative cache with one-byte blocks (lines) and a
*total* size of 16 bytes. Assume LRU replacement. Compute the hit rate for
this example.
e. Show the hits and misses and final cache
contents for a fully associative cache with four-byte blocks (lines) and a
*total* size of 16 bytes. Assume LRU replacement. Compute the hit rate for
this example.
- A set associative cache consists of 40 lines divided into 5-line sets.
(In other words, it is 5-way set associative). Each line is 4 bytes long.
Main memory contains 16K blocks of 64 words each, and a word consists of 4
bytes. Show the format of main memory addresses.
- Consider a memory system that uses a 32-bit address and is byte
addressable, and a cache that uses 64 byte lines.
Assume a direct-mapped cache with a tag field in the address of 17 bits. Show
the address format and determine the following parameters: number of lines in
the cache, the size of the cache, and the size of the tag.
Assume a fully-associative cache. Now how big is the tag?
Assume a 3-way set associative cache with a tag field in the address of 8 bits.
Show the address format and determine the following parameters: number of
lines in the cache, size of the cache, number of lines per set, number of sets
in the cache, and the size of the tag.
-
Consider a machine with a byte addressable main memory of 2^16 (65536) bytes,
which has a direct-mapped cache with 32 lines. Lines are 16 bytes long.
a. How is the 16-bit memory address partitioned by the cache? (In other
words, how big is the tag field, the entry into the line, etc.)?
b. Into what line would bytes with each of the following addresses be stored?
0x111B
0xC334
0xD01D
0xAAAA
c. Suppose the byte with address 0x2B2B is stored in the cache. What are the
addresses of the other bytes stored along with it?
d. How many total bytes of memory can be stored in the cache?
e. Why is the tag also stored in the cache?