06 Aug MIPSProject4:
PostfixExpressionCalculatorinHex
AssignedOn:Apr5 th ,2017
DueOn:April26 th ,endoftheday(11:59pm)
–NOLATEDELIVERYACCEPTEDTHISTIME–
WehavediscussedinclassthedetailsofINFIXandbrieflyPOSTFIX.InthisfinalProject,youneedtoimplementa
postfixexpressioncalculator,wherenumbersareinhex,andwitha >>STACK<< ofyourown(ofsize5).With
yourownstack,youareresponsibleofdesigning(coding)theregularstackoperations(suchaspush/pop),aswell
ascheckforoverflow/underflowatappropriateplaces.
Yourprogramwilltaketheuser’sinputasapostfixexpressionwithhexnumbers,useyourownstacktoevaluate
it, and display the result in both hex and decimal forms. The numbers and operations in the expression are
assumedtobeseparatedby(oneormore)spaces.Youcanassumethatnonegativenumberswillbepresentedin
theinputexpression,butintermediateandfinalresultsmightbenegative.
Youhavethreedifferentlevelsofcompletion:picktheONEwithwhichyouaremostconfident:
SilverLevel[80/100POINTS]
Calculateasingle-digitvalidpostfixexpression.Forexample:
9 A – 4 8 + * B / = -1 (dec), -1 (hex)
E 0 A B + 7 / – – = 17 (dec), 11 (hex)
GoldLevel[100/100POINTS]
Samephilosophyofthepreviouslevel,butnowallowingmulti-digitnumbers,detectingillegalpostfixexpressions,
aswellasreportingoverflowforyourstack.Forexample:
3 64 69 – + 1B1 * = -866 (dec), -362 (hex)
F 10E0 10 – + * 4A33 is invalid
F GH 5 – + 4A33 * is invalid
3 F E0 150 52 4EE * – + * overflows my stack of 5
PlatinumLevel[120/100POINTS]
WiththerespecttotheGoldLevel,yourprogrammustsupportrealnumbersininput,suchas10F.DE3.Output
onlyneedstobeindecimalthistime.
ExamplealgorithmofpostfixcalculationforsingledigitnumbersinHex:
a)
Fromlefttoright,gothrougheverycharacteroftheexpression,dothefollowing:
i. ifthecharacterisavaliddigitinHex(0–9,A-F):
converttheASCIIbytetointegerandpushthatnumberontostack
ii. ifthecharacterisanoperation(+-*/):
1. popfromthestackanumber->x
2. popfromthestackanumber->y
3. calculateyopx(for/,usequotientasresultandignoretheremainder).
4. pushtheresultnumberbackontostack
b) Popoutfromstack->finalresult
PAGE 1 of 2
Whattosubmit
Ina*.ZIParchive(mandatory),containing:
1. Yourassemblycodeas*.asmfile;
2. APDFfilecontainingaDETAILEDreportofyourworkdiscussingthephilosophyyoufollowedinsolvingthe
problem,youralgorithmicimplementation+FIVEmeaningfulscreenshotsoftheI/Ooutputwindowfrom
MARS(eventuallyaddafewcommentstodescribethem).
Wheretosubmit
TurninyourworkonBlackboardasAssignment,withintheProgrammingProjectssectionintheCourseMaterial,as
a*.zipfile,containingcodesourcefileinassemblyandreportinPDF.
Gradingcriteriaforthislab
•
•
•
Programfunctionalityandcorrectness(40%);
Labreport(50%)judgedbythewrite-upqualityandinsightfulness;
Codequalityandstyle(10%).
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
