You are on page 1of 2

Capital University of Science and Technology

Department of Electrical Engineering

EE3323 – Microprocessor and Computer Architecture


Mid Term Exam
Semester: Spring 2018 Max Marks: 60
Date: April 18, 2018 Time: 90 Min
Instructors: Dr. Muhammad Faisal Iqbal
Instructions:
• There are Five questions in this paper. Attempt all questions.
• This exam carries 20% weightage towards the final evaluation.
• Use of calculator is not allowed

Name: Reg. No.

Question 1: (CLO - 1) (10 Points)

A small section of byte addressable memory is shown below. Use your knowledge of basic
computer architecture and Add the two 16 bit numbers (The numbers are in 2’s complement
form) specified by addresses 0x1000 and 0x1002 for the following two cases
a) The ISA specifies a big endian format
b) The ISA specifies a little endian format

Address Data
x1005 x0A
x1004 x0B
x1003 x0C
x1002 x11
x1001 x1A
x1000 x0E
x0FFF x25
x0FFE xA2
Question 2: (CLO - 1) (10 Points)
Suppose we have 32 kilobytes of memory. State how many bits are required to address the
memory if (Show your calculations)
a) ISA is bit addressable
b) ISA is byte addressable
c) ISA is 32 bit addressable
d) ISA is 128 bit addressable
Question 3: (CLO - 1) (15 Points)
Consider the following code snippet and answer the questions. (Assume a RISC machine similar
to the one discussed in class with default operand size of 32 bits)
int ar[4];
int i = 0;
while (i < 4){
ar[i] = i;
i++;
}
i = i + 5;
a) Identify local variables and draw the activation record. (5 points)
b) Describe the above code in RISC style assembly assuming the activation record is
already built and SP points to variable i in the memory (10 Points)
Question 4: (CLO - 3) (10 Points)
Explain precisely the effect of the following individual 8086 assembly language instruction on
the ax register and memory location. Compose your answer in one short clear sentence.
a) Xor, ax, ax
b) Mov ax, [4FFFh]
c) Mov [ax], 3FFFh
d) Lea ax, [4FFFh]
Question 5: (CLO -3) (15 Points)
Construct an 8086 assembly program to find the sum of all the even 8-bit numbers stored in
memory locations from 0 to FF16. The final sum should be in the Ax register when the program
finishes

You might also like