UEC702
UEC702
Roll Number:
Thapar Institute of Engineering and Technology, Patiala
Department of Electronics and Communication Engineering
B.E.- Mechatronics Engineering UEC702: MICROCONTROLLER AND
(VIII Semester) MST EMBEDDED SYSTEMS
March 2023
Time: 2 Hours; MM: 25 Name of Faculty: Dr. Ankit
Note:
• Attempt ALL questions. Questions must be attempted in sequence, as given, with all parts in
one place only. Paper is printed on both sides
• All the symbols and abbreviations have usual interpretations. Assume missing data, if any,
suitably.
Q1 Write an assembly program for 8051 microcontroller to generate the periodic (5)
waveform whose one time-cycle is illustrated in Fig. 1. The waveform is to be
generated at pin 5 of port 1. The crystal frequency available to the microcontroller
is 11.0592 MHz.
65 ms
4
45 ms
il----0.
Fig. 1
Q2 Give major differences (at least five) between:
a) RISC and CISC architectures (2.5+2.
b) Von-Neumann and Harvard architectures 5)
Q3 Answer the following questions: (1.5+3.
a) Give the bit wise configuration of the current program status register with a 5)
neat diagram.
b) What are the processor modes available in ARM, write a short note on each.
Q4 Given below are the pseudocodes, convert them into consistent ARM assembly (1.5+1+
language instructions. While writing your answers, wherever applicable, mention 1.5+1)
which variable you have mapped to which register, for instance, A —> 7.0, B --+ rl,
and so on...
a) If (A is even)
B=C+D
Else
B=C—D
b) If (A == B)
C = D OR E
Else
C= D XOR E
c) for (A = 0, A < 5, A + +)
{
B=B+D
}
d) A=2's complement of B
Q5 Find out the output of the following ARM assembly language instructions: (1+1+1.
a) UMULL rO, r1, r2, r3 5+1.5)
Data: r2=Oxda000003, r3=0x00000003.
Find values stored in r0 and rl, after execution of abovementioned code snippet.
b) STMFD sp!, fr1, r5, r7}
Data: r1=0x00000004, r5=0x00000003, r7=Oxda000003, sp=0x00080014
Find the new value of sp, and fill the table, after execution of abovementioned
code snippet:
Address Data
0x00080018 0x00000001
0x00080014 0x00000002
0x00080010 Empty
Ox0008000c Empty
0x00080008 Empty
0x00080004 Empty
c) MOV rO, #0x12
MOV r1, #0x12
MOV r5, #0x01
SUBS r3, r1, r0
BEQ Forward
ADD r5, r5, #0x01
ADD r4, rO, r5
Forward
ADD r4, rO, r5
Find the value stored in r4 after execution of abovementioned code
snippet
d) MOV r8, #0x0fffffff
ADDS r7, r8, #0x01
MOV rO, #0x01
MOV r6, #0x03
RRXS r5, r0
BCS Label
ADD r6, r6, #0x03
Label
ADD r2, r6, #0x03
Find the value stored in r2, after execution of abovementioned code
snippet.