ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 12 May 2017 My Price 9.00

transform the following C program P1

1. transform the following C program P1 (see page 2) into another C program P2 that contains only instructions of the form:

(a) "A = B op C", where A,B,C are simple variables or constants, and "op" is +,-,*, etc. (signifying ADD, SUB, MULT, etc.)

(b) "if(A op B)", where "op" is ==,>,>=, etc (signifying COMPARE)

(c) "goto Label" (signifying JUMP)

(d) "A = B", where A is a simple variable and B is an array variable (signifying LOAD), or A is an array variable and B is a simple variable (signifying STORE)

(e) "scanf()", "printf()" with only one argument (signifying LOAD and STORE, respectively).

to enforce the above, program P2 can contain additional variables that are to be named TMP1, TMP2, TMP3, etc. (these along with all other simple variables are assumed to be in registers) the program is allowed to contain lables.

 

2. introduce instrumentation code into program P2 to count the number of executions ICi of each type of instruction i,as well as the total number IC of all executed instructions, (note that LOAD and STORE correspond to two C forms as given above).

 

3. Execute program P2 for input values d=4,6,7 and print out an analytical summary with the ICi and ICi/IC values for each instruction under each input case.

 

Answers

(11)
Status NEW Posted 12 May 2017 02:05 AM My Price 9.00

-----------

Not Rated(0)