

Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!


Question 1
Given the numbers n1=01010000 and n2=11110111 represented in S&M, calculate the sum of the values, eventually indicating if there is overflow.
Question 2
The parallelism of a given memory is 8 bits. Determine the width of an address BUS capable of handle a memory of 64kB.
Question 3
Highlight what are the main differences between main memory and the mass memory.
Question 4 (PROGRAMMING) It is required to write a C program to evaluate the opportunity to recover marine archeological finds. The program is able to process a map , which indicates for each position the maximum hydrostatic pressure for a specific ocean area. The map is described by a NN square matrix of positive real numbers between 0 and 1000 that indicate the hydrostatic pressure. The program also processes another file containing the information about the marine archeological finds, indicating the find position in the map, the find volume, and the find weight. The software must be able to identify how many marine archeological finds are recoverable by a submarine without damaging it, considering its resistance to the depth and the maximum weight to allow the submarine to return to the surface with the collected finds.
Write a C program able to process the map of the marine hydrostatic pressure with N=15. The name of the file containing the map is specified as the first argument of the command line. A second file passed as the second argument of the command line contains the types of finds that are identified to be recovered. The finds can be at most 150 and have the following format:
Row and column are two integers indicating the position of the find, and the weight is a real number.
The program shall receive two additional parameters on the command line that are: the maximum pressure that the submarine can tolerate, and the maximum weight that can be accumulated in the compartment to return to the surface.
The program shall:
Examples of file (a map with N=5 has been used for convenience): SEA_map.txt 14.7 18.5 12.9 43.4 80. 24.5 38.5 45.4 94.5 123. 37.9 56.5 94.6 184.4 243. 34.6 75.3 96.4 194.8 210. 65.8 88.5 91.4 144.1 234.
finds_1.txt 6 4 20. 4 1 10. 0 0 20. 3 3 12. 0 4 80. 1 1 32.
C:\prog.exe SEA_map.txt finds_1.txt 120 40 Finds not found in the area SEA_map.txt 6 4
Finds not recoverable for excessive pressure: 3 3 Pressure: 194. Dive 1: 4 1
Dive 1: 0 0 Find 0 4 Excessive weight Dive 2: 1 1