Question: 1 . ( 5 0 pts ) The Hamming weight ( HW ) of a binary word is defined as the number of 1 s

1.(50 pts ) The Hamming weight (HW) of a binary word is defined as the number of 1 s that are different from the 0 also known as the population count or popcount for short. For example, the HW of an 8-bit binary word 10101100 is 4(Since, there are four 1 s in the 8-bit word).
a.(30 pts) Write an ARM Cortex M3 assembly code to calculate the Hamming weight of \(10\times 32\)-bit words stored in a memory array with starting address stored in the R1 register. Store the calculated HW result in RO. Explain the execution of your code and provide the screen-shots that show correct operation. You can use any 10 random numbers stored in the memory array.
b.(20 pts) Write a C function to perform the same task. Explain the execution of your code and provide the screen-shots that show correct operation.
2.(50 pts) The Hamming distance (HD) between two binary words \( A \) and \( B \) are defined as the hamming weight of the bit positions in which the words differ. For example, the Hamming distance between \(\mathrm{A}=\)10110101 and \( B=11001111\) is HD =5(Since, two words are different at bit positions \(6,5,4,3,1\) total making \(\mathrm{HD}=5\)).
a.(30 pts) Write an ARM Cortex MO+ assembly code to calculate the Hamming distance between two 32-bit words stored in R1 and R2 registers. Store the HD calculation result in RO. Explain the execution of your code and provide the screen-shots that show correct operation.
b.(20 pts) Write a C function to perform the same task. Explain the execution of your code and provide the screen-shots that show correct operation.
1 . ( 5 0 pts ) The Hamming weight ( HW ) of a

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 Programming Questions!