Transposing the rows and columns of a matrix is an importantproblem in signal processing and scientific computingapplications. It is also interesting from a locality point of viewbecause its reference pattern is both row-wise and columnwise.For example, consider the following transpose routine:1 typedef int array[2][2];23 void transpose1(array dst, array src)4 {5 int i, j;67 for (i = 0; i < 2; i++) {8 for (j = 0; j < 2; j++) {9 dst[j][i] = src[i][j];10 }11 }12 }Assume this code runs on a machine with the followingproperties:sizeof(int) = 4.The src array starts at address 0 and the dst array startsat address 16 (decimal).There is a single L1 data cache that is direct-mapped, writethrough,and write-allocate, with a block size of 8 bytes.The cache has a total size of 16 data bytes and the cache isinitially empty.Accesses to the src and dst arrays are the only sourcesof read and write misses, respectively.A. For each row and col , indicate whether the access tosrc[row][col] and dst[row][col] is a hit (h) or a miss(m). For example, reading src[0][0] is a miss andwriting dst[0][0] is also a miss.dst array src arrayCol. 0 Col. 1 Col. 0 Col. 1Row 0 m _____ Row0 m _____Row 1 _____ _____ Row 1 _____ _____B. Repeat the problem for a cache with 32 data bytes.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Transposing the rows and columns of a matrix is an important
problem in signal processing and scientific computing
applications. It is also interesting from a locality point of view
because its reference pattern is both row-wise and columnwise.
For example, consider the following transpose routine:
1 typedef int array[2][2];
2
3 void transpose1(array dst, array src)
4 {
5 int i, j;
6
7 for (i = 0; i < 2; i++) {
8 for (j = 0; j < 2; j++) {
9 dst[j][i] = src[i][j];
10 }
11 }
12 }
Assume this code runs on a machine with the following
properties:
sizeof(int) = 4.
The src array starts at address 0 and the dst array starts
at address 16 (decimal).
There is a single L1 data cache that is direct-mapped, writethrough,
and write-allocate, with a block size of 8 bytes.
The cache has a total size of 16 data bytes and the cache is
initially empty.
Accesses to the src and dst arrays are the only sources
of read and write misses, respectively.
A. For each row and col , indicate whether the access to
src[row][col] and dst[row][col] is a hit (h) or a miss
(m). For example, reading src[0][0] is a miss and
writing dst[0][0] is also a miss.
dst array src array
Col. 0 Col. 1 Col. 0 Col. 1
Row 0 m _____ Row0 m _____
Row 1 _____ _____ Row 1 _____ _____
B. Repeat the problem for a cache with 32 data bytes.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY