July 20, 2018

Real Time Operating System Importance - Important QnA


Text Books
T1 Liu, Jane W.S., Real Time Systems, Pearson Education, 2000
T2 Laplante, Phillip A., Real-Time Systems Design and Analysis, Wiley, 3rd Ed., 2004
T3 Jared Hendrix, Raspberry Pi: Essential guide on starting your own raspberry pi3 projects with ingenious tips and tricks
T4 Arshdeep Bahga, Vijay Madisetti, Internet Of Things A hands on Approach


 

Question.1
Design a Biometric Facial Authentication device for a small company of 25 employees. The device should be capable of Enrolling and verifying the face. If the face matches then allow access into the company. The enrollment of New Ids should be stored in the organization database server and the ex-employees access should be denied.Draw the block diagram including the Components required for the design.List out the tasks: periodic, aperiodic and sporadic tasks of the system. Which scheduling algorithm should be used. Illustrate the same with an example. 

Answer:

Components required:




Periodic tasks
LCD  display 
Reading data base till match is found or END of database- 

Aperiodic Task
Face sensing through sensor 
Temporary storing of minutiae points from the image 
Matching the temporary image and database image 
Allowing access into organization(ex: opening of gate etc)

Sporadic tasks: None

Clock driven scheduling algorithm using the above parameters.

Question. 2
Consider a task set comprising of 5 tasksT(e,d) T1(13,20), T2(12,30), T3(18,40), T4(15,50) and T5(14,60) to be scheduled on 2 processors. Which scheduling strategy would ensure tasks get an optimal share of resources. The resource actually consumed is 20% (rounded off to the nearest integer). Assume the first task starts at 0.Construct the schedule and obtain the makespan.

 Answer:

The algorithm for Optimal utilization is Uniform Laxity based method as it uniformly dispenses slack improving resource allocation.

Minimum execution time = 20% of Actual execution time
Min 1 =0.2*13=2.6 = 3 (approx)
Min2= 0.2*12=2.4 = 2(approx)
Min3=0.2*18=3.6=4 (approx)
Min4=0.2*15=3(approx)
Min5=0.2*14=2.8=3(approx)

Laxity = (deadline –(current time +minimum execution time))
L1=(20-(0+3))=17
L2=(30-(20+2))=8
L3=(50-(40+3))=7
L4=(60-(50+3))=7
L5=(30-(25+2))=3
Average Laxity=9

Time utilized =Min exec time + Average Laxity
TU1=3+9=12
TU2=2+9=11
TU3=4+9=13
TU4=3+9=12
TU5=3+9=12

Slack Available = WCET-Time Utilised
S1=13-12=1
S2=12-11=1
S3=18-13=5
S4=15-12=3
S5=14-12=2


Makespan on P1= 12+11 = 23 units
Makespan on P2= 13+12+12 = 37 units

Question. 3
Draw petrinet model for vending machine, The machine dispenses two kinds of snack bars – 20c and 15c.
Only two types of coins can be used – 10c coins and 5c coins. The machine does not return any change.


Answer:
3 scenarios can be considered,
  Scenario 1: 
Deposit 5c, deposit 5c, deposit 5c, deposit 5c, take 20c snack bar.

  Scenario 2:
Deposit 10c, deposit 5c, take 15c snack bar.

  Scenario 3:

Deposit 5c, deposit 10c, deposit 5c, take 20c snack bar.


Question. 4
Given seven tasks, A, B, C, D, E, F, and G, construct the precedence graph from the
following precedence relations:.
A → C
B →C B→ D
C →E C→ F
D →F D→ G
Then, assuming that all tasks arrive at time t = 0, have deadline D = 25, and computation
times 2, 3, 3, 5, 1, 2, 5, respectively, modify their arrival times and deadlines to schedule
them by EDF.

Answer:

The precedence graph is shown below:









Question. 5
Let us consider an automatic car body painting machine has two robotic arms R1 and R2. The real time system that is responsible for paint operation has five different processes P1, P2, P3, P4 and P5. The release time and CPU burst time of each process is ri=(7, 5, 4, 2 and 0) and ei=(3, 3, 2, 6 and 6) respectively. The process P1 requires the robotic arm R1 for duration of 1 unit of time and it is required at time 8. Similarly the process P2 and P5 needs another arm R2 at time 6 and 1 respectively. The process P2 and P5 needs those resources for a period of 1 and 4 unit of time respectively. However, the process P4 required both the robotic arm R1 and R2 for a period of 4 and 1.5 unit of time and at 3 and 9 unit of time. The priority of the process varies with its number i.e. P1 has maximum and P5 has minimum priority. Now schedule those processes by considering the priority ceiling protocol. Determine that if there is any process will be blocked because of resource conflict also find the time of block. Also draw the time line diagram illustrating the above example. Assume you have only one CPU and the robotic arm are non-pre-emptible.

Answer:



July 18, 2018

Important QnA on Multimedia Computing - Comprehensive


Text Books

T1 Ze-Nian Li & Mark S. Drew, "Fundamentals of Multimedia", Pearson Education, 2004


Question.1 
Explain the difference between Temporal and Frequency masking.

Answer:
Frequency Masking: When an audio signal consists of multiple frequencies the sensitivity of the ear changes with the relative amplitude of the signals. If the frequencies are close and the amplitude of one is less than the other close frequency then the second frequency may not be heard. 

Temporal masking
  • After the ear hears a loud sound, consisting of multiple frequencies, it takes a further short while before it can hear a quieter sound close in frequency.
  • Temporal Masking accomplished 50% overlap between consecutive transform windows and then relating frequency masking.
  • MPEG Audio encrypts frequency masking by quantizing each filter bank with adaptive values from nearby bands, defined by a look up table.
Question. 2
Consider the following set of protocols (SIP, RTSP, RSVP, RTCP, RTP on top of UDP. If you want to design a protocol stack (control and data plane) for Video‐On‐Demand (VOD) service between client and server, (a) which protocols would you use and why, and (b) in which order would you apply your selected protocols? Explain how the protocol stack of selected protocols would be used ?

Answer:
To design the Video‐On‐Demand service,
RTP protocol : for transmission of the video . RTP/UDP enables real‐time transmission. 
RTCP : The accompanying control protocol for RTP is the RTCP that would allow the receiver to provide feedback to the sender if some parameters need to be adjusted during the streaming session. 
RTSP : Since VOD will use commands such as play, stop, pause, fast forward, rewind, so anyone should use the RTSP protocol because it specifies signaling for completing these control tasks between the client and the server.
RSVP: If an IP level also requires the built-in reservation capabilities of VOD traffic, it is important to enable the RSVP protocol to start integrated Guaranteed Services using the RSVP Reservation Protocol.
 
RSVP to reserve bandwidth for the VOD session. 

Once the resources are reserved, VOD traffic should be transmitted via RTP which is on top of UDP/IP. 


Along with this, RTP RTCP and RTSP should provide (1) RTP (Control) to provide control feedback about the status of traffic and receiver, and (2) controlling the channel through signaling (RTSP) control , Stop, and otherwise control the VOD playback.

Question. 3
Compress the string “DEAF!DEFEATED” using LZW algorithm. Find compression ratio by

supposing that originally the characters are represented in 8-bit (B=66, A = 65, ,., Z = 90, Y = 89, , ! = 33).

Answer:
Input: DEAF!DEFEATED

Previous
Current
Output
Code
String

065
A
068
D
069
E
070
F
084
T
033
!
D
E
068
256
DE
E
A
069
257
EA
A
F
065
258
AF
F
!
070
259
F!
!
D
033
260
!D
D
E



DE
F
256
261
DEF
F
E
070
262
FE
E
A



EA
T
257
263
EAT
T
E
084
264
TE
E
D
069
265
ED
D
End Of File
068



The compressed output is 068 069 065 070 033 256 070 257 084 069 068
Compression ratio = 13/11 = 1.18181

Question:
Compress the string “PROPER_PROPERTY” using LZW algorithm by using codeword of 10 bit. Find compression ratio by assuming that originally the characters are represented in 8-bit (A = 65, B=66... Y = 89, Z = 90,  _ = 95).

Answer

Input: PROPER_PROPERTY
                                               
S
C
Output
Code
String

069
E
079
O
080
P
082
R
084
T
089
Y
_
95
P
R
080
256
PR
R
O
082
257
RO
O
P
079
258
OP
P
E
080
259
PE
E
R
069
260
ER
R
_
082
261
R_
_
P
095
262
_P
P
R



PR
O
256
263
PRO
O
P



OP
E
258
264
OPE
E
R



ER
T
260
265
ERT
T
Y
084
266
TY
Y
NULL
089




The compressed output is 080 082 079 080 069 082 095 256 258 260 084 089