Lab Task #1 You are a detective. You have received the latest intelligence data on the target. The messages might have c

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Lab Task #1 You are a detective. You have received the latest intelligence data on the target. The messages might have c

Post by answerhappygod »

Lab Task #1
You are a detective. You have received the latest intelligence data on the target. The messages might have changed unintentionally when traveling through the network. You must implement CRC-3 to discover if the data you've obtained is error-free. Your polynomial is x^3 + x + 1. Each message is at most 29 bits long. Good luck!
This is what you are given:
The variable polynomial is the decimal representation of x^3 + x + 1. The array data contains information about latitude, longitude, and elevation of the target. The array crc contains the original calculated CRC-3 for the data.
Go through the data array and calculate the CRC-3 for each item in the array. Compare your calculation with the provided one in the crc array. Print [OK] or [FAILED] accordingly. If the calculations do not match, print the calculated CRC and expected CRC. Print the steps required to get to the calculated CRC.
In order to calculate the CRC-3 we are going to create a function crc3(). This function returns the check value of the CRC-3. We use printSteps to aide in our debugging. When set to true, it prints the binary steps.
The following function prototype is given:
Example output is shown below for reference.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply