


A user wrote a piece of Java code (2 instructions in C++ JAVA), which is in Level 4 int sum – O: for (i=0; i<10; i++) Please answer the following questions 1.145 points) — Level-3 & Level-2 .) Translate the above Level 4 code into Level-3 code (in LVM language) b) Translate your work at Level 3 to Level-2 code (in UVM machine language) c) Count how many UJVM instructions are used to run those 2 JAVA intructions 2.[45 points)-Level-1 a) Your above work has to be carried out by a series of Mic-instructions. Count the number of Mie Instructions are used to to interpret (execute) the above UVM code b) Assume this computer is driven by a 4-G# clock (CPU speed). How many clock cycles are needed to run this the user’s code? c) How much time is needed to run the above 2C++ JAVA sentences on this computer 3. [10 posts) The designer decides to add one more UVM instruction, POP, to the system (Level 3 and 2), which pops the the top words from stack. Please help design a Mi-I microprogram segment that executes interprets this POP3 LVM instruction (note: don’t forget to adjust SP and TOS registers) T060 SP TOCA Current stack Stacker POP3 We structure computer as series of abstractions (levels), and each abstraction (level) builds on the one below it. We are designing a computer and decide to adopt the following five-level structure. Level 4: High-level Programming Language C+/Java Level 3: Assembly Language LVM Level 2: Machine Language (UVM) Level 1: Micro-Machine Mic-1 (Microprogramming Language) Level 0: Gates and Circuits A user wrote a piece of C++/Java code (2 instructions in C++/JAVA), which is in Level-4: int sum = 0; for (i=0; i<10; i++) sum = sum + i; Please answer the following questions. 1. [45 points — Level-3 & Level-2 a) Translate the above Level-4 code into Level-3 code (in IJVM language) b) Translate your work at Level-3 to Level-2 code in IJVM machine language) c) Count how many IJVM instructions are used to run those 2 C++/JAVA instructions. 2. [45 points) — Level-1 a) Your above work has to be carried out by a series of Mic-1 instructions. Count the number of Mic-I instructions are used to to interpret (execute) the above IJVM code. b) Assume this computer is driven by a d-GHz clock (CPU speed). How many clock cycles are needed to run this the user’s code? c) How much time is needed to run the above 2 C++ JAVA sentences on this computer? Show transcribed image text A user wrote a piece of Java code (2 instructions in C++ JAVA), which is in Level 4 int sum – O: for (i=0; i
Expert Answer
Answer to A user wrote a piece of Java code (2 instructions in C++ JAVA), which is in Level 4 int sum – O: for (i=0; i…