September 2023

In a system, there are three types of resources: E, F and G. Four processes P0, P1, P2 and P3 execute concurrently

In a system, there are three types of resources: E, F and G. Four processes P0, P1, P2 and P3 execute concurrently

Q. In a system, there are three types of resources: E, F and G. Four processes P0, P1, P2 and P3 execute concurrently. At the outset, the processes have declared their maximum resource requirements using a matrix named Max as given below. For example, Max[P2,F] is the maximum number of instances of F that P2 […]

In a system, there are three types of resources: E, F and G. Four processes P0, P1, P2 and P3 execute concurrently Read More »

Consider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #

Consider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #

Q. Consider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #. Which one of the following is correct for the given parse tree? A. $ has higher precedence and is left associative; # is right associative B. # has higher precedence and is left associative; $ is right associative

Consider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and # Read More »

A lexical analyzer uses the following patterns to recognize three tokens T1, T2, and T3 over the alphabet {a,b,c}.

A lexical analyzer uses the following patterns to recognize three tokens T1, T2, and T3 over the alphabet {a,b,c}.

Q. A lexical analyzer uses the following patterns to recognize three tokens T1, T2, and T3 over the alphabet {a,b,c}. 𝑇1:   𝑎? (𝑏|𝑐)∗𝑎 𝑇2:   𝑏? (𝑎|𝑐)∗𝑏 𝑇3:   𝑐? (𝑏|𝑎)∗𝑐 Note that ‘x?’ means 0 or 1 occurrence of the symbol x. Note also that the analyzer outputs the token that matches the longest possible prefix.

A lexical analyzer uses the following patterns to recognize three tokens T1, T2, and T3 over the alphabet {a,b,c}. Read More »

Consider the following problems. 𝐿(𝐺) denotes the language generated by a grammar 𝐺

Consider the following problems. 𝐿(𝐺) denotes the language generated by a grammar 𝐺

Q. Consider the following problems. 𝐿(𝐺) denotes the language generated by a grammar 𝐺. 𝐿(𝑀) denotes the language accepted by a machine 𝑀. I. For an unrestricted grammar 𝐺 and a string 𝑤, whether 𝑤 ∈ 𝐿(𝐺) II. Given a Turing machine M, whether L(M) is regular III. Given two grammars 𝐺1 and 𝐺2, whether

Consider the following problems. 𝐿(𝐺) denotes the language generated by a grammar 𝐺 Read More »

Consider the unsigned 8-bit fixed point binary number representation below

Consider the unsigned 8-bit fixed point binary number representation below

Q. Consider the unsigned 8-bit fixed point binary number representation below, b7 b6 b5 b4 b3 .  b2 b1 b0 Where the position of the binary point is between b3 and b2. Assume b7 is the most significant bit. Some of the decimal numbers listed below cannot be represented exactly in the above representation: (i)       31.500      (ii)    0.875    

Consider the unsigned 8-bit fixed point binary number representation below Read More »

Consider the following C code. Assume that unsigned long int type length is 64 bits

Consider the following C code. Assume that unsigned long int type length is 64 bits

Q. Consider the following C code. Assume that unsigned long int type length is 64 bits. The value returned when we call fun with the input 240 is (A) 4                           (B) 5                           (C) 6                           (D) 40 Ans: 5 Sol: // n takes 2^40unsigned long int fun(unsigned long int n) { }

Consider the following C code. Assume that unsigned long int type length is 64 bits Read More »

Consider a long-lived TCP session with an end-to-end bandwidth of 1 Gbps (= 109 bits-per- second)

Consider a long-lived TCP session with an end-to-end bandwidth of 1 Gbps (= 109 bits-per- second)

Q. Consider a long-lived TCP session with an end-to-end bandwidth of 1 Gbps (= 109 bits-per- second). The session starts with a sequence number of 1234. The minimum time (in seconds, rounded to the closest integer) before this sequence number can be used again is     Ans: 34 Sol: As sequence number field of TCP is

Consider a long-lived TCP session with an end-to-end bandwidth of 1 Gbps (= 109 bits-per- second) Read More »

Scroll to Top