gd [email protected] · Mon Nov 27 2023

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:

  1. Address 8 goes into set 0 (8 mod 2 = 0). Block 8 is loaded into the cache - cache miss.

  2. 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.

  3. 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.

  4. Address 12 is requested again. This block is already in memory, so this is a cache hit - no cache miss.

  5. 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.

Bit Shift CalculatorCreated by Philip MausReviewed by Steven WoodingLast updated: Jun 05, 2023The bit shift calculator lets you execute bit shifts to the left and bit shifts to the right. The logical shift operation can be done with input from the binary, octal, and decimal number systems, and the calculator gives the results in signed and unsigned representations.What is a bit shift left and bit shift right? A bit shift is a bitwise operation executed on a binary number. To understand this better, let's take a look at the concept step by step. Binary numbers are numbers founded on the base 2 system. You can refresh your knowledge of this other numerical system at the binary converter. Base 2 means that each digit can only have the values and , representing a bit, the smallest unit of digital information. One bit can only display two logical states: on or off. To make up larger amounts of information, bits are lined up to form binary numbers. With those, arithmetic operations like binary subtraction can be executed trouble free. Binary numbers can be converted to numbers in the decimal system. In the case of negative numbers in the decimal system, there is a so-called signed representation, allowing to display those in the binary system.So what is a bit shift? A bit shift is an operation where a succession of bits is moved either to the left or the right. For logical bit shifts, the bits shifted out of the binary number's scope are lost, and 0's are shifted in on the other end. This differentiates this method from the circular and arithmetic bit shift. Bit shifts are not the only bitwise operations; further important ones are AND, OR, and XOR: meet them at Omni's logic gate calculator and bitwise calculator! The picture above shows an example of bit shifts to the right and left. Input is the binary number , or . The right bit shift moves every bit of the input one position to the right. Thereby, the least significant bit is lost, while a is pushed in on the other end. The left bit shift moves every bit of the input one position to the left. A is pushed in on the right end to fill up the bit succession. The bit shift is an important operation to perform mathematical operations efficiently. In the example above, we shifted the binary number , or in the decimal system, one bit to the left. The result is , or in the decimal system. So shifting one bit to the left is equal to multiplying a number by the factor . Shifting two bits means multiplying by , bits by , and so on. This concept also works the other way around: a bit shift to the right equals a division by . Additionally, bit shifts are also significant for the digital electronics field of registers.How to use the bit shift calculator? You now know what a bit shift is and how to execute a logical shift. So let's take a look at how to use the bit shift calculator. As an example, we will execute a bit shift left. We shift the number in the decimal system bits to the left, using the tool as a left shift calculator. Choose the number of bits in the binary representation. Since 8 bits enable the input of numbers in the range to in the decimal system, this is sufficient for our cause. Choose your input datatype. The bit shift calculator supports numbers from the binary, octal, and decimal systems. We choose decimal. Input your data in the field Number in the corresponding numeral system. For our example, we put here . Choose your shifting direction, either Left or Right, to operate the tool as a left shift calculator or right shift calculator. We choose Left. The bit shift calculator presents your result as numbers from the binary, decimal, and octal systems: binary: octal: decimal: Omni is here to help you with the conversion between other bases too: try our decimal to octal converter and our binary to octal converter to learn how we performed those last conversions!In case your binary result starts with a and could therefore be interpreted as a positive result in unsigned notat

omnicalculator.com

This set of Computer Fundamentals Multiple Choice Questions & Answers (MCQs) focuses on Booths Algorithm. 1. Which of the following is used for binary multiplication? a) Restoring Multiplication b) Booths Algorithm c) Pascals Rule d) Digit-by-digit multiplication View AnswerAnswer: b Explanation: The Booths Algorithm is used for the multiplication of binary numbers. It is basically used for the multiplication of 2 signed numbers. This is a very important algorithm in binary arithmetic. 2. One extra bit is added on the left of a binary number, in case of Binary Multiplication using Booths Algorithm. a) True b) False View AnswerAnswer: a Explanation: The statement is true as an extra bit is added when we multiply 2 binary numbers by using Booths. Let us take an example if we multiply 2 * 3. The first step is to obtain the binary equivalents. Hence, 2=10 and -3=01. Now after adding the extra bit 2=010 and -3=101. We add 0 in case of positive numbers whereas 1 in negative numbers. 3. The binary number obtained after applying RSC on 11010 will be ___________ a) 11101 b) 10100 c) 01101 d) 01000 View AnswerAnswer: c Explanation: RSC stands for Right-Shift Circulant. So, whenever the numbers are shifted to the right an extra 0 bit is added to the left. Here, after the right shift of 11010, the number obtained will be 01101. 4. The result of >> of 11001 by 3-bits will be ______________ a) 01000 b) 01111 c) 00011 d) 11111 View AnswerAnswer: a Explanation: >> is the bitwise left shift operator in binary arithmetic. Applying >>(left-shift) by 3-bits on the number 11001 will result in 3 zeroes on the right, i.e., 01000. 5. Booths Algorithm is applied on _____________ a) decimal numbers b) binary numbers c) hexadecimal numbers d) octal Numbers View AnswerAnswer: b Explanation: Booths Algorithm is applied only on signed and unsigned binary numbers. Although, the values of other number systems can be converted to binary, and then the multiplication could be performed. 6. If Booths Multiplication is performed on the numbers 22*3, then what is 3 referred to as __________ a) accumulator b) multiplicand c) quotient d) multiplier View AnswerAnswer: d Explanation: It is referred to as the multiplier. Multiplier is denoted by Q in booths algorithm. 22 is called the multiplicand. These numbers are first converted to their binary equivalents and further the multiplication is performed. 7. What is the default value of accumulator in booths multiplication of two 4-bit binary numbers? a) 0 b) 1 c) 0000 d) 00000 View AnswerAnswer: d Explanation: The correct answer is d because in case of Booths algorithm an extra bit is always added to the binary numbers. The 4-bit binary numbers become 5-bit numbers after adding the extra bit. Accumulator is always assigned 0 bits of the order of the binary numbers whose multiplication is to be performed. 8. What is the value of n in multiplication of 110* 1000? a) 2 b) 3 c) 4 d) 0 View AnswerAnswer: c Explanation: In Booths, n denotes the number of bits that the higher binary number has when multiplication is performed. Here, since there are 4 bits in 1000, the answer is n=4. 9. What will be the value obtained after multiplication of (-2) * (-3) using Booths Algorithm? a) 6 b) -6 c) -2 d) -3 View AnswerAnswer: a Explanation: After applying the procedure of Booths Algorithm, the value obtained will be 6. Even though the result is obtained in its 2s complement for but then it is reconverted to its normalized form. Also, the value obtained after decimal multiplication is the same as the value obtained after binary multiplication. 10. What does the data transfer instruction STA stand for? a) Store Accumulator b) Send Accumulator c) Send Action d) Store Action View AnswerAnswer: a Explanation: STA is a data transfer instruction given whenever a value is to be copied on the accumulator. It is used for the fetch operation. Sanfoundry Global Education & Learning Series Computer Fundamentals. To practice all areas of Computer

