MIDTERM 1 - (QUIZ 1)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/73

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

74 Terms

1
New cards

A computer in an Amazon building accessed by thousands of people for online shopping. 

PC

Embedded

Server

Server

2
New cards

The instruction sets of different computers are quite similar to one another.  

True

False

True

3
New cards

A given application written in Java runs 10 seconds on a desktop processor. A new Java compiler is released that requires only 0.6 as many instructions as the old compiler. Unfortunately, it increases the CPI by 1.1. How fast can we expect the application to run using this new compiler? 

10 x 0.6 x 1.1 =6.6 sec 

10 x 1.1 / 0.6 = 18.33 sec

10 x 0.6 /1.1 = 5.45 sec

10 x 0.6 x 1.1 =6.6 sec 

4
New cards

Which improvement has a bigger impact on power? 

25% reduction in frequency switching 

25% reduction in voltage

25% reduction in capacitance

25% reduction in voltage

5
New cards

Indicate whether addi $s1, $s3, 20 is a valid MIPS instruction.  

True

False

True

6
New cards

A terabyte is one _____ bytes. 

Trillion

Billion 

Million

Thousand

Trillion

7
New cards

A megabyte is one _____ bytes.   

Trillion 

Billion

Million

Thousand

Million

8
New cards

The collection of software on a computer that provides services to application software.

Application software

System software

Compiler

System software

9
New cards

"Bit" is short for "binary digit". 

True

False

True

10
New cards

Computers use binary because binary is more powerful than decimal numbers. 

True 

False

False

11
New cards

Operating system and compiler are central to every computer system.   

True

False

True

12
New cards

Although binary's alphabet contains only two "letters", 0 and 1, the binary alphabet can represent as much information as the English alphabet's 26 letters. 

True

False

True

13
New cards

The number 12 can be represented in binary as 1100. If a computer's memory location contains 00001100, then that location contains the number 12.  

True

False

False

14
New cards

The corresponding binary representation of number 5C in hexadecimal is ___. 

10101110

01011100

10111100

01011101

01011100

15
New cards

The corresponding binary representation of number DB in hexadecimal is ___.

01011101

01011100

10101110

11011011

11011011

16
New cards

An advantage of a high-level language (HLL) is allowing a programmer to ________.

 Think like a machine

Think more naturally

Think more naturally

17
New cards

The following could be an assembly language instruction: 1000110010100000.  

True 

False

False

18
New cards

Computer A requires 10 seconds to compress a file. Computer B requires 5 seconds. Which computer has the higher performance? 

B

B

19
New cards

Computer A: 2GHz, 10s CPU time. In order to design a computer B with 6s CPU time and 1.2 times clock cycles (CPI) of computer A assuming both use the same amount of instruction count, how fast must computer B clock be?

4 GHz

2 GHz

None of above

6 GHz 

8 GHz

4 GHz

20
New cards

To determine how many times faster Computer C is than Computer D, which is the correct calculation?   

PerfD / PerfC

PerfC / PerfD

PerfC / PerfD

21
New cards

Replacing a processor in a computer with a faster processor has what effect?

Decreases response time

Increases throughput 

Both (decreases response time and increases throughput)

Both (decreases response time and increases throughput)

22
New cards

As clock rates increased in early Intel processors, power _____.

Increased 

Decreased

Increased

23
New cards

Instructions, as well as data, can be stored in memory as numbers.

True 

False

True

24
New cards

Multiple operations are allowed per MIPS instruction. 

True

False

False

25
New cards

The alignment restriction refers to that words must start at addresses that are multiple of 4 in MIPS. 

True 

False

True

26
New cards

Since registers are faster to access than memory, the compiler should keep all used variables in registers. 

True 

False

False

27
New cards

rt is always referred as the second source register for MIPS instruction.

True

False

False

28
New cards

Indicate whether name $t11 refers to a MIPS register.  

True

False

False

29
New cards

Indicate whether name $one refers to a MIPS register. 

True

False

False

30
New cards

Indicate whether name Memory [0] refers to a MIPS register.

True 

False

False

31
New cards

Indicate whether lw $s1, 20($s9) is a valid MIPS instruction. 

True 

False

False

32
New cards

Indicate whether lw $s1, 20($s6) is a valid MIPS instruction. 

True 

False

True

33
New cards

More registers may benefit an assembly program, but may directly lead to a _____ clock frequency.

Same

Broken

Slower

Faster

Slower

34
New cards

Assume $s0 has 5001, and words addressed 5000..5002 have the data shown: 

5000: 99 
5001: 77 
5002: 323 

Assume $s0 has 5001. What value will be put in $t1 by lw $t1, 1($s0)?

88

77

99 

323

323

35
New cards

Consider the 32-bit binary number 11100000 11000000 00000000 00000001, stored in the word with address 5000. For a big-endian architecture, what value is stored in byte 5002?

11100000

00000000

