Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please comment your code comments Prerequisite Reading: Chapters 1-7 Revised: June 22,2021 Background l : Reversing the order of bits is needed when computing a

image text in transcribedPlease comment your code comments

Prerequisite Reading: Chapters 1-7 Revised: June 22,2021 Background l : Reversing the order of bits is needed when computing a Cyclic Redundancy Check (CRC) to detect errors in digital communications and data storage. Reversing the order of bytes is needed when converting between the Little Endian byte order of the ARM processor and the Big Endian byte order used in Internet packets. These operations are used so pervasively that they must be implemented as efficiently as possible; that's why ARM created the REV and RBIT instructions that perform these operations in a single clock cycle. Assignment: Your task is to implement these same operations without using the REV and RBIT instructions. Your solutions should execute as fast as possible, so implementing them with loops is not acceptable. Instead, you need to find the shortest possible straight-line sequence of instructions that will do the reversal. Hint: You may find the . rept directive to be useful. The main program will compile and run without writing any assembly. However, your task is to create equivalent replacements in assembly language for the following two functions found in the C main program without using the RBIT, REV, REV16 or REVSH instructions. The original C versions have been defined as "weak" so that the linker will automatically replace them in the executable image by those you create in assembly; you do not need to remove the C versions. This feature allows you to write and test one assembly language function at a time. uint32_t ReverseBits(uint32_t word) ; Returns a result that corresponds to reversing the order of all the bits in its input. uint32_t ReverseBytes(uint32_t word); Returns a result that corresponds to reversing the order of all the bytes in its input. Test your functions using the C main. If your code is correct, the display should look similar to the following image, with the dark green cells representing l's that rotate through the bit pattern. An incorrect result will display the incorrect bit pattern in red, pause the program, and wait for you to press the pushbutton to proceed. The execution time of each of your functions is displayed in clock cycles

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+6 Who is the peer of the IA ?

Answered: 1 week ago

Question

=+herself to in terms of equity with regard to this assignment?

Answered: 1 week ago

Question

=+ What typical employee will the IA compare him/

Answered: 1 week ago