Question: Create a MIPS program that fulfills the following specifications: create a plain text file with the sentence: This homework gives practice in MIPS file I/O

Create a MIPS program that fulfills the following specifications: create a plain text file with the sentence:

This homework gives practice in MIPS file I/O and insight into parity. Parity is a means of checking if stored data has been corrupted. Keep in mind that parity checking would really be implemented in circuitry for speed, this is just a simulation and practice in reading files.

Create a MIPS program that fulfills the following specifications:

create a plain text file with the sentence: The quick brown fox jumped over the lazy river. This file must be in the same folder from which you run MARS.

save the name of your file in the data section

use SYSCALLs to open the file, then read it into a buffer in data, then close the file; allocate space for another buffer to contain the text+parity

since the ASCII characters only use 7 bits (6-0), bit 7 is unused; we will use this bit to store parity

even parity bit: set bit 7 to 0 if the ascii code contains an even number of bits; otherwise set to 1

loop through the buffer:

read a byte

set bit 7 for even parity

write the byte to the second buffer

put the code that determines 1 or 0 for the parity bit in a function

then write another function to check the parity

run the program once to check that you get the ok message if the data has not been corrupted

run the program again, set a breakpoint before you jump to the check function and manually corrupt the data as seen in the screen shot below; the first a 1010 was changed to 2 0010 which changed the parity; now the program will print the not ok message

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!