0% found this document useful (0 votes)
7 views5 pages

Midterm Questions Answers

Uploaded by

mstftrgt00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Midterm Questions Answers

Uploaded by

mstftrgt00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Name Surname: DATE: 14.11.

2022

Number:

CELAL BAYAR ÜNİVERSİTESİ

MÜHENDİSLİK FAKÜLTESİ, BİLGİSAYAR MÜHENDİSLİĞİ

CSE 3131, COMPUTER ORGANIZATION, MIDTERM EXAM

Question #1: (10p)

What does algorithm affect in terms of performance of computer and how? Please explain.

Answer #1:

Question #2: (10p)

Computer A has an overall CPI of 1.3 and can be run at a clock rate of 600 MHz.Computer B
has a CPI of 2.5 and can be run at a clock rate of 750 Mhz. We have a particular program we
wish to run. When compiled for computer A, this program has exactly 100,000 instructions.
How many instructions would the program need to have when compiled for Computer B, in
order for the two computers to have exactly the same execution time for this program?

Answer #2: (10p)

(CPUTime)A = (Instruction count)A * (CPI)A * (Clock cycle Time)A=


(100,000)*(1.3)/(600*10^6) ns

(CPUTime)B = (Instruction count)B * (CPI)B * (Clock cycle Time)B= (I)B*(2.5)/(750*10^6) ns

Since (CPUTime)A = (CPUTime)B,we have to solve for (I)B and get 65000.

Question #3: (15p)

Given the bit string 0x40500000, what floating point number does it represent?
Answer #3: (15p)

Writing this as a bit string gives us: 0 10000000 10100000000000000000000

We see that this is a positive, normalized number. exp = 128 − 127 = 1

So, this number is:

Question #4: (20p)

Assume that A is a 10-integer array whose starting address is in register $s0. The values 1 to
10 are stored in A in ascending order. Assume that B is another 10-integer array whose
starting address is in register $s1. $s0 and $s1 contain the values 1000 and 2000
respectively. Consider the following MIPS code:

a. What are the contents of $t0, $t1, $t2, $t3 at the end of the program above?

b. What are the contents of arrays A and B at the end of the program?

c. How many instructions were executed in total?

d. Does the above code correspond to accessing arrays using indices or using pointers?

Answer #4: (20p)

Question #5: (25p)

We want to implement the following C-language code segment in MIPS assembly using a
JumpTable. Assume a is in $s0, b is in $s1, and c is in $s2.
What is the compiled MIPS assembly code for the above code segment? Assume that the
base of the JumpTable is in register $t4.

Answer #5:

Question #6: (20p)

a) The part of machine level instruction, which tells the central processor
what has to be done, is:
1) Operation code
2) Address
3) Locator
4) Flip-Flop
5) None of the above

b) The minimum number of MIPS assembly instructions needed to write A[i] =


A[i] + 100, where A is an integer array with base saved in $s0, is
______________ instruction(s).
a) one b) two c) three d) five e) six
c) The MIPS instruction lui can be equivalent to an addi instruction followed
by an ______________ instruction?

a) sll b) srl c) sra d) all the previous e) none of the mentioned

d) Which part of the computer is directly invoked in executing the


instructions of the computer program?

1) main storage
2) secondary storage
3) printer
4) processor
5) scanner

e) The destination in a MIPS arithmetic instruction is ______________.

a) a memory location b) a register c) the stack d) the instruction

Answer #6:
a) 1) Operation code
b) c) three
c) a) sll
d) 4) Processor
e) b) register

LO LO LO LO
1 LO2 3 LO4 5 LO6 7 LO8 LO9
Q1 X
Q2 X
Q3 X X
Q4 X X
Q5 X X X
Q6 X X X

You might also like