Starting from:
$30

$24

Assignment 5 Solution

Name:







Direction: Upload your typed solutions in a le named \assignment05.txt" to your Github account.




List and brie y de ne the possible states that de ne an instruction execution with interrupts.






List and brie y de ne two approaches to dealing with multiple interrupts.






Write the following C++ functions for a memory module.



A void function named Initialize() that takes a fstream reference parameter and an int parameter named ram. It rewrites the le referenced by ram with 100 rows of 32-character strings of zero.




A string function named Read() that takes a fstream reference parameter and an int parameter named ram and addr respectively. If addr is between 0 and 99 inclusively, the function returns the line of the le referenced by ram whose value equals addr ; otherwise, it returns an empty string. The rst line starts from 0.




A void function named Write() that takes a fstream reference parameter, a string parameter and an int parameter named ram, data and addr . If addr is between 0 and 99 inclusively, the function writes data on the line equal to addr of the le referenced by ram; otherwise, it does nothing.

More products