The assignment will be graded out of 100 points. Submit a ZIPPED file (no other formats will be accepted) called assignment3.zip, containing the following three documents:
IMPORTANT: By submitting your answers, you are certifying that you have followed the UTA standards of academic integrity, and that these answers have been exclusively your own work. All students enrolled in this course are expected to adhere to the UT Arlington Honor Code:
I pledge, on my honor, to uphold UT Arlington's tradition of academic integrity, a tradition that values hard work and honest effort in the pursuit of academic excellence. I promise that I will submit only work that I personally create or contribute to group collaborations, and I will appropriately reference any work from other sources. I will follow the highest standards of integrity and uphold the spirit of the Honor Code.
struct record { int age; char name[12]; int department; };Each
int
takes four bytes (32 bits) of memory. Each char
takes 1 byte (8 bits) of memory. Therefore, if an object of type record
is stored in memory, or on file, starting at address base
, it is stored in 20 bytes as follows:
from base to (base+3): age from (base+4) to (base+15): name from (base+16) to (base+19): departmentWrite a program (in C, C++, Java, or Python) that can translate files storing such records between big-endian and little-endian. If you are using C, C++, or Java, your program should take three command line arguments:
number
, input_file
, output_file
. Similarly, if you are using Python, your function should take in three arguments: number
, input_file
, output_file
. Your program should behave as follows:
number
is 0, then the input file should follow
the big-endian format, and the output file should follow the little
endian format.
If number
is 1, then the input file should follow the little-endian format, and the output file should follow the big endian format.
input_file
, in the format specified by number
, and save those records to output_file
, again in the format specified by number
.
record
, and every file location that is a multiple of 20 is the start of a new record.
To help you get started, we provide the following resources:
While we have provided test1_little.bin and test2_big.bin as two test files, we will test your solutions with different test files, so your solution should be able to handle any file following the format we have specified (every file position that is a multiple of 20 is the start of a record).
Submit your solution to this task as a file called (depending on the programming language you use) task1.c, task1.cpp, task1.java, or task1.py. Your solution needs to run on omega.uta.edu, otherwise you will receive at most half credit.
To make it easy to read and modify input and output files using a text editor, our input and output will be TEXT files, not binary files. As an example, consider 7-bit word 1010100.
If you are using C, C++, or Java, your program should take three command line arguments: number
, input_file
, output_file
. Similarly, if you are using Python, your function should take in three arguments: number
, input_file
, output_file
. Your program should behave as follows:
number
is 0, then the input file contains characters that are '0' or '1'. Each chunk of 7 such characters represents an ASCII code in binary. The output file should contain the parity-bit codeword corresponding to such chunk. The The parity-bit codeword is an 8-character chunk of characters that are '0' or '1'.
number
is 1, then the input file contains characters that are '0' or '1'. Each chunk of 8 such characters represents the parity-bit codeword of a 7-bit ASCII code in binary. The output file should contain the original 7-bit ASCII code for each such chunk. This ASCII code should be saved as a string of 7 characters that are '0' or '1'.
To help you get started, we provide the following resources:
While we have provided these test files, we will test your solutions with different test files, so your solution should be able to handle any file following the format we have specified (containing only '0' and '1' characters).
Submit your solution to this task as a file called (depending on the programming language you use) task2.c, task2.cpp, task2.java, or task2.py. Your solution needs to run on omega.uta.edu, otherwise you will receive at most half credit.
Genetic information in all living things is coded as DNA molecules. A DNA molecule is a linear sequence of the four basic nucleotides: A, C, G, and T. The human genome contains approximately 3 * 109 nucleotides in the form of about 30,000 genes. What is the total information capacity (in bits) of the human genome? What is the maximum information capacity (in bits) of the average gene?
A certain computer can be equipped with 1,073,741,824 bytes of memory. Why would a manufacturer choose such a peculiar number, instead of an easy-to-remember number like 1,000,000,000?
Devise a 7-bit even-parity Hamming code for the digits 0 to 9.
Devise a code for the digits 0 to 9 whose Hamming distance is 2.
In a Hamming code, some bits are "wasted" in the sense that they are used for checking and not information. What is the percentage of wasted bits for messages whose total length (data + check bits) is 2n - 1? Evaluate this expression numerically for values of n from 3 to 10.
Back to the list of assignments.