GATE 2013
80 questions
MCQ 801-mark 38 · 2-mark 42
Questions 46–50 of 80
A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table organization. The page table base register stores the base address of the first-level table
(T1) ,which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2 ) Each entry of T2 stores the base address of a page of the third-level table (T3 ) Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16 way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.
What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the processor cache of this computer?
What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the processor cache of this computer?
Answer: (C)
Page size. A PTE is 32 bits = 4 bytes. Let the page size be bytes. Each table fits in one page, so it has entries and is indexed by bits. With three levels, the virtual address is bits, so and the page size is 8 KB.
Cache. Number of sets = . The block offset takes 6 bits and the set index 10 bits, so 16 address bits decide the set.
The page offset has only 13 bits, which are the same for synonyms. The other bits of the set index come from the virtual page number, and two synonyms may differ there. To make sure they land in the same set, these 3 bits must be equal, so we need page colours.
Answer: (C)
Cache. Number of sets = . The block offset takes 6 bits and the set index 10 bits, so 16 address bits decide the set.
The page offset has only 13 bits, which are the same for synonyms. The other bits of the set index come from the virtual page number, and two synonyms may differ there. To make sure they land in the same set, these 3 bits must be equal, so we need page colours.
Answer: (C)
A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table organization. The page table base register stores the base address of the first-level table
(T1) ,which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2 ) Each entry of T2 stores the base address of a page of the third-level table (T3 ) Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16 way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.
What is the size of a page in KB in this computer?
What is the size of a page in KB in this computer?
Answer: (C)
Take the page size as bytes. A PTE is 32 bits = 4 bytes, so one page of a table holds entries. T1 occupies exactly one page, so T1 has entries. Every table page has the same number of entries, so each of the three levels is indexed by bits.
The 46-bit virtual address splits into three index fields of bits each and a page offset of bits:
So the page size is B = 8 KB.
Answer: (C)
The 46-bit virtual address splits into three index fields of bits each and a page offset of bits:
So the page size is B = 8 KB.
Answer: (C)
Consider the following relational schema.
Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
“Find the distinct names of all students who score more than 90% in the course numbered 107”
(I)
(III)
(IV)
Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
“Find the distinct names of all students who score more than 90% in the course numbered 107”
(I)
SELECT DISTINCT S.sname
FROM Students as S, Registration as R
WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent >90
(II) (III)
(IV)
Answer: (A)
Check that each query joins Students and Registration on rollno and keeps courseno 107 with percent above 90, and that it returns names without duplicates.
- I: the SQL joins on R.rollno = S.rollno, with R.courseno = 107 and R.percent > 90. DISTINCT removes repeated names. It matches.
- II: Registration and Students have only rollno in common, so the natural join is on rollno. The selection keeps courseno = 107 and percent > 90, and the projection on sname removes duplicates, since relational algebra works with sets. It matches.
- III: tuple calculus. It needs a Students tuple S and a Registration tuple R with S.rollno = R.rollno, R.courseno = 107 and R.percent > 90, and it returns T.sname = S.sname. A calculus result is a set, so there are no duplicates. It matches.
- IV: domain calculus. It needs a Students tuple with roll number S_R and name S_N, and a Registration tuple with the same S_R, course 107 and percent R_P > 90, and it returns S_N. It matches.
All four describe the same result.
Answer: (A)
- I: the SQL joins on R.rollno = S.rollno, with R.courseno = 107 and R.percent > 90. DISTINCT removes repeated names. It matches.
- II: Registration and Students have only rollno in common, so the natural join is on rollno. The selection keeps courseno = 107 and percent > 90, and the projection on sname removes duplicates, since relational algebra works with sets. It matches.
- III: tuple calculus. It needs a Students tuple S and a Registration tuple R with S.rollno = R.rollno, R.courseno = 107 and R.percent > 90, and it returns T.sname = S.sname. A calculus result is a set, so there are no duplicates. It matches.
- IV: domain calculus. It needs a Students tuple with roll number S_R and name S_N, and a Registration tuple with the same S_R, course 107 and percent R_P > 90, and it returns S_N. It matches.
All four describe the same result.
Answer: (A)
Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values.
is a set of functional dependencies (FDs) so that is exactly the set of FDs that hold for R.
The relation R is
is a set of functional dependencies (FDs) so that is exactly the set of FDs that hold for R.
The relation R is
Answer: (A)
Find the keys. is on no right side, so every key contains . Closures:
- (via , , ), so .
- , and reach the same set (for example ), so , and are also keys.
Prime attributes: . Non-prime attributes: .
: is only a part of the key , and is non-prime. This is a partial dependency, so R is not in 2NF. Values are atomic, so R is in 1NF.
Answer: (A)
- (via , , ), so .
- , and reach the same set (for example ), so , and are also keys.
Prime attributes: . Non-prime attributes: .
: is only a part of the key , and is non-prime. This is a partial dependency, so R is not in 2NF. Values are atomic, so R is in 1NF.
Answer: (A)
Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values.
is a set of functional dependencies (FDs) so that is exactly the set of FDs that hold for R.
How many candidate keys does the relation R have?
is a set of functional dependencies (FDs) so that is exactly the set of FDs that hold for R.
How many candidate keys does the relation R have?
Answer: (B)
is never on a right side, so every key must contain . Now the closures:
- , so is a key.
- : , then , then . This gives all attributes except , so is a key.
- : , then , . All except , so is a key.
- : , then , , . All except , so is a key.
- alone is not a key. Adding only , and does not help: . So no other minimal key exists.
Candidate keys: , which is 4 keys.
Answer: (B)
- , so is a key.
- : , then , then . This gives all attributes except , so is a key.
- : , then , . All except , so is a key.
- : , then , , . All except , so is a key.
- alone is not a key. Adding only , and does not help: . So no other minimal key exists.
Candidate keys: , which is 4 keys.
Answer: (B)