sanfoundry.com

Computer Fundamentals Multiple Choice Questions on Booths Algorithm. 1. Which of the following is used for binary multiplication? a) Restoring Multiplication b) Booths Algorithm c) Pascals Rule d) Digit-by-digit multiplication Answer: b Clarification: The Booths Algorithm is used for the multiplication of binary numbers. It is basically used for the multiplication of 2 signed numbers. This is a very important algorithm in binary arithmetic. 2. One extra bit is added on the left of a binary number, in case of Binary Multiplication using Booths Algorithm. a) True b) False Answer: a Clarification: The statement is true as an extra bit is added when we multiply 2 binary numbers by using Booths. Let us take an example if we multiply 2 * 3. The first step is to obtain the binary equivalents. Hence, 2=10 and -3=01. Now after adding the extra bit 2=010 and -3=101. We add 0 in case of positive numbers whereas 1 in negative numbers. 3. The binary number obtained after applying RSC on 11010 will be ___________ a) 11101 b) 10100 c) 01101 d) 01000 Answer: c Clarification: RSC stands for Right-Shift Circulant. So, whenever the numbers are shifted to the right an extra 0 bit is added to the left. Here, after the right shift of 11010, the number obtained will be 01101. 4. The result of >> of 11001 by 3-bits will be ______________ a) 01000 b) 01111 c) 00011 d) 11111 Answer: a Clarification: >> is the bitwise left shift operator in binary arithmetic. Applying >>(left-shift) by 3-bits on the number 11001 will result in 3 zeroes on the right, i.e., 01000. 5. Booths Algorithm is applied on _____________ a) decimal numbers b) binary numbers c) hexadecimal numbers d) octal Numbers Answer: b Clarification: Booths Algorithm is applied only on signed and unsigned binary numbers. Although, the values of other number systems can be converted to binary, and then the multiplication could be performed. 6. If Booths Multiplication is performed on the numbers 22*3, then what is 3 referred to as __________ a) accumulator b) multiplicand c) quotient d) multiplier Answer: d Clarification: It is referred to as the multiplier. Multiplier is denoted by Q in booths algorithm. 22 is called the multiplicand. These numbers are first converted to their binary equivalents and further the multiplication is performed. 7. What is the default value of accumulator in booths multiplication of two 4-bit binary numbers? a) 0 b) 1 c) 0000 d) 00000 Answer: d Clarification: The correct answer is d because in case of Booths algorithm an extra bit is always added to the binary numbers. The 4-bit binary numbers become 5-bit numbers after adding the extra bit. Accumulator is always assigned 0 bits of the order of the binary numbers whose multiplication is to be performed. 8. What is the value of n in multiplication of 110* 1000? a) 2 b) 3 c) 4 d) 0 Answer: c Clarification: In Booths, n denotes the number of bits that the higher binary number has when multiplication is performed. Here, since there are 4 bits in 1000, the answer is n=4. 9. What will be the value obtained after multiplication of (-2) * (-3) using Booths Algorithm? a) 6 b) -6 c) -2 d) -3 Answer: a Clarification: After applying the procedure of Booths Algorithm, the value obtained will be 6. Even though the result is obtained in its 2s complement for but then it is reconverted to its normalized form. Also, the value obtained after decimal multiplication is the same as the value obtained after binary multiplication. 10. What does the data transfer instruction STA stand for? a) Store Accumulator b) Send Accumulator c) Send Action d) Store Action Answer: a Clarification: STA is a data transfer instruction given whenever a value is to be copied on the accumulator. It is used for the fetch operation.

engineeringinterviewquestions.com