Question 61
An 8-way set associative cache of size 64 KB (1 KB = 1024 bytes) is used in a system with a 32-bit address. The address is subdivided into TAG, INDEX, and BLOCK OFFSET.
The number of bits in the TAG is__________
Question 62
The forwarding table of a router is shown below.
Subnet Number | Subnet Mask | Interface ID |
200.150.0.0 | 255.255.0.0 | 1 |
200.150.64.0 | 255.255.224.0 | 2 |
200.150.68.0 | 255.255.255.0 | 3 |
200.150.68.64 | 255.255.255.244 | 4 |
Default | 0 |
A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID
Question 63
Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary key occupies 15 bytes. The data file is block-aligned in that each data record is fully contained within a block. The database is indexed by a primary index file, which is also stored as a block-aligned ordered file. The figure below depicts this indexing scheme
[caption width="800"]Tree[/caption]Suppose the block size of the file system is 1024 bytes, and a pointer to a block occupies 5 bytes. The system uses binary search on the index file to search for a record with a given key. You may assume that a binary search on an index file of b blocks takes log b block accesses in the worst case.
Given a key, the number of block accesses required to identify the block in the data file that may contain a record with the key, in the worst case, is ____________
Question 64
The output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure.
[caption width="800"]IMG2[/caption]Match the functional equivalence of this circuit to one of the following options.
Question 65
Consider the C function foo and the binary tree shown.
[caption width="800"]IMG[/caption]typedef struct node { int val; struct node *left, *right; } node; int foo(node *p) { int retval; if (p == NULL) return 0; else { retval = p->val + foo(p->left) + foo(p->right); printf("%d ", retval); return retval; } }
When foo is called with a pointer to the root node of the given binary tree, what will it print?
There are 65 questions to complete.