11000000 

00000001

00000000

36
New cards

Consider the 32-bit binary number 11100000 11000000 00000000 00000001, stored in the word with address 5000. For a big-endian architecture, what value is stored in byte 5001?

11100000

00000000

00000001 

11000000

11000000

37
New cards

Consider the 32-bit binary number 11100000 11000000 00000000 00000001, stored in the word with address 5000. For a little-endian architecture, what value is stored in byte 5001? 

00000001

11000000

11100000 

00000000

00000000

38
New cards

Consider the 32-bit binary number 11100000 11000000 00000000 00000001, stored in the word with address 5000. For a little-endian architecture, what value is stored in byte 5003?

00000000

00000001

11000000 

11100000

11100000

39
New cards

If $s3 has 900, $t0 has 77, and memory locations 900, 904, and 908 have 10, 15, 20 respectively, what does location 900 have after the following instruction?

sw $t0, 8($s3)

77

10

15

20

10

40
New cards

If $s3 has 900, $t0 has 77, and memory locations 900, 904, and 908 have 10, 15, 20 respectively, what does location 904 have after the following instruction?

sw $t0, 8($s3)  

15

10 

77

20

15

41
New cards

If $s3 has 900, $t0 has 77, and memory locations 900, 904, and 908 have 10, 15, 20 respectively, what does location 908 have after the following instruction?

sw $t0, 8($s3) 

15

20

10

77

77

42
New cards

Given the following 32-bit number, what is the most significant bit's value?

1000 0000 0000 0000 0000 0000 0000 0000 

0

1

43
New cards

In two's complement, is the following number positive or negative?

1111 0000 0000 0000 0000 0000 0000 0000   

Negative

Positive

Negative

44
New cards

Knowing that 231 is 2,147,483,648, what is the base ten value of the following two's complement number? 1000 0000 0000 0000 0000 0000 0000 0000  

-1

2,147,483,648

0

-2,147,483,648

-2,147,483,648

45
New cards

Indicate if the binary operation (two’s complement representation) resulted in overflow.

    0111 0000 0000 0000 0000 0000 0000 0000

+  1111 0000 0000 0000 0000 0000 0000 0000

No Overflow 

Overflow

No Overflow

46
New cards

For both add and addi instructions, field 3 (rt) represents a register 

True

False

True

47
New cards

Opcode 0 and a funct field of 34 indicates a(n) _____ instruction.

Logic AND

Add immediate 

Sub

Add

Sub

48
New cards

Opcode 0 and a funct field of 32 indicates a(n) _____ instruction.

Add immediate

Sub

Add

Logic AND

Add

49
New cards

Opcode 35 indicates a(n) _____ instruction.  

lw

Sub

sw 

Add

lw

50
New cards

Opcode 43 indicates a(n) _____ instruction.

Sub

law

sw

Add

sw

51
New cards

For the MIPS instruction lw $t0, 32($s3) assuming the opcode for lw is 35, the correspond machine code represented in Hexadecimal is ____.    

6E5A0020

8E680020 

4E680020

None of above

8E680020 

52
New cards

add $t0, $s1, $s2 

0000 0000 0000 0000 0000 1101 1100 0000

0000 0000 0000 0000 0011 1100 0000 0000


For above add instruction, what is the corresponding output in HEX for the above two given source operands? 

 

00002B00

000049C0

02324020

None of above

000049C0

53
New cards
<p>What MIPS instruction does above represent?&nbsp;</p><p>Sub $t2, $t0, $t1</p><p>None of above</p><p>Sub $t2, $t1, $t0</p><p>Add $t2, $t0, $t1</p><p>Sub $t0, $t1, $t2</p>

What MIPS instruction does above represent? 

Sub $t2, $t0, $t1

None of above

Sub $t2, $t1, $t0

Add $t2, $t0, $t1

Sub $t0, $t1, $t2

Sub $t2, $t0, $t1

54
New cards

For the MIPS instruction sw $t0, 1200($t1) assuming the opcode for sw is 43, the correspond machine code represented in Hexadecimal is ____.

AD2804B0

AD5800B0

8E680020

AD2804B0

55
New cards

sll $t2, $s0, 4 

What is the register number of rs for the above MIPS instruction? 

10000

01010

00100 

00000

00000

56
New cards

sll $t2, $s0, 4

What is the register number of rt for the above MIPS instruction?

None of above

00100

01010

00000 

10000

10000

57
New cards

sll $t2, $s0, 4

What is the register number of rd for the above MIPS instruction?

00100

None of above

00000

01010 

10000

01010

58
New cards

$a0-$a3, $v0, $v1, and $t0-$t9 are the only registers used by the compiler to handle procedure calling. 

True 

False

False

59
New cards

What is the binary representation for a 16 bit negative 21?

0000 0000 0000 1011

None of above

1111 1111 1110 1010

1111 1111 1110 1011 

0000 0000 0001 0101

