Final Exam 341

5.0(2)
studied byStudied by 226 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/256

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.

257 Terms

1
New cards

A computer in an Amazon building accessed by thousands of people for online shopping.
a. Embedded
b. Server
c. PC

server

2
New cards

A given application written in Java runs 15 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?
a. 15x 0.6 /1.1 = 8.2 sec 3
b. 15 x 0.6 x 1.1 = 9.9 sec
c. 15 x 1.1 / 0.6 = 27.5 sec

15 x 0.6 x 1.1 = 9.9 sec

3
New cards

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

true

4
New cards

A megabyte is one Byte

million

5
New cards

"Bit" is short for "binary digit."
a. True
b. False

true

6
New cards

Operating system and compiler are central to every computer system.
a. True
b. False

true

7
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.
a. True
b. False

false

8
New cards

The corresponding binary representation of number DB in hexadecimal is ___.
a. 10101110
b. 11011011
c. 01011100
d. 10111100

11011011

9
New cards

The following could be an assembly language instruction: 1000110010100000.
a. True
b. False

false

10
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?
a. 2 GHz
b. 4 GHz
c. 6 GHz
d. 8 GHz
e. None

4 GHz

11
New cards

Replacing a processor in a computer with a faster processor has what effect?
a. Decreases response time
b. Increases throughput
c. Both (decreases response time and increases throughput)

Both

12
New cards

Instructions, as well as data, can be stored in memory as numbers.
a. True
b. False

True

13
New cards

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

true

14
New cards

rt is always referred as the second source register for MIPS instruction.
a. True
b. False

false

15
New cards

Indicate whether name $one refers to a MIPS register
a. True
b. False

false

16
New cards

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

true or false

false

17
New cards

More registers may benefit an assembly program, but may directly lead to a _____ clock frequency.
a. Faster
b. Same
c. Slower
d. Broken

slower

18
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?
a. 11100000
b. 00000000
c. 00000001
d. 11000000

00000000

19
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?
a. 11100000
b. 00000000
c. 00000001
d. 11000000

00000000

20
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)
a. 10
b. 15
c. 20
d. 77

10

21
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)
a. 10
b. 15
c. 20
d. 77

77

22
New cards

In two's complement, is the following number positive or negative? 1111 0000 0000 0000 0000 0000 0000 0000
a. Positive
b. Negative

negative

23
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
a. Overflow
b. No overflow

no overflow

24
New cards

Opcode 0 and a funct field of 34 indicates a(n) _____ instruction.
a. Add immediate
b. Add
c. Sub
d. Logic AND

sub

25
New cards

Opcode 35 indicates a(n) _ _ _ _ instruction

lw

26
New cards

Consider the subtraction of base ten numbers 6 - 4 using 32-bit binary numbers, and achieved by adding 6 with the two's complement of 4. What is the value of zyxw?
a. 1011
b. 1100
c. 1010
d. 0010

0010

27
New cards

instructions can be represented as bits

True or false

true

28
New cards

A multiplexor is also called a selector, where its output is one of the inputs that is selected by a control.
a. True
b. False

true

29
New cards

A register is a _____ element.
a. Combinational
b. State

state

30
New cards

An edge-triggered clocking methodology means that any values stored in a sequential logic element are updated on a clock edge either from low to high or vice versa.
a. True
b. False

true

31
New cards

A rising clock edge refers to the clock changing from _____.
a. 0 to 1
b. 1 to 0
c. Either 0 to 1, or 1 to 0

0 to 1

32
New cards

Consider a rising clock edge that cause 5000 to be written into the PC. After the address 5000 is read into the PC, the 5000 only propagates to the adder.

true or false

false

33
New cards

The design of register file can read from two registers and write to one register during the same clock cycle.
a. True
b. False

true

34
New cards

A register write must be explicitly indicated by asserting the write control signal.
a. True
b. False

true

35
New cards

For R-type instruction with three register operands, we need to read data(s) word from the register file.
a. One
b. Two
c. Three

two

36
New cards

An sign-extend is used to increase the size of a data item by replicating the high order sign bit of the original data item in the high order bits of the larger, destination data item

true or false

true

37
New cards

In addition to the register file and ALU, a branch instruction doesn’t involve

a. PC

b. sign extension

c. shift left

d. data memory

data memory

38
New cards

For R-type instruction with three register operands, we will need a total of___ outputs for the register file.
a. One
b. Two

two

39
New cards

For the store instruction sw $t1, offset_value($t2), the value to be stored must also be read from the register file where it resides in .
a. $t1
b. $t2

$t1

40
New cards

Which improvement has a bigger impact on power?
a. 25% reduction in voltage
b. 25% reduction in frequency switching

25% reduction in voltage

41
New cards

A terabyte is one _____ bytes.
a. Thousand
b. Million
c. Billion
d. Trillion

trillion

42
New cards

