Please read the questions carefully. No pseudoinstructions are allowed (the only exception was mentioned in class). You

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Please read the questions carefully. No pseudoinstructions are allowed (the only exception was mentioned in class). You

Post by answerhappygod »

Please read the questions carefully.
No pseudoinstructions are allowed (the only exceptionwas mentioned in class).
You have the following
struct ProductionUnit{ unsigned short yield; short id; bool active;};
ProductionUnit units[1000];
Convert to MIPS the following piece of code
for( int i{0}; i<1000;i++ ) if( units.active ) totalSum +=units.yield;
The value of totalSum is already in$s7 and is already initialized to zero.The address of units is already loadedin $s0.All data members of ProductionUnit are stored inmemory next to each other (no padding) and in the same order inwhich they are declared.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply