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 3 out of 17 pages
Exam (elaborations)

CSE 140 Questions and Answers Updated 2026

Document preview thumbnail
Preview 3 out of 17 pages

CSE 140 Questions and Answers Updated 2026

Content preview

CSE 140 Questions and
Answers Updated 2026
for(iB=B0;BiB<B100;Bi++)

{

sum+=A[i];

}



$s0B=B&A

$v0B=BsumB-BAnswerBaddB$t0,B$t0,B$zeroB#letBiB=B0

addiB$t1,B$zero,B100B#tempB=B100

LOOP:BlwB$t3,B0($s0)B#temp1B=BA[i]

addB$v0,B$v0,B$t3B#sumB+=Btemp1

addiB$s0,B$s0,B4B#addrBofBA[i+1]

addiB$t0,B$t0,B1B#iB=Bi+1

bneB$t1,B$t0,BLOOPB#ifBiB<B100



ToBimplementBtheBfollowingBCBcode,BwhatBareBthe

instructionsBthatBweBshouldBputBinBtheBbox?



for(iB=B0;BiB<B100;Bi++)

A[i]B=Bi;



addB$t0,B$zero,B$zero

addiB$t1,B$zero,B100

LOOP:B??

??

addiB$t0,B$t0,B1

,beqB$t0,B$t1,BLOOPB-BAnswerBswB$t0,B0($s2)

addiB$s2,B$s2,B4



WhichBofBtheBfollowingBisBNOTBcorrectBaboutBtheseBtwo

ISAs?

A.Bx86BprovidesBmoreBinstructionsBthanBMIPS

B.Bx86BusuallyBneedsBmoreBinstructionsBtoBexpressBaBprogram

C.BAnBx86BinstructionBmayBaccessBmemoryBforB3Btimes

D.BAnBx86BinstructionBmayBbeBshorterBthanBaBMIPSBinstruction

E.BAnBx86BinstructionBmayBbeBlongerBthanBaBMIPSBinstructionB-
BAnswerBB.Bx86BusuallyBneedsBmoreBinstructionsBtoBexpressBaBprogram



AssumeBthatBweBhaveBanBapplicationBcomposedBwithBaBtotalBofB500000

instructions,BinBwhichB20%BofBthemBareBtheBload/storeBinstructionsBwithBan

averageBCPIBofB6Bcycles,BandBtheBrestBinstructionsBareBintegerBinstructions

withBaverageBCPIBofB1Bcycle.BIfBtheBprocessorBrunsBatB1GHz,BhowBlongBis

theBexecutionBtime?

A.B500000Bns

B.B1000000Bns

C.B1750000Bns

D.B3500000Bns

E.BNoneBofBtheBabove

500000B-BAnswerBB.B1000000Bns



500000B*B(0.8*1+0.2*6)B*B1BnsB=B1000000Bns



http://cseweb.ucsd.edu/classes/su12/cse141-a/slides/Performance_20120809.pdf

, •BAssumeBthatBweBhaveBanBapplicationBcomposedBwithBaBtotalBofB500000

instructions,BinBwhichB20%BofBthemBareBtheBload/storeBinstructionsBwith

anBaverageBCPIBofB6Bcycles,BandBtheBrestBinstructionsBareBinteger

instructionsBwithBaverageBCPIBofB1Bcycle.

•BIfBweBdoubleBtheBclockBrateBtoBbeB2GHzBwithoutBimproveBthe

memoryBlatency,BtheBaverageBCPIBforBload/storeBinstructionBwillBalso

beBdoubledBtoB12Bcycles.BWhat'sBtheBperformanceBimprovementBafter

thisBchange?

A.BNoBchange

B.B1.25

C.B1.5

D.B2

E.BNoneBofBtheBaboveB-BAnswerBB.B1.25



ETnewB=B500000B*B(0.8*1+0.2*12)B*B0.5BnsB=B800000Bns

SpeedupB=BETold/ETnew=1000000/800000B=B1.25



http://cseweb.ucsd.edu/classes/su12/cse141-a/slides/Performance_20120809.pdf



WhyBdoesBanBIntelBCoreBi7B@B2.8BGHzBusually

performBbetterBthanBanBIntelBCoreB2BExtremeB@B3.2

GHzBorBAMDBPhenomBIIBX4@3.4GHz?

A.BBecauseBtheBinstructionBcountBofBtheBprogramBareBdifferent

B.BBecauseBtheBclockBrateBofBPhenomBIIBisBhigher

C.BBecauseBtheBCPIBofBCoreBi7BisBbetter

D.BBecauseBtheBclockBrateBofBPhenomBIIBisBhigherBandBCPIBofBCoreBi7BisBbetter

E.BNoneBofBtheBaboveB-BAnswerBC.BBecauseBtheBCPIBofBCoreBi7BisBbetter

Document information

Uploaded on
August 15, 2026
Number of pages
17
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$11.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

Sold
6
Followers
0
Items
2902
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