The collection of software on a computer that provides services to application software.
a. System software
b. Application software
c. Compiler

system softwarfe

43
New cards

Computers use binary because binary is more powerful than decimal numbers.
a. True
b. False

false

44
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.
a. True
b. False

true

45
New cards

The corresponding binary representation of number 5C in hexadecimal is ___.
a. 10101110
b. 01011101
c. 01011100
d. 10111100

01011101

46
New cards

An advantage of a high-level language (HLL) is allowing a programmer to ________
a. Think more naturally
b. Think like a machine

think more naturally

47
New cards

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

B

48
New cards

To determine how many times faster Computer C is than Computer D, which is the correct calculation?
a. PerfC / PerfD
b. PerfD / PerfC

PerC/PerfD

49
New cards

As clock rates increase in early Intel Processors, power

increased

50
New cards

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

true or false

true

51
New cards

Multiple operations are allowed per MIPS instruction

true or false

false

52
New cards

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

false

53
New cards

Indicate whether name $t11 refers to a MIPS register
a. True
b. False

false

54
New cards

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

false

55
New cards

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

true

56
New cards

Assume $s3 has 5000, and words addressed 5000..5002 have the data shown: 5000: 99

5001: 77

5002: 323

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

77

88

323

99

323

57
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?
a. 11100000
b. 00000000
c. 00000001
d. 11000000

11000000

58
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?
a. 11100000
b. 00000000
c. 00000001
d. 11000000

11100000

59
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)
a. 10
b. 15
c. 20
d. 77

10

60
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)
a. 10
b. 15
c. 20
d. 77

15

61
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)
a. 10
b. 15
c. 20
d. 77

77

62
New cards

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

1000 0000 0000 0000 0000 0000 0000 0000
a. 0
b. 1

1

63
New cards

In two's complement, is the following number positive or negative? 1111 0000 0000 0000 0000 0000 0000 0000
a. Positive
b. Negative

negative

64
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
a. 0
b. -1
c. 1
d. 2,147,483,648
e. -2,147,483,648

-2,147,483,648

65
New cards

For both add and addi instructions, field 3 (rt) represents a register.
a. True
b. False

true

66
New cards

Opcode 0 and a funct field of 32 indicates a(n) _____ instruction.
a. Add immediate
b. Add
c. Sub
d. Logic AND

add

67
New cards

Opcode 43 indicate a(n) ___ instruction

sub

add

sw

lw

sw

68
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 .
a. 6E5A0020
b. 4E680020
c. 8E680020
d. None of above

8E680020

69
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?
a. 00002B00
b. 02324020
c. 000049C0
d. None of above

000049C0

70
New cards

op rs rt rd shamt funct

0 8 9 10 0 34

What MIPS instruction does above represent?
a. Sub $t0, $t1, $t2
b. Add $t2, $t0, $t1
c. Sub $t2, $t1, $t0
d. Sub $t2, $t0, $t1
e. None of above

Sub $t2, $t0, $t1

71
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 .
a. AD5800B0
b. AD2804B0
c. 8E680020
sll $t2, $s0, 4

AD2804B0

72
New cards

sll $t2, $s0, 4

What is the register number of rs for the above MIPS instruction?
a. 00000
b. 10000
c. 01010
d. 00100

00000

73
New cards

sll $t2, $s0, 4

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

a. 00000
b. 10000
c. 01010
d. 00100

10000

74
New cards

sll $t2, $s0, 4

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

a. 00000
b. 10000
c. 01010
d. 00100

01010

75
New cards

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

false

76
New cards

What is the binary representation for a 16 bit negative 21?
a. 0000 0000 0001 0101
b. 1111 1111 1110 1010
c. 0000 0000 0000 1011
d. 1111 1111 1110 1011
e. None of above

1111 1111 1110 1010

77
New cards

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

a. 0
b. 1
c. -1
d. None of above

1

78
New cards

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

a. 0
b. 1
c. -1
d. None of above

0

79
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?
a. D3D07C83
b. 43D07C8C
c. 4F41F20C
d. None of above

4F41F20C

80
New cards

Assume $s1 has 50 and $s2 has 30. Given this code:
bne $s3, $s4, Else
add $s0, $s1, $s2
j Exit 8
Else: sub $s0, $s1, $s2
Exit:

If $s3 is 9 and $s4 is 9, which instruction executes after bne?
a. Add
b. Sub
c. J
d. Else

Add

81
New cards

Assume $s1 has 50 and $s2 has 30. Given this code:
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
a. 30
b. 80
c. 20
d. 50

80

82
New cards

Assume $s1 has 50 and $s2 has 30. Given this code:
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?
a. Add
b. Sub
c. J
d. Else

sub

83
New cards

Assume $s1 has 50 and $s2 has 30. Given this code:
bne $s3, $s4, Else
add $s0, $s1, $s2
j Exit
Else: sub $s0, $s1, $s2
Exit:

