(Solved):Write a program to shift the 4-byte number stored in data memory locations 0x10 -0x17 to the left four places. View Answer…

 

Question

Write a program to shift the 4-byte number stored in data memory locations 0x10 -0x17 to the left four places.

 

EXPERT ANSWER

# Python3 code to rotate 32 bits of the number to the left four places.
  
INT_BITS = 32 # number is 4 byte long
  
# Function to left rotate n by 4 bits
def leftRotate(n):
    # uses to shift n<<4, to shift last 4 bits to the left places..
    return

Scroll to top