Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LC-3 pls Your task is to write a program that permutes the bits of the 16-bit data item stored in the memory location Data. How

LC-3 pls

Your task is to write a program that permutes the bits of the 16-bit data item stored in the memory location Data. How the bits will be permuted is defined by memory location WriteStep. Starting with the least significant bit of Data, copy that bit value WriteStep bits from the least significant bit (moving left from the least significant bit) of your result. Now, reading from Data, move one bit to the left and copy that bit another WriteStep bits from where you last wrote a bit in your result, being sure to cycle back to the beginning of the word as required. Repeat until all 16 bits have been copied. See below for a visual example where WriteStep == 7. Test your program with the following values stored in Data and WriteStep (respectively): x0001, 3 (the correct number of rounds, see below, is 8) xA55A, 7 xA5A5, 7 xA5A5, 3 xBEEF, 11 xBEEF, 7 permute example Continue to perform this permuting operation on the resulting word until your result returns to the value in Data. Print the number of such permutation rounds required to return to the original value. Notes: If you start with a result of all zero bits you will only need to copy over the one bits. To copy is to make sure the correct bit is set in the result word. You will need to make use of (portions) of both assignment 1 programming solutions. To read and write bits you will need a bit mask, which you can shift as you are stepping through the words. To shift a bit one location to the left is to multiply the value by 2. You don't need to implement multiplication to do a "multiplication by 2". You can assume that all permutations will require less than 10 rounds. As such, you can use one of the ASCII tricks to convert the number into its ASCII value for printing.

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

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions