CS代考 2022/2/26 ÍíÉÏ8:19 ²âÑé: Exam 1

2022/2/26 ÍíÉÏ8:19 ²âÑé: Exam 1
https://canvas.i
ÒÑ¿ªÊ¼: 2ÔÂ26ÈÕ 20:19 ²âÑé˵Ã÷
This exam is open book, open notes, emulator permitted. Use of the broader Internet (beyond accessing Canvas, notes, textbook, and emulator) is prohibited. Nor may you “work with” other people. Please do not discuss this exam with anybody until after scores are released.

Copyright By PowCoder代写 加微信 powcoder

At the end of the exam, you will be asked to sign an honor pledge; you’re exam will not be graded and you will receive a grade of zero if you fail to complete the pledge.
ÎÊÌâ 1 25 ·Ö
Write an ARMv8 (please restrict yourself to the LEGv8 subset of ARMv8) procedure which takes three parameters: the base address of a sorted array, the number of elements in the array, and a value (call it n), in that order. Your procedure should return the address of the first item in the input array which is greater than or equal to n, In the event that none of the values in the array are greater than or equal to n, return the next address that follows the input array (that is, the address of what would be the next element of the array were the array longer).
We will not run your code. We do not expect perfection. If you have a working idea that shows that you understand how to write code in ARM assembly, you’ll get most, if not all, of the credit for this problem. You may use the emulator, but if you do, don’t let it make you spend too much time on this problem.
Example: If the first parameter is 0x100 (256), the second parameter is 0x8 (8), the third parameter (n) is 0x6 (6), and the 8 64-bit integers that begin at address 0x100 are 0, 2, 4, 4, 6, 6, 7, 9, your method should return 0x120 (288), since the first 6 (the first element greater than or equal to n) is at index 4.
±à¼­ ²é¿´ ²åÈë ¸ñʽ ¹¤¾ß ±í¸ñ 12pt ¶ÎÂä
astate.edu/courses/90477/quizzes/399708/take

2022/2/26 ÍíÉÏ
https://canvas.iastate.edu/courses/90477/quizzes/399708/take 2/9
8:19 ²âÑé: Exam 1
ÎÊÌâ 2 10 ·Ö
You are designing a floating point coprocessor which will execute floating point instructions 5 times as fast as the regular processor with zero overhead. Given a workload that contains 25% floating point instructions, what is the speedup achieved by adding the coprocessor to the system?
Please give the speedup with exact precision.
p 0 ¸ö×Ö
ÎÊÌâ 3 0 ·Ö
For a chance at partial credit, show your work for the previous problem.
±à¼­ ²é¿´ ²åÈë ¸ñʽ ¹¤¾ß ±í¸ñ 12pt ¶ÎÂä

2022/2/26 ÍíÉÏ8:19 ²âÑé: Exam 1
ÎÊÌâ 4 10 ·Ö
Fill in the blanks in the table below. The first row is complete, giving you a full example. All hexadecimal numbers should be given in big-endian byte order (MSB on the left) using two bytes. The first one is done for you as an example
Decimal One’s compliment hex Two’s compliment hex -513 0xfdfe 0xfdff
p 0 ¸ö×Ö
ÎÊÌâ 5 20 ·Ö
https://canvas.iastate.edu/courses/90477/quizzes/399708/take

2022/2/26 ÍíÉÏ8:19 ²âÑé: Exam 1
https://canvas.i
Fill in the blanks by encoding the instructions in this code snippet into ARMv8 machine code. Use binary (base 2) to write your encoded instructions in the blanks.
Carefully count bits in your input! If you omit a bit in an otherwise correct answer, you will not receive full credit.
Canvas will auto-grade your entries. The auto-grader will give credit only for a perfect answer, where “perfect” means an exact string match with the answer entered when creating the exam. We will manually re-grade answers marked incorrect for partial or full credit. Answers that the auto-grader will consider correct consist of a string of exactly 32 zeros and ones with no other characters or spaces.
//No stack manipulation, because we don’t change anything!
CBZ X0, done
SUBI X9, X0, #1
BR LR body:
SUBI SP, SP, #24
STUR X20, [SP, #0]
STUR X19, [SP, #8]
STUR LR, [SP, #16]
// 10110101000000000000000001001001
//Value is already in X0; nothing to copy
CBNZ X9, body
// 11010110000000000000001111000000
// 11010001000000000110001110011100
// 11111000000000001000001110010011
// 11111000000000010000001110011110
//Save paremeter
ADD X19, X0, XZR
//Set paremeter for first call, fib(n – 1)
SUBI X0, X19, #2
//Put return in X0
ADD X0, X0, X20
LDUR X20, [SP, #0]
LDUR X19, [SP, #8]
LDUR LR, [SP, #16]
// 10001011000111110000000000010100
// 11010001000000000000101001100000
// 10001011000101000000000000000000
// 11111000010000000000001110010100
// 11111000010000001000001110010011
// 11111000010000010000001110011110
// 10001011000111110000000000010011
ADDI SP, SP, #24
// 11010001000000000000011001100000
// 10010111111111111111111111110110
SUBI X0, X19, #1
//save return value
ADD X20, X0, XZR
//Set paremeter for second call, fib(n – 2)
astate.edu/courses/90477/quizzes/399708/take

2022/2/26 ÍíÉÏ
https://canvas.iastate.edu/courses/90477/quizzes/399708/take 5/9
8:19 ²âÑé: Exam 1
ÎÊÌâ 6 0 ·Ö
Give the fields (in binary or hex) for each instruction in the previous problem for consideration for partial credit. Please clearly denote which instruction and field you are presenting.
±à¼­ ²é¿´ ²åÈë ¸ñʽ ¹¤¾ß ±í¸ñ 12pt ¶ÎÂä
0 ¸ö×Ö
BR LR // 11010110000000000000001111000000
ÎÊÌâ 7 20 ·Ö

2022/2/26 ÍíÉÏ8:19 ²âÑé: Exam 1
Decode the following instructions. If the instruction is a branch–since the branch target name is lost–simply write the number of instructions (positive or negative) that the jump moves control in the position where you would ordinarily write the branch target name. All integers (and register numbers) in your output should be written in base 10.
Canvas will auto-grade your entries. The auto-grader will give credit only for a perfect answer, where “perfect” means an exact string match with the answer entered by the test writer. We will manually re-grade answers marked incorrect for partial or full credit. Answers that the auto-grader will consider correct have all letters upper case, use exactly one space after the mnemonic and each comma, use a hash before all literals, and all literals will be in base 10.
10001011000011100000000110001000
11010001000001000000000101101011
10110101111111111111111111100111
11111000010000100000000111101101
10010111111111111111111111111101
ÎÊÌâ 8 0 ·Ö
Show your work for the previous problem for consideration for partial credit.
±à¼­ ²é¿´ ²åÈë ¸ñʽ ¹¤¾ß ±í¸ñ
https://canvas.iastate.edu/courses/90477/quizzes/399708/take

2022/2/26 ÍíÉÏ8:19 ²âÑé: Exam 1
https://canvas.i
0 ¸ö×Ö
ÎÊÌâ 9 5 ·Ö
Describe or name the feature of the ARMv8 instruction format makes it possible to decode instructions efficiently, even though opcodes are not all the same length?
±à¼­ ²é¿´ ²åÈë ¸ñʽ ¹¤¾ß ±í¸ñ 12pt ¶ÎÂä
astate.edu/courses/90477/quizzes/399708/take

2022/2/26 ÍíÉÏ
https://canvas.iastate.edu/courses/90477/quizzes/399708/take 8/9
8:19 ²âÑé: Exam 1
ÎÊÌâ 10 10 ·Ö
You are working within the context of a procedure foo (not shown). foo needs to call bar (also not shown). The parameters of bar are already set up in the parameter registers. foo is using the following set of registers, all of which it will continue to use (requiring the current values) after bar returns: X9, X10, X19, X20, X21, and the link register.
Adhering to ARMv8 calling conventions for the caller, write the stack manipulation instructions needed to finishing setting up the call to bar, to make the call, and to restore the stack after bar returns. A solution that issues other than the minimum number of loads and stores will not receive full credit.
p 0 ¸ö×Ö

2022/2/26 ÍíÉÏ8:19 ²âÑé: Exam 1
ÎÊÌâ 11 0 ·Ö
(3 pts, extra credit)
Your exam will not be graded and you will receive 0 marks if you fail to complete this exercise!
Type–do not cut-and-paste!–the following sentence in the box below. In place of ” [your name]”, type your full, legal name.
I, [your name], have neither sought, received, nor given assistance on this exam. The materials I accessed while taking the exam were limited to my notes, my textbook, the emulator, and this exam. On my honor, this I affirm and swear.
δ±£´æ Ìá½»²âÑé
https://canvas.iastate.edu/courses/90477/quizzes/399708/take

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com