Question 1 a) Describe each of the following concepts: multiprogramming, process
ID: 3599817 • Letter: Q
Question
Question 1 a) Describe each of the following concepts: multiprogramming, process, thread. [8 Marks] b) Describe the functionality of both a Stack Architecture and General Purpose Architecture [10 Marks] highlighting how they differ from each other. c) In the context of a stack based architecture, create a stack based program which computes 7+(918) Your answer should include an illustration which shows the state of the stack after each instruction and also show the workings of the bitwise OR operation Hint Step 1: Convert the expression into postfix notation Step 2: Convert the postfix notation into a series of instructions, using PUSH, OR ADD instructions. [15 Marks]Explanation / Answer
Answer:
a)Multiprogramming:It is a process in which several program are run at the same time on a uniprocessor.There is only one processor so no simultaneous execution of programs are allowed.Purpose of multiprogramming is to maximize CPU utilization.
Process:Process is an instance of program in execution.a process can initiate a subprocess,called as child process and child process is the replica of parent process and some of it's resources and doesn't exist while parent is terminated.
Thread:It is a smallest unit of processing that can be performed independently by a scheduler.In modern OS,a thread exists within a process i.e, a single process may contain multiple threads.
b)In a stack-based architecture most of it's instructions operate on a push-down stack.
But in general-pupose architecture number of instructions operate in a register.
c) Expression given : 7+(9 | 8)
' +' is the additive operator and '|' is the bitwise OR operator. '+' has higher precedence than '|' but since it is inside braket so we perform execution of braket part first and convert 8 ,9 into binary form then perform bitwise OR between them so it will be:binary of 9 is 1001 , 8 is 1000and 7 is 111
7+(9|8) : 7+(1001 | 1000)
7+(1001) convert 7 into decimal 0111+(1001)
Postfix notation is : 0111 1001 +
Stack architecture: Input Stack
0111 1001 + empty push 0111
1001 + 0111 push 1001
+ 0111 1001 pop 0111,1001 do 0111+1001 then push 10000
10000
result is 10000.
+
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.