Which of the following is the function of the semantic analysis phase of compilation process?
Compiler phases:
Lexical analysis → Tokenization
Syntax analysis → Parsing
Semantic analysis → Type checking, type conversion, scope checking
Optimization → Loop optimization, data flow analysis
Thus type conversion belongs to semantic analysis.
IP is responsible for ______ communication while TCP is responsible for ______ communication.
In the TCP/IP model:
• IP (Internet Protocol) provides host-to-host communication between devices.
• TCP (Transmission Control Protocol) provides process-to-process communication using port numbers.
The Boolean expression for the following would be:
$F(A,B,C) = \Sigma(0,2,6)$
$d(A,B,C) = \Sigma(1,3,5)$
Minterms:
$0 = 000$
$2 = 010$
$6 = 110$
Don't care terms:
$1 = 001$
$3 = 011$
$5 = 101$
Using K-map simplification:
Group $(0,2)$ → $A'C'$
Group $(2,6)$ → $BC'$
Thus,
$F = A'C' + BC'$
Factorizing:
$F = C'(A' + B)$
Which simplifies to:
$F = A' + BC'$
A computer system with cache access time of 100 ns, a main memory access time of 1100 ns, and a hit ratio of 0.9. The average access time would be:
Average Memory Access Time:
$AMAT = Hit\ Time + Miss\ Rate \times Miss\ Penalty$
Hit time = 100 ns
Miss rate = $1 - 0.9 = 0.1$
Miss penalty = $1100 - 100 = 1000$
So,
$AMAT = 100 + 0.1 \times 1000$
$AMAT = 100 + 100 = 200\ ns$
Services provided by point-to-point protocol (PPP):
A. frame format
B. establishment of the link
C. flow control
D. sequence numbering
E. authentication
PPP provides:
• Frame format
• Link establishment (LCP)
• Authentication (PAP, CHAP)
PPP does not provide flow control or sequence numbering.
Thus:
A → Yes
B → Yes
E → Yes
In Windows scheduling, which of the following option is correct?
Windows uses 32 priority levels:
• 0–15 → Non-real-time (variable priorities)
• 16–31 → Real-time priorities
Thus number of non-real-time priorities = 16.
Which of the following is/are true in case of tree locking?
A. It ensures shorter waiting times.
B. It ensures freedom from deadlock.
C. Transaction can lock data items earlier.
D. It does not ensure greater amount of concurrency.
Tree locking protocol (graph-based protocol) rules:
• The first lock may be on any node.
• A transaction may lock a node only if it already holds a lock on the parent.
• Nodes may be unlocked anytime but cannot be relocked.
Properties:
• Deadlock cannot occur because locking follows a hierarchical order.
• Transactions can lock data items earlier since unlocking can happen anytime.
Thus:
B → True
C → True
Find dominant growth for each.
A:
$3x^3+(\log x)^4$
Dominant term = $x^3$
$n=3$
B:
$(x^5+x^2+1)/(x^3+1) \approx x^2$
$n=2$
C:
$(x^3+x^2+1)/(x^2+1) \approx x$
$n=1$
D:
$(x^2+5\log x)/(x^2+1) \approx 1$
$n=0$
Thus:
D → $O(1)$
C → $O(x)$
B → $O(x^2)$
A → $O(x^3)$
Increasing order:
D, C, B, A
Each time an a is read:
$a \rightarrow$ push 3 a's onto the stack.
Each b pops one a from the stack.
Thus:
1 input a produces 3 stack symbols, so we need 3 b's to remove them.
Therefore the relation is:
$b = 3a$
Language:
${a^n b^{3n} \mid n>0}$
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.