Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem: Left-rotate a 16-bit number N by B bit positions. Could someone please

ID: 3652792 • Letter: P

Question

Problem: Left-rotate a 16-bit number N by B bit positions. Could someone please explain to me how to write out this problem in a Flow Chart. I also need to write this in assembly language. It would be very helpful if you were able to do both or either one. Also, a friend of mine managed to figure out how to left rotate it but for some reason it would drop a 1 after a few complete rotations. For Example: Bit: 1111 0000 1111 0000 Rotated Once: 1110 0001 1110 0000 BUT the result should come out like this: 1110 0001 1110 0001 Could you also please explain what the problem is? Thank You

Explanation / Answer

#include #define INT_BITS 32 /*Function to left rotate n by d bits*/ int leftRotate(int n, unsigned int d) { /* In nd, first d bits are 0. To put last 3 bits of at first, do bitwise or of n>>d with n d)|(n
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote