Ticker

6/recent/ticker-posts

Gate 2023 question and solution part(2)

 Q1. A particular number is written as 132 in radix-4 representation.The same number in radix-5 representation is_________.

Solution

To convert the number 132 from radix-4 representation to radix-5

representation, we can first convert it to decimal representation and then

convert it to radix-5.

132 in radix-4:

(1 * 4^2) + (3 * 4^1) + (2 * 4^0) = 16 + 12 + 2 = 30 in decimal.

Now, let's convert 30 from decimal to radix-5:

30 ÷ 5 = 6 remainder 0

6 ÷ 5 = 1 remainder 1

1 ÷ 5 = 0 remainder 1

Reading the remainders in reverse order, the number 30 in decimal is

equivalent to 110 in radix-5 representation.

So, the same number in radix-5 representation is 110.

Q2Consider a computer system with 57-bit virtual addressing using

multi-level tree-structured page tables with L levels for virtual to

physical address translation. The page size is 4 KB (1 KB = 1024 B)

and a page table entry at any of the levels occupies 8 bytes. The value

of L is________ .

Solution

To calculate the value of L, we need to consider the following:
- Virtual Address Size: 57 bits
- Page Size: 4 KB (1 KB = 1024 bytes)
- Page Table Entry Size: 8 bytes
We know that the virtual address is split into two parts: the page number
and the offset within the page. The number of levels in the multi-level page
table will be determined by the number of bits needed for the page number.
Given that the virtual address size is 57 bits and the page size is 4 KB
(which is 2^12 bytes), we can calculate the number of bits needed for the
page number:
Number of bits for the page number = 57 - 12 = 45 bits
Now, let's calculate the maximum number of page table entries per level
based on the page table entry size:
Page table entries per level = Page Size / Page Table Entry Size
Page table entries per level = (2^12) / (2^3) = 2^9 = 512 entries
Since we need 45 bits for the page number and each level of the page
table can hold 512 entries, we can calculate the number of levels (L):

Number of levels (L) = Ceiling of (Number of bits for page number / Number

of bits per level)

Number of levels (L) = Ceiling of (45 / 9) = 5

Therefore, the value of L is 5.


Post a Comment

0 Comments