Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++. Please read instructions carefully. Also, post a snipit of RESULTS. For the code please DO NOT post a snipit. Please post a brief

Using C++.

Please read instructions carefully. Also, post a snipit of "RESULTS". For the code please DO NOT post a snipit.

Please post a brief description of how to compile and run the code.

Thank you..

2.2. Intermediate Results

When you calculate the long division, a number of intermediate results will be generated. From the example shown in 17b-CRC Example.pptx, we can see the message is 0x5AE, which can be translated in to 010110101110 and the polynomial is 10011. Then we can express the long division in a table form as shown in Figure 1. The first row is the padded message. In the second row, we line up the polynomial with the leftmost 1. The third line is the result of the first XOR operation. The black digits are the XOR results and red zeros in the row are fillers. In the fourth line, more bit or bits of the message is brought down until it reaches the length of polynomial. Then the long division goes on in the similar way until all the bits have been brought down and calculated. For this example, the final result (remainder) is 100. So the CRC checksum is 0100 (One 0 needs to be added to the left of the remainder to reach the length of the polynomial, which is 4). So in this assignment, you are required to show the rows of XOR results. As shown in Figure 1, the filler 0s (in red) should be used to indicate the position of the XOR result (in black). Although Figure 1 shows a two-dimensional table, you are not required to use matrix to record your intermediate results (i.e. XOR results). You may choose to use a vector and print out the XOR result at every step of the long division.

image text in transcribed

Figure 1: CRC Long Division in Table Form

2.3. Two-part Process

This assignment contains two parts: CRC calculation and CRC verification. Although they have different purposes, they share the same principles. Once the CRC calculation is done, the CRC verification can re-use the CRC calculation procedure to generate the verification results. The results of both parts will be printed on the screen. To the basic procedure including the input and output requirements is shown as below:

Step 1: Prompt the user to enter the message in hexadecimal format

Step 2: Translate the message from Hex to binary and print out the binary message

Step 3: Print out modified binary message (with padding) and given polynomial in binary

Step 4: Calculate CRC and print out intermediate results

Step 5: Print out CRC value and print out the input message with CRC attached in Hex format

Step 6: Start the verification and prompt the user to enter the message in hexadecimal format. One can enter the complete message generated in Step 5 or modified message (i.e. changing one or two bits in Step 5 message)

Step 7: Translate the message from Hex to binary and print out the binary message

Step 8: Calculate CRC for the input message

Step 9: Examine the CRC value. If the result is all-zeros, print out a successful message. Otherwise print out a failure message. You are required to run at least one successful and one failed CRC verification.

Based on this procedure, the possible modules or function blocks you need to generate for this assignment include CRC calculation module, XOR operation module, hex to binary module, binary to hex module as well as input and output (i.e. print out). Note: although bit level XOR is provided in the programming language, in the assignment we are dealing with characters that can be input and output to the screen. So most likely you will work with ASCII characters. So even if you want to use bit level XOR offered by the programming language, you still have to go through certain converting process. Or you can generate your own XOR operation on character level.

You are required to comment your codes to help TAs understand your process. You will also generate a report to describe your programs briefly and explain how to compile/run your program. Your report should include the screenshots to show the output results. For verification, you should include screenshots for at least one successful and one failed CRC verification

1 010 0000 0 Padded message010 Polynomial XOR result 1010|1| 00010 0 0 00 00 00 0 0 Bring down more bits |1|0|0|1|1 XOR result 00 0 0 0 1010 00 0 0 0 00 101 1|0|0|1|1 XOR result |10|01| XOR result |0|0|0|0|0|0|0|0|0|0|011. O101010 1|0|0|1 Figure 1: CRC Long Division in Table Form 1 010 0000 0 Padded message010 Polynomial XOR result 1010|1| 00010 0 0 00 00 00 0 0 Bring down more bits |1|0|0|1|1 XOR result 00 0 0 0 1010 00 0 0 0 00 101 1|0|0|1|1 XOR result |10|01| XOR result |0|0|0|0|0|0|0|0|0|0|011. O101010 1|0|0|1 Figure 1: CRC Long Division in Table Form

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

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

Students also viewed these Databases questions

Question

Evaluate employees readiness for training. page 275

Answered: 1 week ago