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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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