Question

3. [40 points, level-2,-3, and-4] this question involves Level-4 “High language level, Level-3 Machine language level (ISA), and Level-2 Microprogramming level. Use the table on next page to answer the following four questions. (a) [10 points] Translate/Java the C++ code segment (I column in the table below, Level-4) into Mie- I LJVM machine language (2nd column, Level-3), assuming i, j, and k are the 1st, the 2nd and the 3rd local variables, respectively (b) [10 points) Translate the code in Mic-1 LJVM instructions you derive from question (a) above (Level-3 symbolic language) into Mic-1 machine instructions (3d column, Level -3 binary language). Please use hexadecimals to represent machine language instructions (c) [10 points] For each Mic-1 machine instruction in Column 3, in Column 4 write the number of Mic-1 micro-instructions (Level-2) needed to interpret the machine instruction. Dont forget the Main1 micro-instruction (d) [10 points] If the initial values of the three local variables are i-1, j-2, k-0, respectively, how many nanoseconds does it take for a 1-GHz Mic-1 computer to execute this C++ code segment?
media%2F3f1%2F3f1c259b-9db3-4476-91c8-43
0 0
Add a comment Improve this question Transcribed image text
Answer #1

(symbolic notation) (Binary Notation)

ILOAD i   0x15 0x02

ILOAD j 0x150x03

IADD 0x60

ISTORE i 0x360x01

ILOAD k 0x15 0x04

IADD 0x64

ILOAD i 0x15 0x01

BIPUSH 2 0x10 0x01

IADD 0x68

ISTORE i   0x360x01

ILOAD i   0x15 0x04

BIPUSH 5    0x10 0x02

IF_ICMPQ L1   0x9F 0x00 0x0D

ILOAD i     0x15 0x05

BIPUSH 3 0x10 0x05

IADD 0x72

ISTORE i   0x360x02

ILOAD k     0x15 0x06

BIPUSH i   0x10 0x05

ISTORE k    0x360x03

ILOAD i     0x15 0x07

BIPUSH 1   0x10 0x06

L1: ILOAD k 0x15 0x05

BIPUSH 2   0x10 0x06

Total number of instruction required are : 25

time taken=3*1 nanosecond= 3 nanosecond for this condition.

Add a comment
Know the answer?
Add Answer to:
3. [40 points, level-2,-3, and-4] this question involves Level-4 “High language level", Level-3 "Machine language level...
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
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
ADVERTISEMENT