only need help on 3 Starting from the 8-bit operand 11001010, show the values ob
ID: 3822147 • Letter: O
Question
only need help on 3 Starting from the 8-bit operand 11001010, show the values obtained after sequential application of each shift microoperation, both left and right, until the contents are all zeros. What is the mask and the operation that needed to be used to change the contents of a register whose current content is 01110101 11101101? a) to invert all the alternate bits (starting from the MSB). b) to set all the alternate bits to 0 (starting from the MSB). c) to set all the even bits to 1 (starting from the MSB). Suppose you want to replace the contents of selective bits of a 16 bit register. What is/are the operations you need to do to replace 7th, 8th, 9th and 11th bits by 0, 1, 1, 0 respectively?Explanation / Answer
First of all, you would need AND operation to reset the bit 7,8,9 and 11. This you can can do by performing an AND operation between 16 bit register and 0xF47F and store it in the register (say A).
Then perform an OR operation between stored value (stored in A) and 0xF77F. This will replace the 7th, 8th, 9th and 11th with 0,1,1,0 respectively.
I have considered the bit position from right to the left in ascending order. The rightmost bit being 0th and leftmost is 15th.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.