Question

Using either a register lifetime graph or colored graph, determine the minimum number of registers needed for the basic block

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The answer is 3.

The variable i can be stored in r1 as, r1<- i. Similarly, r2<-t, r3<-c.

Now we can write the first line of code as,

r2=r1 *r2 + r3.

Now the register r3 is free and we can use it for future. So r3<-o;

The second line of code can be written as,

r3= r3 * r1. The value of b is now stored in register r3.

The third line can be now written as,

r3 = r3/r1; where r1, r2 and r3 are register variables.

Add a comment
Know the answer?
Add Answer to:
Using either a register lifetime graph or colored graph, determine the minimum number of registers needed...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1) Assume the registers are initialized to the indicated values: Se al A c and code...

    1) Assume the registers are initialized to the indicated values: Se al A c and code frogments MUST use 32 ぁ ar movennes (anor be "nedfra-ne ibrary function or procedural calls ino- Pe Peue c for ll codr ond code frogments only othu ey document your code with Comments unless the code size is Drow Fow Chort for any flow of control involving branches and loops Use PoCedures as modules to organize most of the code and code fragments. In...

  • Pick a minimum of 20 observations on any subject. This will include a dependent variable plus...

    Pick a minimum of 20 observations on any subject. This will include a dependent variable plus two independent variables that you may think are either negatively or positively correlated with the dependent variable. List the observed data (include the source). Then do the following: a. State before doing any calculations whether you think they are positively or negatively correlated. What is your rationale? Example: I test for a correlation between the quantity of coffee that people buy (Y) with the...

  • PROGRAM DESCRIPTION Using the given class definitions for either C++, create a minimum heap that stores...

    PROGRAM DESCRIPTION Using the given class definitions for either C++, create a minimum heap that stores integers and and implements a minimum priority queue. (Your program can be "hard coded" for integers - it does not need to use templates, generics, or polymorphism.) Your data structure must always store its internal data as a heap. Your toString function should return a string with the heap values as a comma separated list, also including the size of the heap as well....

  • Introduction to Data Structures programming assignments can be completed either in C++ (preferred) or in Java....

    Introduction to Data Structures programming assignments can be completed either in C++ (preferred) or in Java. In both cases you cannot use libraries or packages that contain pre-built data structures, other than built-in support for objects, arrays, references, and pointers. Classes in C++ and Java can represent anything in the real world. This assignment is to write a class to represent a Date in a Calendar. Date Class Member Variables The following table identifies and describes the purpose of each...

  • *Write a parallel program pie.c in C or C++ (pie.cc) for Linux that computes an approximation of the number π using a se...

    *Write a parallel program pie.c in C or C++ (pie.cc) for Linux that computes an approximation of the number π using a series with N+1 terms.* --The series sum is partitioned in T non-overlapping partial sums, each computed by T separate child processes created with the fork() library function.* --This program demonstrates data parallelism and interprocess communication using pipes. Each child process could perform a (potentially) long computation on a separate CPU (or core). Depending on the computer architecture, the...

  • 1. Evaluate the following expressions if p = 8, 9 = 3, and the value of...

    1. Evaluate the following expressions if p = 8, 9 = 3, and the value of the variable found is False. Show your work. . q <= p . not (p == 4-5) . q != p % 5 . found or p > 5 and q == p + 5 2. Are you able to draw the truth tables for AND, OR, and NOT logical expressions? - Translate the following problem descriptions into Python. 3. If score is greater...

  • C++ only. PROBLEM STATEMENT: A review and extension of cs132:sort a file with 120 records. However,...

    C++ only. PROBLEM STATEMENT: A review and extension of cs132:sort a file with 120 records. However, due to memory restrictions only 20 records may be placed into memory. You are to implement a “quasi” external sort CODE/DIRECTIONS: For the sake of simplicity, and without much loss of generality, we will say for this lab are records are just ints : thus sort a file with 120 ints where only 20 ints maybe placed into memory at any one time general...

  • ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) NeedByEvent(Event) CRPrevState(CRID, CRState, StartDate, EndDate) CRAssigned(CRID, EmpID, StartDate, EndDate)...

    ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) NeedByEvent(Event) CRPrevState(CRID, CRState, StartDate, EndDate) CRAssigned(CRID, EmpID, StartDate, EndDate) Employees(EmpID, FirstName, LastName, JobTitle) ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) The CRID is the primary key, it is unique, and it is an positive integer The CRType may be one of two values: "Deficiency" or "Enhancement" CRTitle is a variable length string that may be up to 2048 characters CROriginDate is a date CRPriority is an integer that may assume a value of...

  • Background: The first step towards helping someone 'decode' a message is often to count how many...

    Background: The first step towards helping someone 'decode' a message is often to count how many times each letter of the alphabet appears in the message. Then divide each count by the total number of letters to compute the relative 'frequency'.   From these frequencies, it may be easier to recognize which letters are assigned to the vowels. For your own reference, here is a table of standard letter frequencies from typical English text. (You do NOT need to display this...

  • Lab 4: Java Fundamentals, Part IV In this assignment, you solve a conversion problem similar to...

    Lab 4: Java Fundamentals, Part IV In this assignment, you solve a conversion problem similar to Programming Challenge 1 of Chapter 3 of your text, page 184 (187 in Edition 5). Given one of the Roman numerals I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, XIII, XIV, XV as an input your program must determine and display the corresponding decimal digit 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT