Sample_Question_Type
Sample_Question_Type
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.
2) How many bits does a register have in the ARM Cortex-M4 microprocessor?
A. 4 B. 8 C. 16 D. 32 E. 64
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
1
Name: ________________________________________
Tech ID: ________________________________________
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
2
Name: ________________________________________
Tech ID: ________________________________________
18) Assembler convert C code to assembly program .
A. TRUE B. FALSE
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?
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)
void main(void){
A = B + C – D;
}
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
MOV r0, #1
MOV r1, #5
MOV r2, #1
stop B stop
ENDP
END
6
Name: ________________________________________
Tech ID: ________________________________________