0% found this document useful (0 votes)
74 views2 pages

1 B Solution COAL - Midterm

The document contains solutions to 4 questions from a midterm exam on machine architecture. Question 1 involves calculating MIPS rates for two machines, Machine A and Machine B. Machine B has the higher MIPS rate and is therefore better. Question 2 involves calculating the MIPS rate of a machine based on instructions performed and clock frequency. Question 3 shows stack and accumulator architectures for performing common arithmetic operations. Question 4 provides the step-by-step workings for two bitwise operations, AND and RCL, on two hexadecimal values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views2 pages

1 B Solution COAL - Midterm

The document contains solutions to 4 questions from a midterm exam on machine architecture. Question 1 involves calculating MIPS rates for two machines, Machine A and Machine B. Machine B has the higher MIPS rate and is therefore better. Question 2 involves calculating the MIPS rate of a machine based on instructions performed and clock frequency. Question 3 shows stack and accumulator architectures for performing common arithmetic operations. Question 4 provides the step-by-step workings for two bitwise operations, AND and RCL, on two hexadecimal values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Solution

Midterm Examination Fall 2022


Q. 1

Part (a)

For Machine A

(3*6 + 4*3 + 5*2 + 5*6) / 17 = 70 / 17 = 4.11

100 THz / ( 4.11 * 106 ) = 24.28 * 106

For Machine B

(2*10+4*6+6*2+4*2) / 20 = 64 / 20 = 3.2

100 THz / ( 3.2 * 106 ) = 31.25 * 106

Part (b)

Machine B is better because of its higher MIPS rate

Q. 2

Part (a)

(35*2 + 40*1 + 20*4 + 5*3) / 100 = 205 / 100 = 2.05

(100,000) * 2.05 * (1/f) = 69.87 * 106 / (50 *106 Hz)

Part (b)

1 / [(1 – 0.4) + (0.4/8)] = 1 / [(0.6) + (0.4/8)]

Page 1 of 2
Q. 3
F= R(C+D) – (RA+B)

Stack Architecture Accumulator Set General Purpose Register

PUSH A LDA R LOAD S, R


PUSH R MUL A MUL S, A
MUL ADD B ADD S, B
PUSH B
STA S LOAD F, C
ADD
PUSH D LDA C ADD F, D
PUSH C ADD D MUL F, R
ADD MUL R SUB F, S
PUSH R SUB S
MUL STA F
SUB
POP F

Q. 4
Initial Values:
DH = (6B)16
AH = (CB)16
CF = 1,
CL = 5
Instructions:
AND DH,AH
RCL DH, CL.

Solution:

CL CF DH
Starting 5 1 0 1 1 0 1 0 1 1
AND 4 0 0 1 0 0 1 0 1 1
RCL 3 0 1 0 0 1 0 1 1 0
2 1 0 0 1 0 1 1 0 0
1 0 0 1 0 1 1 0 0 1
0 0 1 0 1 1 0 0 1 0

***END**

Page 2 of 2

You might also like