Assignment 01: PART A: Write a program to implement Banker's algorithm for deadlock avoidance for the given scenarios. Process Allocation Max Available ABC ABC ABC P0 010 753 332 P1 200 322 P2 302 902 P3 211 222 P4 002 433 PART B: Write a program to implement algorithm for deadlock detection. Hint: \begin{itemize} \item Assume $n$ is the total number of process and $m$ is the total number of resource types in system. \item Check for available resource(s). \item Create three matrices as Max, Allocation, Need. \item Iterate over processes. \end{itemize}
Added by Adri-N D.
Close
Step 1
First, we need to represent the given data in matrices. We have the Allocation matrix, Available vector, and Max matrix. Allocation matrix: $$ \begin{bmatrix} 0 & 1 & 0 \\ 2 & 0 & 3 \\ 0 & 2 & 2 \\ 1 & 0 & 2 \\ 0 & 2 & 0 \end{bmatrix} Show more…
Show all steps
Your feedback will help us improve your experience
Maryam Riaz and 78 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Question 1: Linear Block Code (20 marks) Consider a (6,3) linear block code C with generator matrix G = [P: I3], where I3 = [1 0 0; 0 1 0; 0 0 1] and P is a 3 x 3 matrix. Given three codewords: C1 = 110110; C2 = 011011; C3 = 000111. (a) [5 marks] Based on the above given linear block codewords, find the generator matrix G. (b) [2 marks] Determine the parity check matrix H of C. (c) [5 marks] Use pictorial representation to decode the codeword r = [1 1 1 1 1 0]. (d) [8 marks] Construct the following table: Syndrome | Error Pattern
Sri K.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD