Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assembly Operations A very simple microcontroller has one register, X, which is initialised to 0, and supports only 3 types of microinstructions: LDI v: Load

image text in transcribed
image text in transcribed
image text in transcribed
Assembly Operations A very simple microcontroller has one register, X, which is initialised to 0, and supports only 3 types of microinstructions: LDI v: Load (store) the immediate value, v, into X - ADD v: Add the immediate value v to X and store the result in X. SQR: Square the value of and store the result in A program for this microcontroller is simply a sequence of n microinstructions, each being of one of the 3 types described. For example, the table below llustrates how the value of X would be affected by a short sequence of microinstructions. LDI 5 ADD 2 SQR ADD-4 LDI-3 SQR 49 In an experiment, the microcontroller is going to be sent into outer space, where it will be exposed to high energy cosmic rays, which may cause it to skip one or more instructions in its program. The arithmetic computations and the storage into X have been hardened though, so even when an instruction is skipped, the value of X is retained, and the rest of the sequence continues to execute The researchers would like to know for a given program, executing on this microcontroller in space, what will be the largest possible value that could be stored in X by the time the program halts. Input Format The first line contains a single integer m The next n lines describe the p contains an instruction as described in the problem. rogram. Each of these lines n10 -10 U10 Output Format Print the maximal value of X Sample Input 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

What should Meddevco have done to avoid some of its problems?

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago