Question: 8. [4 marks] Some processors have an instruction to find the location of the first bit set to 1 within a word (find the first

 8. [4 marks] Some processors have an instruction to find the

8. [4 marks] Some processors have an instruction to find the location of the first bit set to 1 within a word ("find the first one"). Assume that a word is stored in r1. Write an ARM sequence of instructions that puts the location of the first bit in r1 that is set to 1 into r2. Count from the left, so that if bit 31 is set in r1 then the value in r2 will be 0. If only bit Ois set in r1, then the value in r2 should be 31. If no bit in r1 is set, then the value in r2 should be 32. 8. [4 marks] Some processors have an instruction to find the location of the first bit set to 1 within a word ("find the first one"). Assume that a word is stored in r1. Write an ARM sequence of instructions that puts the location of the first bit in r1 that is set to 1 into r2. Count from the left, so that if bit 31 is set in r1 then the value in r2 will be 0. If only bit Ois set in r1, then the value in r2 should be 31. If no bit in r1 is set, then the value in r2 should be 32

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!