Given the following information:
The logical address (L.A.) is 32 bits. The physical address (P.A.) is 20 bits. The page size (P.S.) is 2048 bytes (2 KB). What is the maximum number of entries in the page table?
To calculate the number of entries in a page table, divide the total logical address space by the page size to get the number of pages. The number of entries is equal to the number of pages.
\( 2^{10} \)
\( 2^{12} \)
\( 2^{20} \)
\( 2^{22} \)
Step 1: Understanding the Address Breakdown
- The logical address space is 32 bits, meaning the total addressable space is \( 2^{32} \) bytes.
- The physical address space is 20 bits, meaning the total addressable space in physical memory is \( 2^{20} \) bytes.
Step 2: Page Size Calculation
- The page size is 2048 bytes, which is \( 2^{11} \) bytes.
Step 3: Number of Pages in the Logical Address Space
- The number of pages in the logical address space is: \[ \frac{2^{32}}{2^{11}} = 2^{21} \]
Step 4: Number of Frames in the Physical Address Space
- The number of frames in the physical address space is: \[ \frac{2^{20}}{2^{11}} = 2^{9} \]
Step 5: Number of Entries in the Page Table - The number of entries in the page table is equal to the number of pages in the logical address space, which is \( 2^{21} \).
Thus, the correct answer is (B).
Consider the following code:
int a; int arr[] = {30, 50, 10}; int *ptr = arr[10] + 1; a = *ptr; (*ptr)++; ptr = ptr + 1; printf("%d", a + arr[1] + *ptr);
What is the output of the following C code?
void foo(int *p, int x) { *p = x; } void main() { int *z; int a = 20, b = 25; z = a; // Incorrect: Should be z = a; foo(z, b); printf("%d", a); }
Issue: The statement z = a;
is invalid because a
is an integer, and z
is a pointer.
Find the signed binary expansion of the number -6.
Which of the following is the greatest? \[ 0.6, \ 0.666, \ \frac{5}{6}, \ \frac{2}{3} \]
Consider the following hierarchical cache system with the following access times:
\[ \begin{array}{|c|c|c|} \hline \textbf{Cache Level} & \textbf{Hit Rate} & \textbf{Access Time} \\ \hline L1 & 90\% & 1 \text{ ns} \\ L2 & 80\% & 10 \text{ ns} \\ L3 & 100\% & 100 \text{ ns} \\ \hline \end{array} \]Find \( T_{avg} \) for hierarchical or simultaneous access.
Match the following layers with their corresponding functionalities:
\[ \begin{array}{|c|c|} \hline \textbf{Layer} & \textbf{Functionality} \\ \hline \text{Networking Layer} & \text{Data packet transfer} \\ \text{Transport Layer} & \text{Host-to-host communication} \\ \text{Data Link Layer} & \text{Error detection and correction} \\ \hline \end{array} \]Let \( A \) be a \( 3 \times 3 \) matrix defined as:
\[ A = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & -1 \end{bmatrix} \]Find the eigenvalues of \( A^{13} \).
What is the time complexity of the following algorithm?
int func(int n) {
for (int i = 1; i < = n; i++) {
for (int j = 1; j < = n; j++) {
printf("Hello");
}
}
}
Given an array \( A[n] \) such that:
\[ A[0] \to A[i] \text{ is in non-decreasing order}, \quad A[i+1] \to A[n] \text{ is in non-increasing order}. \]Find the time complexity to find \( A[i] \).
Given the matrix \( A = \begin{bmatrix} 1 & 2 \\ 2 & -1 \end{bmatrix} \), find \( A^8 \).