Calculate the crc-15 value for a given file

Assignment Help Computer Engineering
Reference no: EM132208526

Write a program that calculates the CRC-15 value for a given file and which can also verify the correctness of a given file that already has a CRC-15 value appended to it, as more fully described below.

Use the CRC polynomial: x15+x13+ x6+x4+x1+1.

Program operation:

1. The program must compile from the command line.

2. The program executable file name must be "crcheck".

3. The program must run from the command line and take two (2) command line parameters.

4. The first command line parameter will be a flag value that identifies the mode of operation: "c" for calculating a CRC value, or "v" for verifying a CRC value. Only these two values are allowed.

Any other values should produce a simple error message and a graceful exit from the program.

5. The second command line parameter will be the name of the file to be examined. The file should be a text file that is in the same folder as the program executable. If the file is not found,

the program should issue a simple error message and exit gracefully.6. The program should direct all output to the command window (terminal) screen.

The details of what to output are described below.7. The program MUST run on Eustis. Please make sure to test your program on Eustis before submitting the assignment.

What to submit:

Submit a single source code file written in C, C++, or Java. No other languages are permitted.

• The source code file must be a .c, .cpp, or .java file.

• Put all classes, functions, and methods in the one file.

• If programming in Java, do not place the source in your own package so our test scripts can run without changes.

• If you are coding in C or C++, you must use only the standard libraries, such as stdio.h, math.h, and Standard Template Library.

Program Submission Instructions:
• You must submit your source code file plus a README file

• The source code file must be submitted in Webcourses from the assignment page

• All source code must be in exactly one file of type .c, .cpp, or .java

• The README file must be a text file

• If using Java, your source file must be named crcheck.java. You must also submit a README file, which must be a text file, and which contains:

• The compilation command for your program

• The run command for your program

• Your statement that the program is entirely your own work and that you have neither developed your code together with any another person, nor copied program code from any other person, nor permitted your code to be copied or otherwise used by any other person, nor have you copied, modified, or otherwise used program code that you have found in any external source, including but not limited to, online sources.

Input file format:

Valid input files will be ASCII files that contain printable data. There will be no pad or fill characters in a raw input file.

If an input file contains any invalid data (other than an end-of-file marker), then the program should issue an appropriate brief error message and terminate gracefully.

The raw input file will consist of ASCII data of varying length up to 512 bytes, with the last 8 bytes reserved for the checksum. (Note: The CRC or checksum will be a 16 bit integer, or 4 hexadecimaldigits, which will fill the last 4 bytes/characters, the leading 4 characters should be zeroes.)

In the event the input file is not 504 characters (512 - 8) the deficiency should be padded with the "." character - as shown in the examples below. Note that the "." character will affect the generated CRC.

Output format:

Output the ASCII file that is read, 64 characters to a line. Alphabetic characters in this output must be represented as it was read from the input file, regardless of case.

Next, you will show the result of each 64 characters line's cumulative XOR operation involved in the CRC calculation or verification. For example:

abcdefghijklmnopqrstuvwxyz12345-ABCDEFGHIJKLMNOPQRSTUVWXYZ12345a - 0000206c

Note that the input is shown in black and the line's CRC is shown in red. (There is no need to use color in the output for the assignment.)

At the end, when calculating CRC, you must show the CRC result in hexadecimal. Please note that in the event the input file is less than 512 characters, you must pad the remainder of the output file with blank spaces reserving the last 8 characters for the ASCII representation of the CRC, with leading zeroes as needed to obtain a 16-bit value for the CRC-15 code.

On the other hand, if verifying CRC, you must output (a) the accumulated CRC value in hexadecimal at the end of each 64 character output of the input file including pad spaces and the stated hexadecimal CRC (Note that the CRC even though it is hexadecimal data it will be printed in ASCII.); (b) the CRC (hexadecimal) calculated by the program; and (c) a message whether the CRC check passed or failed.

Reference no: EM132208526

Questions Cloud

What is the optimum quantity of goods : Assuming x is a pure public good, derive the total marginal benefit function. What is the optimum quantity of x if the marginal cost of producing it is 50.
Calculate the length of queue at the bottleneck : Let us consider the bottleneck model discussed in the class. Let us give specific values for the parameters in the model.
Calculate the final or interim grades for the class : The calculation would involve points obtained by a number of students in various assignments, quizzes, projects, midterm exams and the final exam.
Would black income-wealth have been higher today : If immigrants are self-selected for high ability and tend to marry similar race individuals in the destination country-marriage homogamy-would black income.
Calculate the crc-15 value for a given file : Calculates the CRC-15 value for a given file . The program must run from the command line and take two (2) command line parameters.
Find her optimal consumption in both periods : Dawna lives for 2 periods - 0 and 1. She earns income I0 = 280 and I1 = 310 and consumes C0 and C1 respectively. She can either borrow or save.
Find the smallest and largest entries in the list : Write a program called SCAN to scan a list of unsigned bytes and find the smallest and largest entries in the list.
Calculate the new pay and write to an output file : Calculate the new pay and write to an output file with employee name and new salary. Format the numbers to display 2 decimal places.
Review problem of history of economic thought : "At times, smith's writing strike the reader as ambiguous, if not contradictory. This is particularly true of his analysis of value, specialization.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Does your company have a current disaster recovery plan

Does your company (or school) have a current disaster recovery plan? What are some of the activities involved in it? Do you feel confident that your company.

  You are working with php a general-purpose server-side

you are working with php a general-purpose server-side scripting language that allows you to add a lot of function

  Describe the kind of input and the methods used

Add comments to each program describing the kind of input and the methods used. Print a copy of each program.

  How would you test whether the coins are fair

Now suppose that ten coins are each tossed ten times, for a total of 100 tosses. How would you test whether the coins are fair?

  Write a java method is primenum that takes the number n

Write a java method is PrimeNum that takes the number n, and checks whether the number is prime or composite.

  Identify and explain some different types of risks

Identify and explain some different types of risks that a computer network environment might face. What are some ways that these risks can be mitigated?

  Define sentence as a sequence of words followed by a period

We define a sentence as a sequence of words followed by a period, exclamation mark, or question mark.

  Determine the ratio of the heat transfer rate

Consider a 3-m-high rectangular enclosure consisting of two surfaces separated by a 0.1-m air gap at 1 atm. If the surface temperatures across the air gap.

  A class named customerrecord that holds customer number

create a class named CustomerRecord that holds a customer number, name, and address. Include methods to set the values for each data field and output the values for each data field. design the class diagram and write the code (not language specifi..

  Provide an algorithm for constructing a tree-cpd

Provide an algorithm for constructing a tree-CPD that is the reduced tree reduced for a given context c.

  Obtain a single digit to generate a numerology report

Write a program that will add the digits of a person's birth date to obtain a single digit to generate a numerology report.

  Write the time complexity of your algorithm in terms

Write an algorithm called Find-Largest that finds the largest number in an array using a divide-and-conquer strategy.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd