Consider a direct mapped cache of size 32 KB with block size 32 bytes. The CPU generates 32 bit addresses. The number of bits needed for cache indexing and the number of tag bits are respectively * A) 10,17 B) 10,22 C) 15,17 D) 5,17
To determine the number of bits needed for cache indexing and the number of tag bits, we can utilize the given information:
Cache Size = 32 KB = 32 * 1024 bytes Block Size = 32 bytes CPU Address Size = 32 bits
First, let's calculate the number of blocks in the cache using the given block size and cache size:
Number of Blocks = Cache Size / Block Size Number of Blocks = (32 * 1024) / 32 Number of Blocks = 1024
Since the cache is direct-mapped, we need to use the number of blocks to determine the number of cache index bits:
Number of Index Bits = log2(Number of Blocks) Number of Index Bits = log2(1024) Number of Index Bits = 10
Now, we can determine the number of tag bits:
Number of Tag Bits = CPU Address Size - Number of Index Bits Number of Tag Bits = - 10 Number of Tag Bits = 22
Therefore, the number of bits needed for cache indexing is 10, and the number of tag bits is 22, so the correct answer is:
B) 10,22
Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced, use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is 8, 12,0, 12,8 * A) 2 B) 3 C) 4 D) 5
The given sequence of block addresses is: 8, 12, 0, 12, 8
The cache is a 2-way set-associative cache with 4 blocks, which implies that there are 2 sets with 2 blocks each.
Let's analyze each block address in the sequence:
Address 8 goes into set 0 (8 mod 2 = 0). Block 8 is loaded into the cache - cache miss.
Address 12 goes into set 0 as well (12 mod 2 = 0). Since there is another block available in set 0, block 12 is loaded as well into the cache - cache miss.
Address 0 goes into set 0 (0 mod 2 = 0). Now set 0 is full, so the Least Recently Used (LRU) block must be replaced. The LRU is block 8, so 0 replaces(block 8) - cache miss.
Address 12 is requested again. This block is already in memory, so this is a cache hit - no cache miss.
Address 8 is requested; however, block 8 had been replaced by 0. Hence, based on the LRU rule, 12 is the least recently used at this point, so 8 replaces 12 - cache miss.
So, the total number of cache misses is 4.
Therefore, the correct answer is:
C) 4
In MIPS processor design, irrespective of the implementation methods, the sign extended___________ offset, * a. Extends the least significant bit b. Extents the most significant bit c. Extends LSB in lw instruction and MSB in beq instruction d. None of the options are correct
In the MIPS processor design, the sign-extended offset refers to the process where the most significant bit (MSB) is extended to fill in the rest of the available bits. In the context of MIPS, sign extension is used when dealing with 16-bit immediate or offset values that must be used in 32-bit instructions. This action essentially helps preserve the negative or positive value of a smaller bit length number when it gets promoted to a larger bit length number.
So, the correct answer is:
b. Extends the most significant bit.
The result of >> of 11001 by 2-bits will be * A) 00100 B) 01000 C) 00011 D) 11111
The operation ">>" is a right binary shift. It shifts the digits of a binary number to the right by the specified number of places, in this case, 2 places.
The original binary number is 11001.
After shifting right by 2 places, the two right-most bits are discarded and two 0s are added to the left, resulting in 00110However, none of the options provided matches this result. It seems like there might be an error in the available choices. Please cross-check once more.
In daisy chaining device 0 will pass the signal only if it has * A) Interrupt request B) No interrupt request C) Both No interrupt and Interrupt request D) None of the mentioned
In a daisy chaining interrupt mechanism, higher priority devices are connected before lower priority devices. The signal is passed down the chain until it finds a device that has issued an interrupt request.
Device 0, being the first device in the chain, will pass the signal only if it doesn't have any interrupt request. If Device 0 has an interrupt request, it will take the interrupt and wouldn't pass the signal down the chain to the other devices.
Hence, the correct answer would be:
B) No interrupt request
Basic Idea of Booth’s Algorithm -If the bits are 01, we do an addition and then shift. * A)True B)False
The basic idea of Booth's Algorithm is indeed as described in the query. If the pair of residual bits scanned is 01, the algorithm performs an arithmetic right shift, which is equivalent to adding the value of the multiplier., the statement is:
A) True
The 10’s complement of 562 is * A) 6 B) 3 C) 10 D) 12
The nth complement of a number is found by subtracting that number from the smallest number of n+1 number of digits. To find the 10's complement of a number, you subtract it from the smallest number that is 1 digit larger.
For a three-digit number like 562, the smallest number with one more digit is 1000.
So, to find the 10's complement of 562, subtract 562 from 1000:
1000 - 562 = 438
None of the options given (A: 6, B: 3, C: 10, D: 12) match the correct answer, 438. There seems to be a mistake in the provided options.
A processor needs software interrupt to * A) Test the interrupt system of the processor. B) Implement co-routines. C) Obtain system services which need execution of privileged instructions. D) Return from subroutine.
A software interrupt is typically used by a program to request a service from the operating system. These services often require the execution of privileged instructions. Therefore, software interrupts act as a signal to the processor to switch from user mode to kernel mode, which allows these privileged instructions to be executed.
Hence, the correct answer is:
C) Obtain system services which need execution of privileged instructions.
The result of >> of 11001 by 2-bits will be * A) 00100 B) 01000 C) 00011 D) 11111
The operation ">>" is a right binary shift. It shifts the digits of a binary number to the right by the specified number of places, in this case, 2 places.
The original binary number is 11001.
After shifting right by 2 places, the two right-most bits are discarded and two 0s are added to the left, resulting in 00110However, none of the options provided matches this result. It seems like there might be an error in the available choices. Please cross-check once more.
omnicalculator.com
sanfoundry.com
engineeringinterviewquestions.com