0% found this document useful (0 votes)
6 views

Sample_Question_Type

This document is an exam paper for EE 334 Microprocessor Engineering II, consisting of 27 questions divided into multiple choice, true/false, short answer, and long answer formats. It includes instructions for the exam, such as prohibited items and the use of a cheat sheet. The questions cover various topics related to microprocessors and programming concepts.

Uploaded by

sabbir.tamim3
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)
6 views

Sample_Question_Type

This document is an exam paper for EE 334 Microprocessor Engineering II, consisting of 27 questions divided into multiple choice, true/false, short answer, and long answer formats. It includes instructions for the exam, such as prohibited items and the use of a cheat sheet. The questions cover various topics related to microprocessors and programming concepts.

Uploaded by

sabbir.tamim3
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/ 7

Name: ________________________________________

Tech ID: ________________________________________


EE 334 Microprocessor Engineering II
Fall 2018
First-Term Exam (100 points)
Instructions:

1. Please write your name and tech id first in the first page, before you answer any questions.
2. Please check total number of questions before you start your test. There should be 27
questions in total, if you calculated them to find a different total, please let the instructor know
immediately. There are 10 Multiple Choice Questions, 10 True/False, 5 short questions and
two long questions.
3. Talking or consulting to your fellow classmates during the exam is strictly prohibited, if you
have any questions regarding the test, raise your hand and ask them to the Instructor.
4. Usage of laptops, cellphones, smartwatches or any smart devices in the test are not allowed.
However, a scientific calculator is allowed but not necessary for the test.
5. A cheat sheet with both sides written or printed is allowed. You don’t have to submit cheat
sheet after the test.
6. If you finish your exam early, you can submit answer paper to the instructor and leave the
classroom.

First 10 questions are Multiple Choice Questions: (1.5x10=15points)

1) How many bits does a HALFWORD have?


A. 4 B. 8 C. 16 D. 32 E. 64

2) How many bits does a register have in the ARM Cortex-M4 microprocessor?
A. 4 B. 8 C. 16 D. 32 E. 64

3) Which of the following instruction write to the status register?


A. CMP B. BNE C. ADD D. LDR

4) Which of the following instruction read from the status register?


A. CMP B. BLT C. SUB D. STR

5) If the physical memory address has 32 bits, the maximum amount of memory it can access is
A. 4GB B. 4MB C. 1GB D. 2GB

6) How many bytes are required to store the string Hello World! ?
A. 13 B. 23 C. 22 D. 10

7) Relationship of Instruction MOVLT with the status register is?


A. It writes to it B. It reads from it C. It does not read or write to it
D. It read and then write to it

1
Name: ________________________________________
Tech ID: ________________________________________

8) What is the advantage of a recursive function?


A. It is easier to write code for it B. The code for it run faster C. It takes more memory
D. None of the above

9) Which one of the followings is a characteristic of a static variable?


A. It is initialized once B. Its lifetime is across its entire program lifetime C. It can be either
global or local D. All of the above

10) A pipeline stage which produces a result from inputs is called


A. Memory Access B. Execute C. Decode D. Fetch

Following 10 questions are True/False type questions: (1.5x10=15 points)

11) In a C program, a pointer is actually a memory address.


A. TRUE B. FALSE

12) Memory address is always in terms of bytes.


A. TRUE B. FALSE

13) Can a 32 bit processor do an addition of two 64 bit number with the help of status register?
A. TRUE B. FALSE

14) Following sections are C and corresponding assembly program? Is the assembly program correct?
if (a<0) { CMP r1, #0 ; r1 = a, r2 = x
a=0-a; BGE endif
} then RSB r1, r1, #0 ;a = -a
x=x+1 endif SUB r2, r1, #1

A. TRUE B. FALSE

15) The purpose of a Link register is to hold the current address of an instruction.
A. TRUE B. FALSE

16) In Big Endian Machine, the most significant byte is stored in high address.
A. TRUE B. FALSE

17) Register reusing is a programming optimization strategy?


A. TRUE B. FALSE

2
Name: ________________________________________
Tech ID: ________________________________________
18) Assembler convert C code to assembly program .
A. TRUE B. FALSE

19) Memory address is always in terms of bytes.


A. TRUE B. FALSE

20) LDR r1, [r0], #4 is an example pre-indexing?


A. TRUE B. FALSE

Next 5 questions are Short Questions: (5x5=25 points)

21) If a microprocessor can execute 8000 instructions in 1900 cycles. What could be the minimum
number of pipeline stages it can have? Give an example pipeline stages for such processor.

22) Can you combine a CMP (compare) and BEQ (branch if equal) instruction? If yes, how will the new
instruction function?

23) What are the advantages of alignment in the computer memory? When do you need to align your
memory?

3
Name: ________________________________________
Tech ID: ________________________________________
24) What are the differences between a sequence structure and selection structure in higher level
language?

25) What is the output of the following program?

int fun(){
static int n = 473;
n=n+1;
return n;
}
int main(void){
int x;
x=fun();
printf(“%d”, x);
x=fun();
x++;
printf(“%d”, x);

4
Name: ________________________________________
Tech ID: ________________________________________

26) Translate the following C to Assembly and fill out the memory (25 points)

C Program Assembly Program


int A = 0; AREA c, CODE
int B = -1; EXPORT __main
int C = -2; ENTRY
int D = 2; __main PROC

void main(void){
A = B + C – D;
}

AREA d, DATA ; Starting address =


0x2000,0000

ENDP
END

5
Name: ________________________________________
Tech ID: ________________________________________

Data Data
Address Content
(32 bits) (8 bits)
0x2000,000F
0x2000,000E
0x2000,000D
0x2000,000C
0x2000,000B
0x2000,000A
0x2000,0009
0x2000,0008
0x2000,0007
0x2000,0006
0x2000,0005
0x2000,0004
0x2000,0003
0x2000,0002
0x2000,0001
0x2000,0000

27) Translate the following Assembly to C (20 points)

Assembly Program C Program

AREA mysterious, CODE, READONLY


EXPORT __main
ENTRY
__main PROC

MOV r0, #1
MOV r1, #5
MOV r2, #1

loop CMP r2, r1


BGT stop
MULS r0, r2, r0
ADD r2, r2, #1
B loop

stop B stop
ENDP
END

6
Name: ________________________________________
Tech ID: ________________________________________

You might also like