j Exit is executed when $s3 and $s4 value

are not equal

are equal

are equal

84
New cards

The first part of a main program call 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 z 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

85
New cards

A main program calls a Power procedure using the instruction: jal Power. That instruction is at address 1000. What happens to $ra?
a. Nothing; jal is unrelated to $ra
b. $ra is set to 1000
c. $ra is set to 1004

$ra is set to 1004

86
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?
a. jr caller
b. jr $ra
c. jal $ra

jr $ra

87
New cards

What is $s0 after: lui $s0, 7?
a. 0000 0000 0000 0000 0000 0000 0000 0111
b. 0000 0000 0000 0000 0000 0000 0111 0000
c. 0000 0000 0000 0111 0000 0000 0111 0000
d. 0000 0000 0000 0111 0000 0000 0000 0000
e. 0000 0000 0000 1111 0000 0000 0000 0000

d. 0000 0000 0000 0111 0000 0000 0000 0000

88
New cards

What is $s0 after executing the following MIPS codes? lui $s0, 7 ori $s0, $s0, 8
a. 0000 0000 0000 0000 0000 0000 0000 1111
b. 0000 0000 0000 0000 0000 0000 0111 1000
c. 0000 0000 0000 0111 0000 0000 0111 0000
d. 0000 0000 0000 0111 0000 0000 0000 1000
e. 0000 0000 0000 1111 0000 0000 0000 0000

d. 0000 0000 0000 0111 0000 0000 0000 1000

89
New cards

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

5001: 77

5002: 323

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

5001

5002

5000

5002

90
New cards

Assume $s1 has 50 and $s2 has 30. Given this code:
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?

50

30

20

80

20

91
New cards

Assume $s1 has 50 and $s2 has 30. Given this code:
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 beq

Exit

Else

Sub

Add

J

add

92
New cards

For the beq instruction, branch taken is referred to the situation where the branch target address becomes the new PC when the condition is true.
a. True
b. False

true

93
New cards

In the MIPS architecture for a branch instruction, the branch target address is given by .
a. sum of the offset field of the instruction and the address of the instruction following the branch.
b. the offset field of the instruction
c. the address of the instruction following the branch

sum of the offset field of the instruction and the address of the instruction following the branch.

94
New cards

Which of the following is correct for an load instruction referring to the right datapath?
a. MemtoReg should be set to cause the read data from the data memory to be sent to the register file
b. MemtoReg should be set to cause the ALUresult to be sent to the register file
c. MemtoReg should be set to cause the Readdata2 from RF to be register file

MemtoReg should be set to cause the read data from the data memory to be sent to the register file

95
New cards

Which of the following is correct for an R-type instruction datapath?  

a. PCSrc should be set to cause the branch target address to be written into the PC

b. PCSrc should be set to cause the sequential following instruction with address PC to be written into the PC

c. PCSrc should be set to cause the sequential following instruction with address PC+4 to be written into the PC

c. PCSrc should be set to cause the sequential following instruction with address PC+4 to be written into the PC

96
New cards

Which of the following is correct for a store instruction?

a. ALUSrc should be set to cause the Readdata2 from the RF to be sent to the ALU as the second input

b. ALUSrc should be set to cause the sign-extended 16-bit offset field from the instruction to be sent to the ALU as the second input

c. ALUSrc should be set to cause the Readdata1 from the RF to be sent to the ALU as the second input

d. We do not care about the setting of ALUSrc for loads

ALUSrc should be set to cause the sign-extended 16-bit offset field from the instruction to be sent to the ALU as the second input

97
New cards

Which of the following is correct for an R-type instruction?

a. ALUSrc should be set to cause the Readdata2 from the RF to be sent to the ALU as the second input

b. ALUSrc should be set to cause the sign-extended 16-bit offset field from the instruction to be sent to the ALU as the second input

c. We do not care about the setting of ALUSrc for loads

d. ALUSrc should be set to cause the Readdata1 from the RF to be sent to the ALU as the second input

ALUSrc should be set to cause the Readdata2 from the RF to be sent to the ALU as the second input

98
New cards

The single-cycle datapath conceptually must have separate instruction and data memories due to the fact that  ______. 

a. Having separate memories is less expensive

b. The formats of data and instructions are different in MIPS, and hence different memories are needed

c. The processor operates in one cycle and cannot use a single-ported memory for two different accessed within that cycle

The processor operates in one cycle and cannot use a single-ported memory for two different accessed within that cycle

99
New cards

The MIPS ALU defines five different arithmetic and logic operations depending on four ALU control inputs. For the branch equal operation, the four ALUctl lines should be  _____.

a. 0010

b. 0111

c. 0000

d. 0110

0110

100
New cards

The MIPS ALU defines five different arithmetic and logic operations depending on four ALU control inputs. For the store word instructions, the four ALUctl lines should be ______.

a. 0010

b. 0111

c. 0000

d. 0110

0010