- Convert the following formulas from infix to reverse Polish notation. A+B+C-D*
ID: 3573382 • Letter: #
Question
- Convert the following formulas from infix to reverse Polish notation.
A+B+C-D*E
(A+B) / C-(D+E)
- Bus speeds and throughput have increased over time. Aside from the physical space issues, why wouldn’t a designer simply make one very large bus, run it with a very fast clock and put all the devices on it?
- When looking at systems with deep pipelines, how is prediction handled on conditional branches?
- Thinking about what you have read in the book, what issues or concerns would you raise when discussing the creation of a “natural language” programming language (compiler)?
- There is a program that causes a lot of “thrashing” every time it is run. A co-worker suggests I “change” the page replacement policy in my operating system to a FIFO algorithm instead of the LRU algorithm currently being used. Is my co-worker’s suggestion a good one? Why or why not? Knowing the data here, what general comments can be made about the program being run? Give an example of a program construct or property that could be causing the thrashing?
- I have a program that contains code that is 75% “parallelizable” - What effect would a system with 10 processors have on the execution of this code? What about 1000? What about as I approach an infinite number of processors?
- When looking at systems with deep pipelines, how is prediction handled on conditional branches? How about unconditional branches?
Explanation / Answer
1) Convert the following formulas from infix to reverse Polish notation.
----> A+B+C-D*E
Answer is -> AB+C+DE*-
Explnation:- In this type of conversions we have to proceed by cheching with the operator precedence. In the above formulae we have A+B+C-D*E , in this the Multiplication(*) operation has highest precedence so first it wil be calculated or transferred so no the expression is A+B+C-DE*. Then the remainig operators have the same precedence i.e. Addition and substraction has the same precedence so it will be executed from left to right so in the next step the expression will be AB++C-DE*, after that in the next step the expression will be AB+C+-DE*, in the next step the final expression will be AB+C+DE*-. To understand this type of conversions we have to practice by using stack conversion model so that we can easily unsderstand by going through the step by step. Here even i did by using with stack model i was just explained in a normal way.
---> (A+B) / C-(D+E)
Answer is:- AB+C/DE+-
Here in this example the first precedence having across the operators is paranthesis() this () operator has higher precedence above all. so frist the expression between the () is executed first, if we have more than one () in expression then the expression is evaluated from right to left i.e. now in the first step the expression would be (A+B)/C-DE+, then in second step it would be AB+/C-DE+, then / has the highest precedence so in the next / is processed i.e. AB+C/-DE+, in the next step AB+C/DE+- is the final expression evaluation or conversion.
2) Bus speeds and throughput have increased over time. Aside from the physical space issues, why wouldn’t a designer simply make one very large bus, run it with a very fast clock and put all the devices on it?
Answer) Yes that is perfectly alright that if designer can design large bus and put all the devices on it. But once when we thinking about that we have to think about the hardware suitable for it have also need to be designed according to that even if we do that cost of maintainence is high and if there is failure in one point it effects all the business. And it might be very expencive to setup even cost of maintainence also for some small proft oraganisations.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.