Homework 5 - Fall-2023
.doc
keyboard_arrow_up
School
San Jose State University *
*We aren’t endorsed by this school
Course
102
Subject
Computer Science
Date
Feb 20, 2024
Type
doc
Pages
2
Uploaded by GrandGrousePerson1016
Homework 5 – Due Dec 05, 2023 at 11.59 pm
Total: 150 points
Problem 1: (30 points) Suppose we have a 4 KB direct-mapped data cache with 4-byte blocks. a) Show how a 32-bit memory address is divided into
tag, index and offset. Show clearly how many bits are in each field. (10 points)
b) How many total bits are there in this cache? (10 points)
c) Consider this address trace:
0x48014554
0x48014548
0x48014754
0x48034760
0x48014554
0x48014560
0x48014760
0x48014554
For this cache, for each address in the above trace, show the tag, index and offset in binary (or hex). Indicate whether each reference is a hit or a miss. What is the miss rate? (10 points)
Problem 2: (30 points)
Suppose we have a 32KB direct-mapped data cache with 32-byte blocks. a) Show how a 32-bit memory address is divided into tag, index and offset. Show clearly how many bits are in each field. (10 points)
b) How many total bits are there in this cache? (10 points)
c) For this cache, for each address in the trace in Problem 1c, show the tag, index and offset in binary. Indicate whether each reference is a hit or a miss. What is the miss rate? (10 points)
Problem 3: (30 points) Suppose we have a 128KB 4-way set-associative data cache with 16-byte blocks. a) Show how a 32-bit memory address is divided into tag, index and offset. Show clearly how many bits are in each field. (8 points)
b) How many total bits are there in this cache? Count only valid, tag and data bits; don’t worry about dirty or LRU bits. (7 points)
Problem 4:
(10 points) Suppose that we want to compare caches in Problems 1 and 2. Let both caches have a hit time of 1 cycle. The cache in Problem 1 has a miss penalty of 20 cycles. The cache in Problem 2 has a miss penalty of 40 cycles. Calculate the total time taken (in cycles) for all accesses for each cache.
Problem 5: (5 points)
Distinguish the following events as (a) interrupts or exceptions, and (b) from where the events occur (external or internal). i)
I/O device request
ii)
Invoke the operating system from the user program
iii)
Arithmetic overflow
iv)
Using an undefined instruction
v)
Hardware malfunctions. Problem 6: (5 points)
i)
What is the basic action the processor must perform when an exception occurs? ii)
To implement the exception system used in the MIPS architecture, what are the two additional registers that we need to add to our MIPS implementation? Describe the two registers. Problem 7:
(10 points)
Show the machine representation for the following MIPS instruction: bgtz $9, check_val
Suppose that the address of the above instruction is 340 (decimal) and the address of the
label check_val (which is present at some other place in the program and is not given
here) is 128 (decimal), compute the offset in (a) bytes (b) words.
Problem 8: (10 points) Compute the (a) transfer time, (b) average rotational latency, and (c) disk access time for
the following input data for a disk? Rotational speed = 7200 rpm, sector size = 0.5 KB, average seek time = 5.7 ms, transfer
rate = 24.5 MB per sec, controller overhead = 1 ms.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
6. For a direct mapped cache comprising 16 single word blocks answer the following
questions. Assume address and word sizes are both 32 bits and that the memory is
byte addressed (4 bytes per 32-bit word). Enter answers as numbers only.
How many index bits are there?
How many offset bits are there?
How many tag bits are there?
arrow_forward
1
arrow_forward
CO. A certain processor uses a fully associative
cache of size 16 kB. The cache block size is
16 bytes. Assume that the main memory is
byte addressable and uses a 32-bit address.
How many bits are required for the Tag and
the Index ticlds respectively in the addresses
generated by the processor?
arrow_forward
For a direct-mapped cache with 64KİB data, 8-word blocks, and 32-bit addresses, answer the
following questions:
a) What is the number of blocks/lines in the cache?
b) Identify the bits in the 32-bit address that are used as index bits?
c) Identify the bits in the 32-bit address that are used as tag bits?
d) What is the total number of bits in this cache (including tag field and valid field)?
e) Identify the block number in the cache to which the following 32-bit memory address
maps:
Ox00003Z00
(Hexadecimal notation)
where Z is the least significant digit in your student ID (written as a decimal number)
arrow_forward
Consider that we have a direct-mapped cache that uses 64-bit addresses. If each word/ block is
128 bits and there are 32K lines in the cache:
(a) (3) What is the total capacity of this cache?
(b) (5) How many bits are used for the tag, index, and word/block offset bits in this address?
arrow_forward
Assume your 32-bit computer (memory address 32-bits) has 16-KB (only L1-data) direct mapped cache.
If the cache line size is 64-Bytes how many bits will be used for tag, index and offset?
If a memory address is 0x00222222, what will be the tag, index and offset for this address (in binary, hex, decimal)?
What will be the total size of cache including tag and V-bit?
arrow_forward
Asap please
arrow_forward
Given that a 4-way set associative cache memory has 64 KB data and each block contains 32 bytes. The
main memory capacity is 4 GB.
a. Find the number of bits for the main memory address. ANSWER:
b. How many blocks are there in a set? ANSWER:
c. How many sets the cache has? ANSWER:
d. The main memory address format is => | Tag:
bits |
blocks
sets
bits | Set:
e. Which set will be mapped by the main memory address 458195h. ANSWER:
decimal)
bits
bits | Word:
(in
arrow_forward
1. For a direct-mapped cache design with a 32-bit address, the following bits of address are used to access the cache.
Tag Index Offset
31-14 13-7 6-0
a. What is the cache block size (in words)?
b. How many entries does this cache have?
c. What is the ratio between total bits required for such a cache implementation over the data storage bits?
arrow_forward
Computer Science
Consider a direct-mapped cache with 8 lines, each holding 16 bytes of data. The cache is byte-addressable and the main memory consists of 64 KB, which is also byte-addressable. Assume that a program reads 16KB of memory sequentially. Answer the following questions:a) How many bits are required for the tag, index, and offset fields of a cache address?b) What is the cache size in bytes?c) What is the block size in bytes?d) What is the total number of blocks in main memory?e) How many cache hits and misses will occur for the program, assuming that the cache is initially empty?f) What is the hit ratio?g) Give an example virtual address (in BINARY) that will be placed in cache line 5.
arrow_forward
Answer part d only
arrow_forward
5.b
arrow_forward
Give me correct solution please.
arrow_forward
Question 6
The IEEE Standard 754 representation of a floating point number
is given as:
01101110110011010100000000000000. Determine the binary value
represented by this number.
a)
A cache system is to be designed to store data from a 1 GB
memory space. If each block of main memory contains 16 words,
determine the number of blocks that are needed and draw the logical
organization of the full address identifying the block ID portion and the
word (offset) portion.
b)
c) Discuss the advantages of using glass substrate over aluminum
substrate in the construction of the hard drive.
arrow_forward
For a direct-mapped cache design with a 32-bit address, the following bits of the address are used to access the cache. We assume that each word has 4 bytes.
How many words of data are included in one cache line?
arrow_forward
For a direct-mapped cache design with a 32-bit address, the following bits of the address are used to access the cache.
a. What is the cache block size in words?
b. How many entries does the cache have?
Tag
31-13
Index
12-6
Offset
5-0
arrow_forward
For a direct-mapped cache design with 32-bit addresses and 32-bit words (data and
instructions). the following bits of the address are used to access the cache: Tag = [31:17],
Index = [16:5], Offset = [4:0].
a.) What is the cache block size in 32-bit words.
b.) How many blocks does the cache have?
c.) What is the size of the cache in kilobytes?
arrow_forward
5. suppose a computer using fully associative cache has 224 bytes of byte-addressable main memory and a cache of 128 blocks, where each cache block contains 64 bytes.
a) how many blocks of main memory are there?
b) what is the format of a memory address as seen by the cache ; that is, what are the size of the tag and offset field.
c) To which cache block will the memory address 0x01D872 map?
arrow_forward
Consider a cache with 32KİB data, 16-word blocks, and 24-bit addresses, answer the following
questions:
a) For the direct-mapped configuration, determine the number of index bits and tag bits in
the 24-bit address.
b) For 4-way set associative configuration, determine the number of index bits and tag bits in
the 24-bit address.
c) For fully associative contiguration, determine the number of index bits and tag bits in the
24-bit address.
d) For an 8-way set associative configuration, identify the set number in the cache to which
the following 24-bit memory address maps:
Ox001Z00
(Hexadecimal notation)
where Z is the least significant digit in your student ID (written as a decimal number)
arrow_forward
Assume you have a 8-way set associative cache having 16K lines each having capacity of 8 Bytes. A Byte addressable main memory uses 32 bit physical address. The cache has a hit ratio of 90% and is initially empty. (a) How many data Bytes are brought into the cache with physical address FAB12389 (in hex)
(b) Which set does the data that is brought in go to if the physical address FAB12389 (in hex) is supplied to the cache?
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- 6. For a direct mapped cache comprising 16 single word blocks answer the following questions. Assume address and word sizes are both 32 bits and that the memory is byte addressed (4 bytes per 32-bit word). Enter answers as numbers only. How many index bits are there? How many offset bits are there? How many tag bits are there?arrow_forward1arrow_forwardCO. A certain processor uses a fully associative cache of size 16 kB. The cache block size is 16 bytes. Assume that the main memory is byte addressable and uses a 32-bit address. How many bits are required for the Tag and the Index ticlds respectively in the addresses generated by the processor?arrow_forward
- For a direct-mapped cache with 64KİB data, 8-word blocks, and 32-bit addresses, answer the following questions: a) What is the number of blocks/lines in the cache? b) Identify the bits in the 32-bit address that are used as index bits? c) Identify the bits in the 32-bit address that are used as tag bits? d) What is the total number of bits in this cache (including tag field and valid field)? e) Identify the block number in the cache to which the following 32-bit memory address maps: Ox00003Z00 (Hexadecimal notation) where Z is the least significant digit in your student ID (written as a decimal number)arrow_forwardConsider that we have a direct-mapped cache that uses 64-bit addresses. If each word/ block is 128 bits and there are 32K lines in the cache: (a) (3) What is the total capacity of this cache? (b) (5) How many bits are used for the tag, index, and word/block offset bits in this address?arrow_forwardAssume your 32-bit computer (memory address 32-bits) has 16-KB (only L1-data) direct mapped cache. If the cache line size is 64-Bytes how many bits will be used for tag, index and offset? If a memory address is 0x00222222, what will be the tag, index and offset for this address (in binary, hex, decimal)? What will be the total size of cache including tag and V-bit?arrow_forward
- Asap pleasearrow_forwardGiven that a 4-way set associative cache memory has 64 KB data and each block contains 32 bytes. The main memory capacity is 4 GB. a. Find the number of bits for the main memory address. ANSWER: b. How many blocks are there in a set? ANSWER: c. How many sets the cache has? ANSWER: d. The main memory address format is => | Tag: bits | blocks sets bits | Set: e. Which set will be mapped by the main memory address 458195h. ANSWER: decimal) bits bits | Word: (inarrow_forward1. For a direct-mapped cache design with a 32-bit address, the following bits of address are used to access the cache. Tag Index Offset 31-14 13-7 6-0 a. What is the cache block size (in words)? b. How many entries does this cache have? c. What is the ratio between total bits required for such a cache implementation over the data storage bits?arrow_forward
- Computer Science Consider a direct-mapped cache with 8 lines, each holding 16 bytes of data. The cache is byte-addressable and the main memory consists of 64 KB, which is also byte-addressable. Assume that a program reads 16KB of memory sequentially. Answer the following questions:a) How many bits are required for the tag, index, and offset fields of a cache address?b) What is the cache size in bytes?c) What is the block size in bytes?d) What is the total number of blocks in main memory?e) How many cache hits and misses will occur for the program, assuming that the cache is initially empty?f) What is the hit ratio?g) Give an example virtual address (in BINARY) that will be placed in cache line 5.arrow_forwardAnswer part d onlyarrow_forward5.barrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning