ECE 5484: Fundamentals of Computer Systems | My Assignment Tutor

Virginia Tech ■ ECE 5484: Fundamentals of Computer SystemsProject 2 AssignmentPrefaceBefore starting this project, please be sure that you have completed all of the followingactivities.䡦 Read Chapter 4 of the textbook and view the associated online lectures to gain anunderstanding of the MARIE computer organization, instruction set, and assemblylanguage programming constructs. Note that you can utilize any of the instructions inMARIE’s full instruction set.䡦 Review the course syllabus and be sure that you understand grading and submissionpolicies.䡦 Review the course schedule to understand the due dates for this and otherassignments.䡦 Review the Graduate Honor System at https://graduateschool.vt.edu/academics/expectations/graduate-honor-system.html. Review the Graduate Honor SystemConstitution, especially Articles I (Sections 1, 2, and 3), V, VI, VII, VIII, and IX.䡦 This project should be completely your own work. You are welcome to discuss highlevel aspects of the project with others and you are encouraged to the Projectdiscussion area on the class website for this. Any questions concerning design detailsmust be directed to the instructor or graduate teaching assistant.䡦 Download the MARIE simulator (MarieSim.jar), which allows you to observe thecontents of registers and memory while running a program. The MARIE simulator isavailable for free at: http://www.jblearning.com/catalog/9781284123036/. It isrequired to complete this project assignment. Also, note that the Marie simulatorrequires Java version 5 or later to be installed on your computer. You will not be usingthe datapath or memory simulators that are also available at this site.1. IntroductionThe objective of this project is to reinforce your understanding of computer organization,instruction set architectures, and assembly language. You will accomplish this by writing,analyzing, and debugging an assembly language program for the MARIE processor.You must: (i) design and write an assembly language program for the MARIE processor thatinputs, transforms, stores, and then outputs a sequence of characters from the set A-Z; (ii)debug and test your program by simulating it using the MARIE simulator; (iii) document yourwork in a short report; and (iv) submit the report file (*.pdf), assembler source file (*.mas),assembler listing file (*.lst), and assembler executable file (*.mex).2. The MARIE SimulatorThe MARIE simulator is provided as a zip file containing Java archives (*.jar) files,documentation, and example source files. Unzip the file to a directory for use. Do thefollowing to become familiar with the MARIE simulator.• R e a d “ A Q u i c k S t a r t G u i d e f o r t h e M A R I E M a c h i n e S i m u l a t o rEnvironment” (QuickGuide.pdf provided in the zip file).ECE 5484 ■ ■ Project 2 Page 1 of 5• Depending on how comfortable you are with using the MARIE simulator after readingthe quick start guide, you may also wish to read “A Guide to the MARIE MachineSimulator Environment” (MarieGuide.pdf provided in the zip file).• Review the example assembly language source files and experiment with the MARIEsimulator using these examples. The Ex4_3.mas and Ex4_4.mas examples are likelythe most relevant to this assignment.3. Design SpecificationYou are to design, write, test, and debug a MARIE assembly language program that inputs asequence of characters from the set A-Z (capital letters only), stores each character inmemory after it is transformed by the trivial ROT13 cipher, and then, after character inputcompletes, outputs the transformed characters.A template source code file (Project-2_Start.mas) is provided with this assignment. Edit thisfile to create a program that meets the program specifications. Note that the templateincludes instructions to initialize some working values that your program can use. Thetemplate also defines memory locations. You may add data memory locations. The programcan be designed without additional data locations, but it may be necessary to do so for yourdesign.For full credit, your solution must perform the functions and satisfy the requirementsspecified below.a) The first instruction of the program must be placed at location (address) 0x100 (100hexadecimal) in MARIE’s memory. This is accomplished by following the programtemplate that is provided.b) The constant data values (One, ChA, ChZ, ChPer, Val13, Start) should not bechanged by the program. The program can load from these memory locations, butshould not store to them.c) Transformed input characters must be stored in successive memory locations beginningat location 0x200 (200 hexadecimal) as indicated in the program template. Theprogram should store all transformed input characters before any characters areoutput.d) The program should always initialize the values for Ptr in the working data memoryand not rely on the values for these locations that are defined in the assembly sourcefile. This initialization is done by the provided template file.e) The program should work for any inputs ‘A’ through ‘Z’ and ‘.’ (a period terminatesinput). In the interest of keeping the program simple, the program does not need tovalidate inputs.f) When transformed characters are stored and when transformed characters are output,the program must use a loop and indirect addressing to access the values in the arrayof words. Note that variable Ptr is initialized in the template code and should beused in the loop. You may also define a Count variable to count the number ofcharacters, but there are also correct designs that do not require a Count variable.g) The program should operate as follows.Input Phase:1. A character (A-Z or ‘.’) is input. MarieSim allows the user to input a singlecharacter that is read into the accumulator (AC) with an Input instruction.2. If character ‘.’ (period) is input, then the input phase ends and the outputphase begins (step 5 below). (The period may be stored in memory to mark theECE 5484 ■ ■ Project 2 Page 2 of 5end of the characters or the characters can be counted to determine how manytransformed characters to output during the output phase.)3. The character that is input is transformed using the trivial ROT13 cipher (seeSection 5.1).4. The transformed character is stored in the next location in the block ofmemory beginning at location Start. (Variable Ptr must be updated andindirect memory addressing must be used.)Output Phase:5. All transformed characters are output, beginning with the first character thatwas transformed. The ‘.’ character is not to be output. (This will require aloop using variable Ptr and indirect addressing. Note that the number ofcharacters to output will vary and the program must know when to stop theoutput by relying on a ‘.’ or other special character in memory, counting thenumber of input characters during the input phase, or some other method.)6. After all characters are output, the program halts by executing the HALTinstruction.4. TestingTest and debug the program using the MARIE simulator (MarieSim.jar). Debug the programusing the “Step” and “Breakpoint” features of the simulator. You must test your program withthe following two test cases.Test 1: Input the eight-character sequence “VIRGINIA” followed by a ‘.’ to terminate theinput. Note that you need to input one character at a time into MarieSim’s ASCII Inputarea, with each character followed by pressing the “Enter” key. The ROT13 value of eachcharacter (“IVETVAVN”) should be displayed after the ‘.’ character is input.Test 2: Restart the program in MarieSim, without reassembling, then input the fourcharacter sequence “GRPU” followed by a ‘.’ To terminate the input. Note the output.When you create your source file within MarieSim (using the File > Edit menu pick), use filename lastname_firstname_P2.mas, where “lastname” is your last or family name and“firstname” is your first or given name. You can assemble your source file in the editorprogram. The assembly process creates a listing file (lastname_firstname_P2.lst) and anexecutable file (lastname_firstname_P2.mex). Load the executables file into the simulatorfor execution.5. Design Notes5.1. The ROT13 CipherThe ROT13 cipher (see http://en.wikipedia.org/wiki/ROT13) is an old, but trivial cipher thatsimply rotates the characters by 13 positions. For example, ‘A’ is transformed to ‘N’ and ‘Z’is transformed to ‘M’.The Project-2_Start.mas source file includes a ROT13 subroutine that almost performs thistransformation. You need to fix one bug in the subroutine.5.2. Tips for Program Design and DebuggingHere are some suggestions to keep in mind as you design and implement your program.• Design and test your program in an iterative manner, building from simplefunctionality to full functionality. For example, first write a program that inputscharacters and just stores them in memory. Then, add the code to transform theECE 5484 ■ ■ Project 2 Page 3 of 5characters using ROT13 before they are stored (and fix ROT13). Then complete theprogram by adding code to output the transformed characters.• Study sample code in the textbook. For example, Example 4.4 (page 254) providescode that traverses and outputs a string. (Sound familiar?) Example 4.5 (page 255)shows code that calls a subroutine. The operand used with the Skipcond instructionis a source of frequent errors, so study the examples, such as Example 4.4 (page 254),to be sure you understand how to specify the operand for Skipcond.• Correct solutions for the project require that about 25 to 30 instructions are added tothe template. If you find that you are using significantly more instructions than this,you should reconsider your design and, as needed, consult with the GTA and/orinstructor.• When debugging your program, set a breakpoint in MarieSim to execute past the inputoperation and then single-step through the program to ensure the code is doing whatyou want it to do.• When debugging and testing, be sure that “ASCII” is selected for the input and outputwindows in MarieSim.• An “Instruction Set Cheat Sheet” can be displayed from the “Help” menu in the MARIEAssembler Code Editor.6. Submission6.1. ReportYou must document the design, simulation, and outcomes in a brief written report. Yourreport should contain the following items.• At the top of the first page of your report, include: your name (as recorded by theuniversity); your email address; and the assignment name (e.g., “ECE 5484, Project 2”).Do not include your Virginia Tech ID number or your social security number.• The body of the report must contain the following sections. Use section numbers andheadings to organize your report.Section 1 – Objectives: Provide a brief summary of the design objectives and generalapproach to the design.Section 2 – Design Description: Describe the high-level operation of the program. Inparticular, briefly describe initialization and the operation of the loop.Section 3 – Testing and Results: Give a summary of the two tests and associatedoutcomes that you obtained using the MARIE simulator. Provide images of one or morescreen captures for Test 1 described in Section 4 above. Your screen capture(s) shouldshow the final results in the output area of MarieSim, and the contents of memorylocations 0x200 through 0x20F from the memory display in MarieSim.Section 4 – Conclusions: Briefly discuss the outcome of your design and any problemsor aspects that do not work properly; what you learned by doing this project; and anyexperiences that were particularly good or bad. Also, specify the approximate numberof hours that you devoted to the project. (The number of hours is just for theinstructor to assess the suitability of this project assignment.)Your writing should be well-organized, concise, and technical in nature. Your report shoulduse complete, grammatically correct English sentences. Use section headings within thereport that match the section names listed above. Every figure and table should have acaption and should be introduced in the body of the report.ECE 5484 ■ ■ Project 2 Page 4 of 56.2. SubmissionCarefully follow these instructions when submitting your project.• Create a single PDF file for your report. Name the PDF filelastname_firstname_P2.pdf, where lastname is your last or family name and firstnameis your first or given name.• Create the source file with file name lastname_firstname_P2.mas. When the sourcefile is assembled, the assembly process will create an executable file(lastname_firstname_P2.mex) and a listing file (lastname_firstname_P2.lst). Save the*.mas, *.lst, and *.mex files for submission.• Submit the four files (*.pdf, *.mas, *.lst, *.mex) in the Assignments area of the classwebsite by no later than 11:55 p.m. on the due date.7. GradingThe project will be evaluated based on the following criteria.• Presentation (20 points)– Complete, clear, and well organized report– Mechanics (spelling, grammar, etc.)• Technical Merit (30 points)– Discussion of design objectives– Discussion of program operation– Discussion of testing– Conclusions• Correct operation (50 points)– Correct operation as verified using the executable (*.mex) file8. Seeking AssistanceThis is not a team project. Your project should be completely your own work. You arewelcome to discuss high-level aspects of the project with others, and you are encouraged touse the Canvas discussion forum for this purpose. Any questions concerning design detailsmust be directed to the instructor. Please refer to the Honor Code statement in the syllabus.ECE 5484 ■ ■ Project 2 Page 5 of 5

QUALITY: 100% ORIGINAL PAPER – NO PLAGIARISM – CUSTOM PAPER

Leave a Reply

Your email address will not be published. Required fields are marked *