Sie sind auf Seite 1von 5

Birla Institute of Technology and Science Pilani, Hyderabad Campus

I Semester 2019-2020
EEE G512
Embedded System Design
Mid Semester Examination (Closed Book)
Time: 1hr. 30 min. Date: 30-09-2019 MM: 60

8. How many times the instruction CPL A is executed in the


(NOTE: The question paper consists of two parts (PART- following program of an 8051?
A and PART-B) and two printed pages. Both the parts are MOV A, #F0H
mandatory. PART-A Q1 to Q15: Every correct answer 60x10H
MOV R1, #60
carries +2 marks and every incorrect answer carries -1 mark;
NEXT: MOV R6, #10H
All the answers should be written with pen in CAPITALS in 60x16=960
AGAIN: CPL A
the main answer sheet together. Any
DJNZ R6, AGAIN
overwriting/ambiguity/answers written somewhere else (if not
found together) will be awarded 0 marks. PART-B consists DJNZ R1, NEXT
of 9 questions Answer to the point with all necessary a) 600 times b)900 times c)690 times d)960 times
explanations.) 9. When a procedure call is made in ARM, the return
address is automatically placed into
ID No.: Name:
a) R15 b) R13 c) R12 d) None
10. Which of the following statements is TRUE with respect
PART A [15 x 2 = 30]
to an ARM processor?
1. In 8051, which interrupt has the highest priority a) ARM has higher code density compared to THUMB
a) IE1 b) TF0 c) IE0 d) TF1 b) THUMB code uses up to 30% more power than ARM
code
2. Match the following:
1) TCON i) contains status information c) THUMB code, on an average, requires 30% less
2) SBUF ii) timer / counter control register. space
3) TMOD iii) idle bit, power down bit d) THUMB has three address formats
4) PSW iv) serial data buffer for Tx and Rx. 11. If the initial register contents of R0, R1 and R2were
5) PCON v) timer/ counter modes of operation. R0= 0x00000000
a) 1-ii, 2-iv, 3-v, 4-i, 5-iii. b) 1-i, 2-v, 3-iv, 4-iii, 5-ii. R1= 0x02040608
c) 1-v,2-iii,3-ii, 4-iv,5-i. d) 1-iii, 2-ii, 3-i, 4-v, 5-iv. R2= 0x10305070
3. Serial port interrupt is generated, if ____ bits are set Assume R0 is the result register, after one of the
a) IE b) RI, IE c) IP, TI d) RI, TI operations below was performed on R1 and R2, which
4. Which of the following instruction perform jump indirect has been modified to R0 = 0x12345678. What was the
relative to DPTR operation performed on the contents of R2 and R1?
a) JMP A+DPTR b) JMP DPTR a) AND b) ORR c) BIC d) MUL
c) JMP @A+DPTR d) SJMP A+DPTR 12. If an instruction takes 3 cycles for execution, then how
5. If RS0 = 1 and RS1 = 0, the register bank address range is many cycles are needed for executing4 instructions of the
a) 00H-07H b) 08H-0FH same type in a sequence using a 3-stage pipeline? Assume
c) 10H-17H d) 18H-1FH that there are no interrupts or exceptions while executing
them.
6. How many times the ‘RL’ instruction needs to be a) 12 b) 6 c) 9 d) 4
executed, in order to mimic the ‘SWAP’ instruction in an
13. Which of the following instruction ignores Operand1
8051 microcontroller?
a) 28 b) 30 c) 26 d) 24 a) MOV b) MUL c) ADD d) SUB
14. The fastest data access is provided using _______.
7. What can one infer from the instruction ‘MOV TMOD,
#02H’ in an 8051 microcontroller? a) Caches b) DRAMs c) SRAMs d) Registers
a) Set Timer 1 in 13-bit timer operating mode 15. Probability of a system working correctly after n time
b) Set Timer 0 in 13-bit timer operating mode units after error occurred is considered as
c) Set Timer 1 in 8-bit auto reload timer mode a) Reliability b) Availability
d) Set Timer 0 in 8-bit auto reload timer mode c) Maintainability d) None
PART B [30]
1. The following program generates a square wave on pin P1.5 Using timer 1. Find the frequency. Consider XTAL =
11.0592 MHz. [2]
MOV TMOD, #10H
AGAIN: MOV TL1, #26H
MOV TH1, #71H
SETB TR1
BACK: JNB TF1, BACK
CLR TR1
CPL P1.5
CLR TF1
SJMP AGAIN
ANS:
2. Determine the contents of the top of the stack and the value of the stack pointer (SP) after the following instructions are
executed in an 8051. [2]
MOV SP, #6FH
MOV R1, #10H
MOV R6, #0FH
MOV 3, #03H
MOV 2, #FFH
PUSH 3
PUSH 2
PUSH 1
PUSH 6

ANS: SP= 6FH + 04H(4 push operations)+1 =74H

Top of Stack is (PUSH 1)= 03H

3. Fill the blanks in the following program to generate a square wave of frequency 20 KHz at port P1, if the signal of
frequency 40 KHz is applied at INT1 pin of 8051. [5]
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN: ---------------------------
---------------------------
HERE: SJMP HERE
END
ISR:
------------------------
------------------------
------------------------
------------------------
3. Write the correct chronological order for the generation of 2 kHz square wave frequency in an 8051?
[3]
1. MOV TMOD, #00000010B 4. SETB TR0
2. MOV TL0, #06H 5. CPL P1.0
3. MOV TH0, #06H 6. ORG 0000H

Ans:_____ 6, 1, 3, 2, 4, 5_______
4. What are the contents of R0 and the value at location pointed to by R0? [2]
MOV 45, #4FH
MOV R0, 45H
INC R0
MOV @R0, #30H

ANS:
5. Using only two instructions, add a 64-bit integer contained in R2 and R3 to another 64-bit integer contained in R0
and R1, and place the result in R4 and R5. [2]

ANS: ADDS R4, R0, R2 ;


ADCS R5, R1, R3 ; / ADC R5, R1, R3 ;

6. Assume that the starting location is 0x00000020, indicate the memory locations along with the contents clearly till
the valid known data is present [5]
DATA DCW 0x44
ALIGN 4
DCW 0x33
ALIGN 2
DCD 0x12345678
DCB 0xFF
ANS:

7. Fill the blanks to get the result as 000D819E in R3


LDR R2, = -4215 [2]
LDR R1, = - 210
---------------------
ANS:

8. Give two equivalent instructions of implementing Empty Descending stack in ARM by showing PUSH and POP
operations for data of size 256 bytes. Clearly mention the data and the memory used in a neat diagram.
[4]
ANS:
9. Convert the following pseudo code into ARM Assembly code by clearly writing the comments. [3]

int R1 = -20;
int R2 = -30;
while (R2<=0)
{
R1- = R2;
R1+=1;
}

**********************************************

Das könnte Ihnen auch gefallen