Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Department of Electrical Engineering,

Indian Institute of Technology Patna


Autumn-2023
Quiz 1
Embedded System-EE512 Time: 45 Minutes
Name: Roll No.:
Q 1: Given an ARM Cortex-M microcontroller with a clock frequency of 50 MHz, calculate
the time it takes to execute a sequence of 50 ARM instructions. If the average number of
clock cycles per instruction is 4, what is the total execution time in microseconds? 4
Solution: Given:
• Clock frequency = 50 MHz
• Number of instructions = 50
• Average clock cycles per instruction = 4
To calculate the total execution time in microseconds, use the formula:
Execution Time (μs) = (Number of Instructions) × (Average Clock Cycles per Instruction) /
(Clock Frequency)
Execution Time = (50 instructions) × (4 cycles/instruction) / (50,000,000 cycles/s) = 4 μs
So, the total execution time is 4 microseconds.

Q: 2 A temperature sensor outputs an analog voltage between 0V and 5V, which corresponds
to a temperature range of -40°C to 85°C. If the sensor has a resolution of 10 bits, calculate the
temperature resolution in degrees Celsius per bit. 4
Solution: Given:
• Voltage range = 0V to 5V
• Temperature range = -40°C to 85°C
• Resolution = 10 bits
To calculate the temperature resolution per bit, you need to find the temperature range
covered by each bit.
Temperature Range per Bit = (Maximum Temperature - Minimum Temperature) /
(2^Resolution) Temperature Range per Bit = (85°C - (-40°C)) / (2^10) = 125°C / 1024 =
0.1221°C/bit
So, the temperature resolution per bit is approximately 0.1221 degrees Celsius per bit.

Q: 3 Write an ARM assembly code snippet to add two 32-bit integers located at memory
addresses 0x2000 and 0x2004 and store the result in memory location 0x2008. 5
Solution: LDR R0, [0x2000] ; Load the first 32-bit integer from memory into R0
LDR R1, [0x2004] ; Load the second 32-bit integer from memory into R1
ADD R2, R0, R1 ; Add the contents of R0 and R1 and store the result in R2
STR R2, [0x2008] ; Store the result in memory location 0x2008
This code first loads the two integers from memory into registers, adds them together, and
then stores the result back into memory.
Q: 4 Consider a 5-stage pipeline without any conditional instruction. The delays for these
stages are 5 ns, 7 ns, 10 ns, 8 ns and 6 ns respectively. Consider the delay of the intermediate
buffers as 1 ns. There are 12 instructions in a program which is to be executed using the
pipelined processor. Compute the total time taken by this program to complete. Also,
compute the maximum clock frequency at which the processor can operate. Also, compute
the speed and throughput improvement in case of pipelining against non-pipeline. 7
Q'" L -I-"'{ql h*v- 1-W LY -fl"nr ?*drqna'{., GrnP\e*-
ra = [--r)+ru] c

L= JJ4 &".+ =W +b,,fr4,^ e4


U
a- a^^+L
z/ LDfu,-L qn =
t-
wta,Y
,r
I A' I
*l i', & sa-2n
'L'- lo*\= \\ns

So, a( + rz] ' r


-- tlr- t) r

;.- \n r,?*l;",7
M \^ru1 docK F*'* ?
^*rr^
| | - 1o,1o M ttz-
' -c.-=- t rT-taq
€=

tn
S f ee"l. i -r f rnlv\ ""al
Tmr.- -{o.f6^4 ir, ltcn - ? t ? e-h^t- ?^roc'atnr

(/
{qz = e.11r[* 4,.,{f)
-1 16tr
-- "/
c-,*$,n" b'"#,^- r,^

-T""- J.aK^^ u^:\ *t^u# Pi g ah'^-


\-^"L -rJ X t"J') ih a\l vt"y. + o^|'l--J"i"vf
= To-l*\ i ^l
+r)+tt+rJ+t6+r!
Yo" cs" a'(s" 1 r-trrou
ll+
il k\
nn\"[6+8+\l,t-q+1J
: lzxq', qqLn)
t
(l^fi^

-fi..^4^f *.^f *r.rr lv =63.(8


Qfroffl-"'f -- -'-J
TJo = (te x ;;1 ru

You might also like