Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

CECS 341 FINAL QUESTIONS & ANSWERS (RATED A+)

Document preview thumbnail
Preview 2 out of 7 pages

Calculate the time required to fetch, decode, and execute the ADD instruction. - ANSWERTime for ADD = max{Read I-Mem, Increment PC} + max{Read Rs, Read Rt} + Calculate sum (ALU) + Write result to Rd (Mux, RF) CPIAVG weighted average formula? - ANSWERCPIAVG = (FC1 * CPIC1) + (FC2 * CPIC2) + (FC3 * CPIC3) + (FC4 * CPIC4) [FC1, FC2, etc. are the frequency in the program. should be a percentage) Sequence 2: IC = 4 + 1 + 1 = 6 -Clock Cycles= 4×1 + 1×2 + 1×3= 9 - Avg. CPI = 9/6 = 1.5 Consider the MIPS assembly language program given below. I1: lw $s0, 0($t0) I2: lw $s1, 4($t0) I3: add $s2, $zero, $zero I4: add $s3, $zero, $zero I5: add $s4, $zero, $zero Assumption 1: The MIPS pipelined processor uses a single memory to store both instructionsand data.Assumption 2: Data read and write take precedence over instruction fetch. What type of hazard does this pipelined processor have? - ANSWERResource (structural) hazard due to a single memory used to store both instructions and data Consider the MIPS assembly language program given below. I1: lw $s0, 0($t0)

Content preview

CECS 341 FINAL QUESTIONS &
ANSWERS (RATED A+)

Calculate the time required to fetch, decode, and execute the ADD instruction. -
ANSWERTime for ADD = max{Read I-Mem, Increment PC} + max{Read Rs, Read
Rt} + Calculate sum (ALU) + Write result to Rd (Mux, RF)

CPIAVG weighted average formula? - ANSWERCPIAVG = (FC1 * CPIC1) + (FC2 *
CPIC2) + (FC3 * CPIC3) + (FC4 * CPIC4)

[FC1, FC2, etc. are the frequency in the program. should be a percentage)


Sequence 2: IC = 4 + 1 + 1 = 6
-Clock Cycles= 4×1 + 1×2 + 1×3= 9
- Avg. CPI = 9/6 = 1.5

Consider the MIPS assembly language program given below.
I1: lw $s0, 0($t0)
I2: lw $s1, 4($t0)
I3: add $s2, $zero, $zero
I4: add $s3, $zero, $zero
I5: add $s4, $zero, $zero

Assumption 1: The MIPS pipelined processor uses a single memory to store both
instructionsand data.Assumption 2: Data read and write take precedence over
instruction fetch.

What type of hazard does this pipelined processor have? - ANSWERResource
(structural) hazard due to a single memory used to store both instructions and data

Consider the MIPS assembly language program given below.
I1: lw $s0, 0($t0)
I2: lw $s1, 4($t0)
I3: add $s2, $zero, $zero
I4: add $s3, $zero, $zero
I5: add $s4, $zero, $zero
Space metric - ANSWERAmount of memory required by a program for instructions
and data
aka. Memory footprint.
Not necessarily correlated to the program execution time

What are four time metrics? - ANSWERInstruction Latency, Execution Time (ET),
Throughput, Processor Performance

, Instruction Latency - ANSWERTime required to complete a single instruction.
Includes fetch, decode, and execution of instruction.
Usually measured in seconds.

Execution Time (ET) - ANSWERTime required to complete a program or a code
segment.
Includes fetch, decode, and execution of all instructions.
Usually measured in seconds or seconds per instruction.

Assumption 1: The MIPS pipelined processor uses a single memory to store both
instructionsand data.Assumption 2: Data read and write take precedence over
instruction fetch.

Calculate the total number of clock cycles to execute the given program on this
processor. - ANSWER11 clock cycles.
As can be seen in the figure below, in clock cycle #4, I1 is being processed in the
MEMstage of the pipeline and is reading from data memory. Given that there is only
one memoryavailable, and since data read takes precedence over an instruction
fetch, I4 cannot befetched from memory in this clock cycle. Therefore, I4 is fetched in
clock cycle #6 afterhaving been stalled two clock cycles.

We have a memory system with following specification:
- Main memory size = 1M byte
- Cache size = 128 bytes
- Block size = 8 bytes
- Two-way Set-associative cache (w = 2).

Determine the number of blocks in main memory - ANSWER# blocks in MM = Main
memory size / Block size
# blocks in MM = 1M byte / 8 bytes = 2^^3 = 2^17 = 131072 blocks.

We have a memory system with following specification:
- Main memory size = 1M byte
- Cache size = 128 bytes
- Block size = 8 bytes
- Two-way Set-associative cache (w = 2).

Determine the number of blocks in the cache. - ANSWER# blocks in cache = Cache
size / Block size
# blocks in cache = 128 bytes / 8 bytes = 16 blocks

We have a memory system with following specification:
- Main memory size = 1M byte
- Cache size = 128 bytes
- Block size = 8 bytes
- Two-way Set-associative cache (w = 2).

Determine the number of sets in the cache. - ANSWER# sets in cache = # blocks in
cache / # blocks in each set
# blocks in cache = 16 blocks

Document information

Uploaded on
April 1, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$15.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
nursingismylife
3.6
(38)
Sold
265
Followers
174
Items
9121
Last sold
1 week ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions