This file shows the stock returns from an investment portfolio over a year. The “A” column contains the stock name and the “B” column indicates the returns in USD (You can assume that there are no negative stock returns in any of
our CSV data files
).
iuww520iuww520iuww520iuww520iuww520iuww520iuww520iuww520
You will run the file
lab4_testbench_rv32_rev#.asm
file in RARS which takes
data.csv
as its input CSV file. Doing so will yield the following analysis, based on the calculations made by the assembly files that you will be submitting):
1. Find the total file size in bytes (excluding any metadata generated by your OS) (length_of_file.asm)
2. List the dollar amount of all the input records. (input_from_record.asm)
3. Provide the name of the stock that gives the maximum income. (maxIncome.asm)
4. Provide the name of the stock that gives the minimum income. (minIncome.asm)
5. Calculate the total income generated from all stocks
When you run via RARS
lab4_testbench_rv32_rev#.asm with the .asm files shown above completed by you
, you will get the output console as shown below:
About the Windows CSV file format
To distinguish between each entry/row/record in the spreadsheet format of the CSV file, the following convention is adopted depending on the OS :
Windows - Lines end with a <CR> and a <LF> character
Linux - Lines end with only a <LF> character
Macintosh (Mac OSX) - Lines end with only a <LF> character
Macintosh (old) - Lines end with only a <CR> character
where <CR> is the carriage return (‘\r’) character and <LF> is the line feed/newline (‘\n’) character.
If you open the provided
data.csv
file in Notepad++ on Windows with “Show all Characters” enabled, then you should see the following text showing the placement of the carriage return and line feed characters. .
So, for example, if I were to express record 2 from
data.csv
as a string of characters in RARS, I would write:
“Kramerica,0\r\n”. If you are using an OS that is NOT Windows, it is likely that
data.csv
would not open correctly due to the encoding differences. If you have a text editor like Notepad++ that allows you to see all characters, make sure that the “\r\n” appears for each record in the file as shown in Figure 3. This is the case for the data.csv that we include in the directory.