Updated: Mar 2026
Mock 1 - 100% FREE

GATE CS Mock Tests

Practice GATE CS mock tests with 10 full-length tests and 547+ questions. Real exam interface, All India ranking, and detailed analytics. First mock FREE!

10
Mock Tests
547+
Questions
FREE
First Mock
AIR
Ranking
Start Free Mock Test →

Available Mock Tests

FREE

Mock Test 2

55 Questions • 3 Hours • Full Analytics
Start Free →

Mock Test 5

55 Questions • 3 Hours • Full Analytics
Unlock

Mock Test 8

55 Questions • 3 Hours • Full Analytics
Unlock

Mock Test 9

55 Questions • 3 Hours • Full Analytics
Unlock

Mock Test 1

55 Questions • 3 Hours • Full Analytics
Unlock

Mock Test 4

55 Questions • 3 Hours • Full Analytics
Unlock

Mock Test 7

55 Questions • 3 Hours • Full Analytics
Unlock

Mock Test 10

55 Questions • 3 Hours • Full Analytics
Unlock

Mock Test 3

55 Questions • 3 Hours • Full Analytics
Unlock

Mock Test 6

55 Questions • 3 Hours • Full Analytics
Unlock

Free Mock Preview

1 Numerical
Let AA be the 3×33 \times 3 matrix given below.
A=(110011101)A = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \end{pmatrix}
The value of the trace of the inverse of matrix AA, denoted as trace(A1)\operatorname{trace}(A^{-1}), is __________.
Correct Answer: 1.5
View Solution
The problem asks for the trace of the inverse of matrix AA. A direct computation of the inverse can be lengthy. A more efficient method involves using the Cayley-Hamilton theorem. **Step 1: Find the characteristic polynomial of the matrix A.** The characteristic equation is given by det(AλI)=0\det(A - \lambda I) = 0.
det(AλI)=1λ1001λ1101λ=(1λ)1λ101λ10111λ+0=(1λ)((1λ)20)1(01)=(1λ)3+1=(13λ+3λ2λ3)+1=λ3+3λ23λ+2\begin{aligned}\det(A - \lambda I) & = \begin{vmatrix}1-\lambda & 1 & 0 \\ 0 & 1-\lambda & 1 \\ 1 & 0 & 1-\lambda\end{vmatrix} \\ & = (1-\lambda) \begin{vmatrix} 1-\lambda & 1 \\ 0 & 1-\lambda \end{vmatrix} - 1 \begin{vmatrix} 0 & 1 \\ 1 & 1-\lambda \end{vmatrix} + 0 \\ & = (1-\lambda)((1-\lambda)^2 - 0) - 1(0 - 1) \\ & = (1-\lambda)^3 + 1 \\ & = (1 - 3\lambda + 3\lambda^2 - \lambda^3) + 1 \\ & = -\lambda^3 + 3\lambda^2 - 3\lambda + 2\end{aligned}
The characteristic equation is λ3+3λ23λ+2=0-\lambda^3 + 3\lambda^2 - 3\lambda + 2 = 0, or equivalently, λ33λ2+3λ2=0\lambda^3 - 3\lambda^2 + 3\lambda - 2 = 0. **Step 2: Apply the Cayley-Hamilton theorem to find an expression for A1A^{-1}.** According to the Cayley-Hamilton theorem, a matrix satisfies its own characteristic equation. Therefore,
A33A2+3A2I=0A^3 - 3A^2 + 3A - 2I = 0
To find the inverse, we first confirm that AA is invertible. The determinant of AA is given by (1)n(-1)^n times the constant term of the characteristic polynomial λ33λ2+3λ2=0\lambda^3 - 3\lambda^2 + 3\lambda - 2 = 0. For n=3n=3,
det(A)=(1)3(2)=2\det(A) = (-1)^3(-2) = 2
Since det(A)0\det(A) \neq 0, the matrix is invertible. Rearranging the equation:
A33A2+3A=2IA^3 - 3A^2 + 3A = 2I
Multiplying both sides by A1A^{-1}:
A1(A33A2+3A)=A1(2I)A^{-1}(A^3 - 3A^2 + 3A) = A^{-1}(2I)
A23A+3I=2A1A^2 - 3A + 3I = 2A^{-1}
A1=12(A23A+3I)A^{-1} = \frac{1}{2}(A^2 - 3A + 3I)
**Step 3: Calculate the trace of A1A^{-1} using the properties of the trace operator.** The trace is a linear operator, so
trace(kX+lY)=ktrace(X)+ltrace(Y)\operatorname{trace}(kX + lY) = k \cdot \operatorname{trace}(X) + l \cdot \operatorname{trace}(Y)
trace(A1)=trace(12(A23A+3I))=12(trace(A2)3trace(A)+3trace(I))\begin{aligned}\operatorname{trace}(A^{-1}) & = \operatorname{trace}\left(\frac{1}{2}(A^2 - 3A + 3I)\right) \\ & = \frac{1}{2} \left( \operatorname{trace}(A^2) - 3 \cdot \operatorname{trace}(A) + 3 \cdot \operatorname{trace}(I) \right)\end{aligned}
We need to compute trace(A)\operatorname{trace}(A) and trace(A2)\operatorname{trace}(A^2). From the given matrix AA, the trace is the sum of the diagonal elements:
trace(A)=1+1+1=3\operatorname{trace}(A) = 1 + 1 + 1 = 3
Next, we compute A2A^2:
A2=(110011101)(110011101)=(121112211)A^2 = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & 2 & 1 \\ 1 & 1 & 2 \\ 2 & 1 & 1 \end{pmatrix}
trace(A2)=1+1+1=3\operatorname{trace}(A^2) = 1 + 1 + 1 = 3
The trace of the 3×33 \times 3 identity matrix is
trace(I)=1+1+1=3\operatorname{trace}(I) = 1+1+1=3
**Step 4: Substitute the values to find the final answer.**
trace(A1)=12(33(3)+3(3))=12(39+9)=32=1.5\begin{aligned}\operatorname{trace}(A^{-1}) & = \frac{1}{2} (3 - 3(3) + 3(3)) \\ & = \frac{1}{2} (3 - 9 + 9) \\ & = \frac{3}{2} = 1.5\end{aligned}
**Answer:** The value of the trace of A1A^{-1} is 1.5\boxed{1.5}.
2 Single Choice
A 3232-bit instruction set architecture (ISA) supports 6464 general-purpose registers. It defines two primary instruction formats: 1. **Format A (Register-Register):** Consists of an opcode and three register operands. 2. **Format B (Immediate):F** Consists of an opcode, two register operands, and a 1616-bit immediate value. If 1616 distinct opcodes are reserved for Format A instructions, what is the maximum number of distinct opcodes that can be supported for Format B instructions?
A
15
B
16
C
32
D
64
View Solution
**Step 1: Determine the number of bits required for register operands.** There are 64 general-purpose registers. To uniquely identify each register, we need log2(64)=6\log_2(64) = 6 bits per register operand. **Step 2: Calculate the number of bits available for the opcode in Format A.** Format A (Register-Register) has three register operands.
Total bits for operands in Format A=3×6=18 bits\text{Total bits for operands in Format A} = 3 \times 6 = 18 \text{ bits}
Given that the total instruction length is 32 bits,
Bits for opcode in Format A=3218=14 bits\text{Bits for opcode in Format A} = 32 - 18 = 14 \text{ bits}
**Step 3: Calculate the number of bits available for the opcode in Format B.** Format B (Immediate) has two register operands and one 16-bit immediate value.
Total bits for operands in Format B=(2×6)+16=12+16=28 bits\text{Total bits for operands in Format B} = (2 \times 6) + 16 = 12 + 16 = 28 \text{ bits}
Given that the total instruction length is 32 bits,
Bits for opcode in Format B=3228=4 bits\text{Bits for opcode in Format B} = 32 - 28 = 4 \text{ bits}
**Step 4: Apply the expanding opcode scheme logic.** To ensure unambiguous decoding, a common technique (expanding opcodes) uses a fixed-length primary opcode field. The length of this primary opcode field is determined by the format that has the smallest number of bits available for its opcode. In this case, Format B has 4 bits available for its opcode, which is the smallest. So, we consider a 4-bit primary opcode field. This field can have 24=162^4 = 16 distinct values (from 0000 to 1111). **Step 5: Allocate primary opcode values for Format A instructions.** For Format A, the opcode field is 14 bits. If one primary opcode value (say, '0000') is designated for Format A instructions, then the remaining 144=1014 - 4 = 10 bits serve as an extension opcode. This means that a single primary opcode value dedicated to Format A can define 210=10242^{10} = 1024 distinct Format A instructions. The problem states that 16 distinct opcodes are reserved for Format A instructions. Since 1024161024 \ge 16, dedicating just **one** primary opcode value is sufficient to support all 16 (and many more) Format A instructions. **Step 6: Determine the maximum number of opcodes for Format B instructions.** We started with 16 available primary opcode values. One primary opcode value has been used for Format A instructions.
Remaining primary opcode values=161=15\text{Remaining primary opcode values} = 16 - 1 = 15
Each distinct Format B opcode requires one unique primary opcode value because its entire opcode is only 4 bits long (which is the length of our primary opcode field). Therefore, each of the remaining 15 primary opcode values can be used to define one distinct Format B instruction. Thus, the maximum number of distinct opcodes that can be supported for Format B instructions is 15. **Answer:** 15\boxed{15}
3 Numerical
Consider a simple undirected graph GG with nn vertices and kk connected components. What is the maximum possible number of edges that GG can have? If n=10n=10 and k=4k=4, what is the maximum number of edges in GG?
Correct Answer: 21
View Solution
**Step 1: Understand the conditions for maximizing edges in a graph with kk components.** To maximize the number of edges in a graph with a fixed number of vertices nn and a fixed number of connected components kk, each component must be a complete graph. Let the kk connected components have n1,n2,,nkn_1, n_2, \dots, n_k vertices, respectively. We know that i=1kni=n\sum_{i=1}^{k} n_i = n. The number of edges in a complete graph with nin_i vertices is (ni2)\binom{n_i}{2}. Therefore, the total number of edges in GG is E=i=1k(ni2)E = \sum_{i=1}^{k} \binom{n_i}{2}. **Step 2: Determine the distribution of vertices among components that maximizes the sum of edges.** To maximize the sum i=1k(ni2)\sum_{i=1}^{k} \binom{n_i}{2} subject to i=1kni=n\sum_{i=1}^{k} n_i = n and ni1n_i \ge 1, we should make one component as large as possible and the remaining components as small as possible. The smallest possible size for a component is 1 vertex. If a component has 1 vertex, it has (12)=0\binom{1}{2} = 0 edges. Thus, to maximize the edges, we partition the nn vertices such that: - k1k-1 components each consist of a single vertex. These components contribute 0 edges each. - The remaining component contains n(k1)n - (k-1) vertices. This component will be a complete graph Kn(k1)K_{n-(k-1)}. **Step 3: Apply the given values to calculate the maximum number of edges.** Given n=10n=10 and k=4k=4. Following the strategy from Step 2: - Number of small components = k1=41=3k-1 = 4-1 = 3. Each of these has 1 vertex. - Number of vertices in the largest component = n(k1)=103=7n - (k-1) = 10 - 3 = 7. The maximum number of edges will be the sum of edges in these components:
Emax=(72)+(12)+(12)+(12)E_{max} = \binom{7}{2} + \binom{1}{2} + \binom{1}{2} + \binom{1}{2}
**Step 4: Perform the calculation.**
Emax=7×(71)2+0+0+0E_{max} = \frac{7 \times (7-1)}{2} + 0 + 0 + 0
Emax=7×62E_{max} = \frac{7 \times 6}{2}
Emax=422E_{max} = \frac{42}{2}
Emax=21E_{max} = 21
**Answer:** 21\boxed{21}
4 Single Choice
Let GG be a simple undirected graph with nn vertices, where n2n \ge 2. Which of the following statements about the degrees of its vertices is always TRUE?
A
All vertices must have an even degree.
B
The sum of the degrees of all vertices must be an odd number.
C
There exist at least two vertices in GG that have the same degree.
D
There exists at least one vertex in GG with degree 0.
View Solution
**Step 1: Analyze the properties of vertex degrees in a simple undirected graph.** For a simple undirected graph with nn vertices, the degree of any vertex vv, denoted deg(v)\operatorname{deg}(v), must satisfy 0deg(v)n10 \le \operatorname{deg}(v) \le n-1. This is because a vertex cannot have a self-loop, and there can be at most one edge between any pair of distinct vertices. Thus, a vertex can be connected to at most the other n1n-1 vertices. **Step 2: Evaluate Option 1: "All vertices must have an even degree."** This statement is false. Consider a complete graph K2K_2 (a simple undirected graph with 2 vertices and 1 edge). Both vertices have degree 1, which is odd. Thus, not all vertices have an even degree. **Step 3: Evaluate Option 2: "The sum of the degrees of all vertices must be an odd number."** This statement is false. According to the Handshaking Lemma, the sum of the degrees of all vertices in any graph is equal to twice the number of edges (vVdeg(v)=2E\sum_{v \in V} \operatorname{deg}(v) = 2|E|). Since 2E2|E| is always an even number, the sum of the degrees must always be even, not odd. **Step 4: Evaluate Option 4: "There exists at least one vertex in GG with degree 0."** This statement is false. Consider a complete graph KnK_n for n2n \ge 2. In KnK_n, every vertex is connected to every other vertex, so the degree of each vertex is n1n-1. Since n2n \ge 2, n11n-1 \ge 1, so no vertex has degree 0. For example, in K3K_3, all vertices have degree 2. **Step 5: Evaluate Option 3: "There exist at least two vertices in GG that have the same degree."** This statement is true. We can prove this using the Pigeonhole Principle. Assume, for the sake of contradiction, that all nn vertices in GG have distinct degrees. Since there are nn vertices and their degrees are integers in the range [0,n1][0, n-1], the set of all nn distinct degrees must be exactly {0,1,2,,n1}\{0, 1, 2, \dots, n-1\}. If this is the case, then there must exist: * A vertex v0v_0 such that deg(v0)=0\operatorname{deg}(v_0) = 0. * A vertex vn1v_{n-1} such that deg(vn1)=n1\operatorname{deg}(v_{n-1}) = n-1. If deg(v0)=0\operatorname{deg}(v_0) = 0, it means v0v_0 is not adjacent to any other vertex in the graph. If deg(vn1)=n1\operatorname{deg}(v_{n-1}) = n-1, it means vn1v_{n-1} is adjacent to all other n1n-1 vertices in the graph. Since n2n \ge 2, there are other vertices, including v0v_0. Therefore, vn1v_{n-1} must be adjacent to v0v_0. But if vn1v_{n-1} is adjacent to v0v_0, then deg(v0)\operatorname{deg}(v_0) must be at least 1. This contradicts our assumption that deg(v0)=0\operatorname{deg}(v_0) = 0. Since our assumption that all degrees are distinct leads to a contradiction, it must be false. Therefore, there must be at least two vertices in GG that have the same degree. Answer: There exist at least two vertices in G that have the same degree.\boxed{\text{There exist at least two vertices in } G \text{ that have the same degree.}}
5 Multiple Select
Which of the following statements accurately describe the characteristics or implications of hardwired and microprogrammed control unit designs?
A
Hardwired control units are preferred in high-performance computing systems where minimizing the cycles per instruction (CPI) is critical, due1 to their direct logic implementation.
B
The ability to easily extend or modify the instruction set architecture (ISA) without significant hardware redesign is a major advantage of microprogrammed control units.
C
Designing a purely hardwired control unit for a processor with a highly complex and irregular instruction set, characteristic of many CISC architectures, is generally more intricate and resource-intensive than a microprogrammed approach.
D
Microprogrammed control units are predominantly utilized in Reduced Instruction Set Computer (RISC) architectures to achieve their characteristic execution speed and design simplicity.
View Solution
1. **Analysis of Statement 1:** "Hardwired control units are preferred in high-performance computing systems where minimizing the cycles per instruction (CPI) is critical, due to their direct logic implementation." This statement is **correct**. Hardwired control units generate control signals directly through combinatorial and sequential logic circuits. This direct hardware implementation eliminates the need for memory access to fetch microinstructions, leading to faster signal generation and thus lower operational latency. This speed advantage makes them suitable for high-performance processors where minimizing CPI is a key design goal, as seen in many RISC architectures. 2. **Analysis of Statement 2:** "The ability to easily extend or modify the instruction set architecture (ISA) without significant hardware redesign is a major advantage of microprogrammed control units." This statement is **correct**. In a microprogrammed control unit, the sequence of control signals for each machine instruction is stored as a microprogram in a control memory (ROM/EPROM). To modify or extend the ISA, one primarily needs to update or add microprograms in the control memory, which is much simpler and less expensive than redesigning and refabricating physical hardware logic, as would be required for a hardwired unit. 3. **Analysis of Statement 3:** "Designing a purely hardwired control unit for a processor with a highly complex and irregular instruction set, characteristic of many CISC architectures, is generally more intricate and resource-intensive than a microprogrammed approach." This statement is **correct**. Hardwired control units become extremely complex and difficult to design, debug, and implement as the instruction set becomes larger, more complex, and less regular (e.g., variable instruction formats, multiple addressing modes, complex operations). The increasing number of states and transitions in the finite state machine makes the logic design intricate and resource-intensive. Microprogrammed control units, on the other hand, manage complexity by breaking down complex instructions into a sequence of simpler micro-operations, making them more suitable for CISC architectures. 4. **Analysis of Statement 4:** "Microprogrammed control units are predominantly utilized in Reduced Instruction Set Computer (RISC) architectures to achieve their characteristic execution speed and design simplicity." This statement is **incorrect**. RISC architectures prioritize speed and simplicity by having a small, regular instruction set. They typically employ hardwired control units to achieve their characteristic high execution speed and low CPI, as the simplicity of the instruction set makes hardwired implementation feasible and efficient. Microprogrammed control units are more commonly associated with Complex Instruction Set Computer (CISC) architectures, where they help manage the complexity of the instruction set. Answer: \boxed{Statements 1, 2, and 3 are correct. Statement 4 is incorrect.}

Frequently Asked Questions

How many GATE CS mock tests are available?

We offer 10 full-length mock tests with 547+ questions, designed to simulate the actual GATE exam experience.

Is the first mock test free?

Yes! Mock Test 1 is completely FREE. You can attempt it with full features including detailed solutions and performance analytics.

Do mock tests have the same pattern as GATE?

Yes, our mock tests follow the exact GATE exam pattern with MCQ, MSQ, and NAT questions, same marking scheme, and 3-hour duration.

Will I get All India Ranking?

Yes! After completing any mock test, you'll see your All India Rank compared to other students who attempted the same test.

More GATECS Resources

Why Choose MastersUp?

🎯

AI-Powered Plans

Personalized study schedules based on your exam date and learning pace

📚

15,000+ Questions

Verified questions with detailed solutions from past papers

📊

Smart Analytics

Track your progress with subject-wise performance insights

🔖

Bookmark & Revise

Save important questions for quick revision before exams

Start Your Free Preparation →

No credit card required • Free forever for basic features