CS51 – REVIEW FOR MIDTERM EXAM

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Find the 2s-complement of -94 in 16-bit binary.

0000 0000 0101 1110

Convert the following number to scientific notation. Do not round. Include all nonzero numbers in your answer. 16,624,000 = x 10^

1.6624 x 10 ^ 7

Find the 2s-complement of 695 in 16-bit binary.

1111 1101 0100 1001

Find the 2s-complement of 184 in 16-bit binary.

1111 1111 0100 1000

Suppose computer C runs an application twice as fast as computer D runs it. If computer C runs the application in 10 seconds, how many seconds will it take computer D to run it?

20

Suppose a color monitor has a 1280x768 frame size and uses 8 bits for each of the three primary colors per pixel. What is the minimum size in bits of the frame buffer to store a frame? Enter only the final answer with no commas.

23592960

Convert the following number to scientific notation. Do not round. Include all nonzero numbers in your answer. 0.0000423 = x 10^

4.23 x 10 ^ -5

Suppose a color monitor has a 1768x992 frame size and uses 8 bits for each of the three primary colors per pixel. What is the minimum size in bytes of the frame buffer to store a frame? Enter only the final answer with no commas.

5261568

Convert the following number to scientific notation. Do not round. Include all nonzero numbers in your answer. 4/625 = x 10^

6.4 x 10 ^ -3

Convert the following number to scientific notation. Do not round. Include all nonzero numbers in your answer. 1/12500 = x 10^

8 x 10 ^ 5

Assume x goes to $s0, y goes to $s1, and the starting address of the array A goes to $s2. Convert the following MIPS code to C: sw $s1, 8($s2)

A[2] = y;

Convert the following MIPS instruction to its binary and hex representations by doing the following: On first line, type registers with dollar signs On second line, type register numbers in decimal On third line, convert all entries from decimal to binary. DO NOT put any spaces in any binary values. Finally, convert binary to hex. Include all eight hex digits, including any leading and trailing zeroes. DO NOT include spaces. sub $s3, $t4, $s5 oprsrtrdshamtfunctmath0add003400000000000100010 Hex =

Answer 1: $t4 Answer 2: $s5 Answer 3: $s3 Answer 4: 12 Answer 5: 21 Answer 6: 19 Answer 7: 01100 Answer 8: 10101 Answer 9: 10011 Answer 10: 01959822

Suppose the following assignments have been made: t0 = 0111 1001 1110 1111 t1 = 0001 1101 1010 1100 Find the 16-bit value in t2 after each of the following operations (All answers must have 16 bits): and $t2, $t0, $t1 t2 = or $t2, $t0, $t1 t2 = nor $t2, $t0, $zero t2 =

Answer 1: 0001100110101100 Answer 2: 0111 1101 1110 1111 Answer 3: 1000 0110 0001 0000

Suppose the implementation of an instruction set architecture uses two classes of instructions, which are called A and B. The total dynamic instruction count is 2 x 10^7. Details for the two classes are given in the table below: ClassCPI% of instructionsA1.555%B1.245% Complete the following table. Express all answers in scientific notation and round to two decimal places, when needed. ClassInstruction CountNumber of Clock CyclesA x 10^ x 10^B x 10^ x 10^

Answer 1: 1.1 Answer 2: 7 Answer 3: 1.65 Answer 4: 7 Answer 5: 9. Answer 6: 6 Answer 7: 1.08 Answer 8: 7

Fill in the empty spaces in the following table. As you do, please be aware of the following: All numbers are considered signed (negative) for this table All binary answers must have 16 bits You need to put a space after every 4 bits for binary values. All hex values must use capital letters Signed Decimal16-bit BinaryHex-491111 1110 1011 0101FF9D

Answer 1: 1111 1111 1100 1111 Answer 2: FEB5 Answer 3: -331 Answer 4: FEB5 Answer 5: -99 Answer 6: 1111 1111 1001 1101

Suppose the t1 register is given the decimal value 415. Find the decimal value of the t2 register after each of the following instructions: sll $t2, $t1, 3 t2 = srl $t2, $t1, 5 t2 =

Answer 1: 3320 Answer 2: 12

Given the following information about a processor: 20 seconds needed to run an application The clock rate is 3.2 GHz CPI = 1.2 Calculate the following. Answers should be expressed in scientific notation and rounded to two decimal places when needed: Number of clock cycles = x 10^ Instruction count = x 10^ Instructions per second = x 10^

Answer 1: 6.4 Answer 2: 10 Answer 3: 5.33 Answer 4: 10 Answer 5: 2.67 Answer 6: 9

Fill in the empty spaces in the following table. As you do, please be aware of the following: All numbers are considered unsigned (positive) for this table All binary answers must have 16 bits You need to put a space after every 4 bits for binary values. All hex values must use capital letters Unsigned Decimal16-bit BinaryHex5D0000 0000 0110 1010151

Answer 1: 93 Answer 2: 0000 0000 0101 1101 Answer 3: 106 Answer 4: 006A Answer 5: 0000 0000 1001 0111 Answer 6: 97

Parallelism

Doing multiple tasks at once

Hierarchy

Fastest, most expensive at top; Slowest, cheapest at bottom

Prediction

Guess and start working

Abstraction

Lower-level details are hidden

Pipelining

Output of one stage is input for the next stage

Assume x goes to $s0, y goes to $s1, and z goes to $s2. Convert the following C code to MIPS. Use temporary registers ($t0, $t1, etc.) when appropriate. z = x - 11;

addi $s2, $s0, -11

Assume x goes to $s0, y goes to $s1, and the address of the first element in the array A goes to $s2. Convert the following C code to MIPS. Use temporary registers ($t0, $t1, etc.) when appropriate. A[5] = A[2] - x;

lw $t0, 8($s2) sub $t0, $t0, $s0 sw $t0, 20($s2)

Assume x goes to $s0, y goes to $s1, z goes to $s2, and w goes to $s3. Convert the following C code to MIPS. Use temporary registers ($t0, $t1, etc.) when appropriate. x = z - y + 15;

sub $t0, $s2, $s1 addi $s0, $t0, 15

Assume x goes to $s0, y goes to $s1, and z goes to $s2. Convert the following MIPS code to C: addi $s0, $s0, 4

x = x + 4;

Assume x goes to $s0, y goes to $s1, and the starting address of the array A goes to $s2. Convert the following MIPS code to C: lw $s1, 12($s2)

y = A[3];


संबंधित स्टडी सेट्स

Management of Information Security Chapter 1

View Set

Psych Exam 1 - Ch. 27 (Anger, Aggression, & Violence)

View Set

Engelska oregelbundna verb- från choose till do

View Set

2 - Project Scope Management - Test

View Set

Social Psych Final Review (previous test answers)

View Set