1111 1111 1110 1011 

60
New cards

What is the value of the register $t0 after executing the instruction slt $t0, $s0, $s1 when $s0 = 1101 and $s1 = 0010?

-1

0

None of above

1

1

61
New cards

What is the value of the register $t0 after executing the instruction sltu  $t0, $s0, $s1 when $s0 =   1101 and  $s1 = 0010? 

1

None of above

-1 

0

0

62
New cards

What is the value of the register $t1 after executing the instruction sll $t1, $s3, 2 when $s3 = 1101 0011 1101 0000 0111 1100 1000 0011 for above MIPS codes? 

4F41F20C

None of above 

D3D07C83

43D07C8C

4F41F20C

63
New cards

Assume $s1 has 50 and $s2 has 30. Given the following codes: 
      bne $s3, $s4, Else  

      add $s0, $s1, $s2 

      j Exit 

Else: sub $s0, $s1, $s2 

Exit: 

If $s3 is 9 and $s4 is 9, which instruction executes after bne? 

Add 

Sub

Else 

Exit

J

Add

64
New cards

Assume $s1 has 50 and $s2 has 30. Given the following codes: 
      bne $s3, $s4, Else  

      add $s0, $s1, $s2 

      j Exit 

Else: sub $s0, $s1, $s2 

Exit: 

 If $s3 is 9 and $s4 is 9, what value will $s0 have after executing the above MIPS codes? 

 

50

20

80 

30

80

65
New cards

Assume $s1 has 50 and $s2 has 30. Given the following codes: 
      bne $s3, $s4, Else  

      add $s0, $s1, $s2 

      j Exit 

Else: sub $s0, $s1, $s2 

Exit: 

If $s3 is 9 and $s4 is 8.9, which instruction executes after bne? 

J

Exit

Add

Else 

Sub

Sub

66
New cards

Assume $s1 has 50 and $s2 has 30. Given the following codes: 
      bne $s3, $s4, Else  

      add $s0, $s1, $s2 

      j Exit 

Else: sub $s0, $s1, $s2 

Exit: 

j Exit is executed when $s3 and $s4 values _______.  

Are equal 

Are not equal

Are equal

67
New cards

The first part of a main program calls procedure Power to compute xy, where x is in $s0, y is in $s1. Later, the program is to call Power again, but this time x is in $s3 and y is in $s7. How might the program pass the parameter values to Power? 

 

Copy $s3 to $a0, and $s7 to $a1 

Not possible; x and y must be in $s0 and $s1

Copy $s3 to $a0, and $s7 to $a1

68
New cards

A main program calls a Power procedure using the instruction: jal Power. That instruction is at address 1000. What happens to $ra? 

 

$ra is set to 1000 

$ra is set to 1004

Nothing; jal is unrelated to $ra

$ra is set to 1004

69
New cards

A procedure Power computes $a0 to the power of $a1. How should the procedure jump back to the next instruction in the caller? 

jr caller

jal $ra

jr $ra

jr $ra

70
New cards

What is $s0 after: lui $s0, 7? 

 

0000 0000 0000 0000 0000 0000 0111 0000

0000 0000 0000 1111 0000 0000 0000 0000

0000 0000 0000 0000 0000 0000 0000 0111

0000 0000 0000 0111 0000 0000 0111 0000 

0000 0000 0000 0111 0000 0000 0000 0000

0000 0000 0000 0111 0000 0000 0000 0000

71
New cards

What is $s0 after executing the following MIPS codes? 

 
lui $s0, 7 

ori $s0, $s0, 8 

0000 0000 0000 0111 0000 0000 0000 1000

0000 0000 0000 0000 0000 0000 0000 1111

0000 0000 0000 0000 0000 0000 0111 1000

0000 0000 0000 0111 0000 0000 0111 0000

0000 0000 0000 1111 0000 0000 0000 0000

0000 0000 0000 0111 0000 0000 0000 1000

72
New cards

Assume $s0 has 5000, and words addressed 5000..5002 have the data shown: 
5000: 99 
5001: 77 
5002: 323 

What address will be computed by lw $t0, 2($s0):

5001

5000 

5002

5002

73
New cards

Assume $s1 has 50 and $s2 has 30. Given the following codes: 
      bne $s3, $s4, Else  

      add $s0, $s1, $s2 

      j Exit 

Else: sub $s0, $s1, $s2 

Exit: 

If $s3 is 9 and $s4 is 8.9, what value will $s0 have after executing the above MIPS codes? 

30

80

50 

20

20

74
New cards

Assume $s1 has 50 and $s2 has 30. Given the following codes: 
      beq $s3, $s4, Else  

      add $s0, $s1, $s2 

      j Exit 

Else: sub $s0, $s1, $s2 

Exit: 

 

If $s3 is 9 and $s4 is 9, which instruction executes after beq? 

Exit

J

Sub

Else

Add

Sub