Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  At a particular time of computation the value... Start Learning for Free
At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will be
  • a)
    18
  • b)
    22
  • c)
    15
  • d)
    13
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
At a particular time of computation the value of a counting semaphore ...
P operation : Decrements the value of semaphore by 1 V operation : Increments the value of semaphore by 1 Initially, value of semaphore = 7 After 20 P operations, value of semaphore = 7 - 20 = -13 Now, after xV operations, value of semaphore = 5 -13 + xV = 5 xV = 5 + 13 = 18 So, option (A) is correct.
View all questions of this test
Most Upvoted Answer
At a particular time of computation the value of a counting semaphore ...
Given information:
- Initial value of counting semaphore = 7
- Number of P operations completed = 20
- Number of V operations completed = x
- New value of semaphore = 5

Approach:
- P operation decreases the value of semaphore by 1
- V operation increases the value of semaphore by 1
- We need to find the value of x, i.e., number of V operations completed

Solution:
Let's assume the initial value of semaphore as S.

After 20 P operations, the value of semaphore will be:
S - 20

After x V operations, the value of semaphore will be:
S - 20 + x

Given that the new value of semaphore is 5, we have:
S - 20 + x = 5

Simplifying this equation, we get:
x = 25 - S

Substituting the value of S as 7 (initial value of semaphore), we get:
x = 25 - 7 = 18

Therefore, the number of V operations completed is 18.

Answer: Option A (18)
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer?
Question Description
At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer?.
Solutions for At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer?, a detailed solution for At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will bea)18b)22c)15d)13Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev