Question: Multiple CHoice Questions, Machine learning Question 14 (1 point) How many additional registers (besides R5, R6, and R7) do we need to compute R5 =

Multiple CHoice Questions, Machine learning

Question 14 (1 point)

How many additional registers (besides R5, R6, and R7) do we need to compute R5 = (R5 + R6) + R7?

3

2

0

1

Question 15

Instructions can directly compute on data stored in memory.

True

False

Question 16 (1 point)

Question 16 Saved

How large is each memory location?

8 bytes

32 bytes

1 byte

4 bytes

Save

Question 17 (1 point)

For a 32-bit computer, how many memory locations are there?

4GB

8GB

16GB

256GB

Save

Question 18 (1 point)

How many memory locations do we need to fill a register? (ie. how many bytes in a word?)

1

2

4

Save

Question 19 (1 point)

MIPS supports unaligned memory access.

True

False

Save

Question 20 (1 point)

What are the two promises a processor makes about instruction execution? One single word lower case answer in each blank

Question 20 options:

Save

Question 21 (1 point)

If a processor did not promise sequential execution, how many ways could a processor execute a set of 4 instructions?

12

6

24

1

Question 22 (1 point)

Question 22 Unsaved

Where is data stored? (one word lower case answer)

Question 23 (1 point)

Question 23 Unsaved

Where is a program stored? (one word lower case answer)

Question 24 (1 point)

Question 24 Unsaved

Order the following steps for executing a data operation

12345

Control logic updates the PC for the next instruction

12345

Instructions are fetched from memory into the instruction register

12345

PC holds an instruction address

12345

ALU executes the instruction and results flow back to register

12345

Control logic decodes the instruction and tells the ALU and register file what to do.

Save

Question 25 (1 point)

Question 25 Unsaved

How much does the PC increment to go to the next instruction?

4 bytes

4 words

1 byte

Save

Question 26 (1 point)

Question 26 Unsaved

Where does the register file get the information on which registers to read and right from?

instruction register

control logic

memory

ALU

Save

Question 27 (1 point)

Question 27 Unsaved

Order the following steps in a data transfer operation

1234

Results to/from memory are stored in the memory data register

1234

Data from memory can be stored back into the Register File or to memory

1234

ALU generates address

1234

Address goes to the memory address register

Save

Question 28 (1 point)

Question 28 Unsaved

Currently, R5 = 12. What does the following instruction do? lw R6, 4(R5)

load memory address R6 and put it into R5

load 4 bytes of R5 into R6

load memory address 16 into R6

multiply R5 by 4 and put the result in R5

Save

Question 29 (1 point)

Question 29 Unsaved

Where does the offset come from in an offset load?

address

register file

program counter

instruction

Save

Question 30 (1 point)

Question 30 Unsaved

Which instruction performs an unconditional branch jump?

jmp

branch

bne

j

Save

Question 31 (1 point)

Question 31 Unsaved

Order the following steps in the execution of a branching/sequencing instruction

1234

If the branch is take, the control adds a constant from the instruction to the PC

1234

ALU compares registers

1234

Control always adds 4 to the PC

1234

Result tells the control whether to branch

Save

Question 32 (1 point)

Question 32 Unsaved

How do we jump to label done if R3 is equal to 7?

addi R3, R0, 7

beq R3, R0, done

j done

beq R3, 7, done

addi R2, R0, 7

beq R2, R3, done

Save

Question 33 (1 point)

Question 33 Unsaved

Which of the following is not a type of MIPS instruction?

R

T

J

I

Save

Question 34 (1 point)

Question 34 Unsaved

What format instruction is lw?

R

I

J

T

Save

Question 35 (1 point)

Question 35 Unsaved

What format instruction is add?

R

I

T

J

Save

Question 36 (1 point)

Question 36 Unsaved

How long is the op field of a MIPS instruction machine encoding?

32

12

4

6

Save

Question 37 (1 point)

Question 37 Unsaved

How many bits is used to encode the destination register in a MIPS instruction encoding?

32

5

12

6

Save

Question 38 (1 point)

Question 38 Unsaved

Why is a multiplexor necessary in the MIPS datapath from the instruction file to the register file?

to choose the right source register

to choose the right write register

to choose the right instruction

Save

Question 39 (1 point)

Question 39 Unsaved

Why is a multiplexor necessary in the MIPS datapath from memory to the register file?

to choose the correct memory address to load into the register file

lw instructions have to write from memory to the register file, whereas I-type instructions don't

lw instructions have to write from memory to the register file, whereas R-type instructions don't

Save

Question 40 (1 point)

Question 40 Unsaved

What are the inputs of the ALU?

three 1 word inputs

two 32 bit inputs

three 1 word inputs an an op signal

two 32 bit inputs and an op signal

Save

Question 41 (1 point)

Question 41 Unsaved

How do you print to the console in MIPS?

syscall

print

write

echo

Save

Question 42 (1 point)

Question 42 Unsaved

Write ONE instruction in all lower case to clear all bits in register $8 except for the low order bytes, which should remain unchanged. Do not use any spaces between the operand - the only space should be between the operator and the first operand.

Save

Question 43 (1 point)

Question 43 Unsaved

Here is a program that loads register $5 with a bit pattern. Complete the program so that register $4 receives the pattern in register $5 shifted left logical by three positions. Do not put any spaces in your answer except immediately after the operator.

ori $5, $0, 0x92AF # put a bit pattern into register $5

sll ___,___,___ # shift left logical by three, put

# result in register $4

Save

Question 44 (1 point)

Question 44 Unsaved

Examine the following program fragment. The program is to add $5 and $6 together only if they are not equal.

ori $5,$0,8 # load $5 with 8

ori $6,$0,9 # load $6 with 9

____ $5,$6,spot

sll $0,$0,0 # branch delay slot

addu $8,$5,$6 # $8 = $5 + $6

spot:

Save

Question 45 (1 point)

Question 45 Unsaved

Examine the following program fragment:

ori $8,$0,13

ori $9,$0,1

bltz $8,target

sll $0,$0,0

ori $9,$0,0

target: sll $0,$0,=

What value is found in $9 when control reaches target? (write a single number)

Question 45 options:

Save

Question 46 (1 point)

Question 46 Unsaved

Here is an if-then-else structure. The code is to compare $10 and $11. If these registers contain the same bit pattern, set register $7 to 1. Otherwise set $7 to 0. Fill in the blanks.

___ $10,$11,_____

sll $0,$0,0

ori $7,$0,0

j _____

label1: sll $0,$0,0

label2: ori $7,$0,1

done: .....

Which choices should fill the blanks? (lower case, single word answers in the correct order - according to above)

Save

Question 47 (1 point)

Question 47 Unsaved

Examine the following program fragment:

ori $5,$0,5 # initialize count

ori $8,$0,0 # initialize accumulator

test: bltz $5,done

sll $0,$0,0

addu $8,$8,$5 # add count to accumulator

addiu $5,$5,-1

j test

sll $0,$0,0

done: sll $0,$0,0

How many times is the addu instruction executed? (enter a single number)

Save

Question 48 (1 point)

Question 48 Unsaved

Complete the following code to compute 3x+7, where x starts out in register $8 and the result is put in $9. Only lowercase, single word or operator answers. No explanations.

ori $3,$0,3

____ $8,$3

mflo $9

addiu $9,$9,___

Save

Question 49 (1 point)

Question 49 Unsaved

Which of the following fragments correctly writes "Hello" to the monitor?

li $v0,4

li $a0,"Hello"

syscall

li $v0,4

lw $a0,hello

syscall

. . .

hello: .ascii "Hello"

lw $v0,4

lw $a0,hello

syscall

. . .

hello: .asciiz "Hello"

li $v0,4

la $a0,hello

syscall

. . .

hello: .asciiz "Hello"

Save

Question 50 (1 point)

Question 50 Unsaved

Examine this fragment:

????? $s0,head

. . .

.data

head: .word 7

Replace ???? with the instruction that will place the contents of head into $s0. Write only the instruction in lowercase.

Save

Question 51 (1 point)

Question 51 Unsaved

What will be the value of p1 after the following code is executed? Just enter the numerical result.

p1: .word 213

p2: .word 468

p3: .asciiz "the current value of p1 is: "

.text

.globl main

main:

lw $t0, p1

lw $t2, p2

la $t1, p1

addi $t2, $t2, 9

sw $t2, 0($t1)

sw $t0, 4($t1)

la $a0, p3

li $v0, 4

syscall

li $v0, 1

lw $a0, p1

syscall

jr $ra

Save

Question 52 (1 point)

Question 52 Unsaved

What will the following code output?? (only write the numerical result)

.data

p1: .byte 5

.text

.globl main

main:lb $t0, p1

li$t3, 0

li$t4, 0

loop:

bge$t3, $t0, done

add$t4, $t3, $t4

addi$t3, $t3, 1

bloop

done:

li$v0, 1

move$a0, $t4

syscall

jr$ra

Save

Question 53 (1 point)

Question 53 Unsaved

Convert the following Assembly instruction to its equivalent machine code: sll $v0, $a0, 2. Write it in the form 0x89ABCDEF

Save

Question 54 (3 points)

Question 54 Unsaved

Convert the following MIPS assembly code into machine language. Write the instructions in hexadecimal lowercase with a '0x prefix' (eg. 0x9abcdef). Convert each instruction, in order, in each blank.

addi $s0, $0, 73

sw $t1, 7($t2)

sub $t1, $s7, $s2

Save

Question 55 (2 points)

Question 55 Unsaved

Translate the following machine language code into assembly language.

0x2237FFF1

0x02F34022

In the blanks, indicate the instruction that is encoded (eg. lw, addi, add...)

Save

Question 56 (3 points)

Question 56 Unsaved

Fill in the field values in decimal for - add $t0, $s4, $s5 (eg. rs = 20)

op

rs

rt

rd

shamt

funct

Save

Question 57 (1 point)

Question 57 Unsaved

Which of the following are I-type instructions?

sw $t1, 7($t2)

addi $s0, $0, 73

sub $t1, $s7, $s2

Save

Question 58 (20 points)

Question 58 Unsaved

[CHALLENGE - extra credit] Convert the following machine code into MIPS assembly. The numbers in the left column are the memory addresses for the instructions, and the right column contains the instructions at those addresses. Briefly, explain what the program does - reverse engineering it into a higher level pseudocode may help. $a0 and $a1 are the inputs. $a0 contains a 32-bit number and $a1 is the address of a 32-element array of characters (char).

Skip Toolbars for .More Insert actions.

Format Paragraph Address Preformatted H1 - Heading 1 H2 - Heading 2 H3 - Heading 3 H4 - Heading 4 H5 - Heading 5 H6 - Heading 6

More Text actions.

More Paragraph Style actions.

Show All Components

Save

Question 59 (1 point)

Question 59 Unsaved

Consider the following C code:

code

Fill in the missing blanks (corresponding to instructions or registers) for the corresponding MIPS assembly (all lowercase):

# $s0=g, $s1=h

___ $t0, $s1, $s0

___ $t0, $0, else

add $s0, $s0, $s1

j done

else:sub $s0, $s0, ___

done:

Save

Question 60 (1 point)

Question 60 Unsaved

Consider the following C code:

code

Fill in the missing blanks (corresponding to instructions, registers, or label names) for the corresponding MIPS assembly (all lowercase):

# $s0=g, $s1=h

slt $t0,$s0,$s1

___ $t0,$0,else

addi $s0,___,1

j done

____: addi$s1,$s1,-1

done:

Save

Question 61 (1 point)

Question 61 Unsaved

Consider the following C code, which copies a string from src to dst, one character at a time:

c code

Fill in the missing blanks (corresponding to instructions, registers, or label names) for the corresponding MIPS assembly (all lowercase):

mipscode

Save

Question 62 (1 point)

Question 62 Unsaved

Is the address field, addr, in the machine format for jump instructions long? Why?

Yes, however there is no good reason why it is long

Yes, to specify the type of jump performed

No, the address field is not long because it uses unnecessary space

Yes, to increase the range of instructions to which an instruction can jump

Save

Question 63 (1 point)

Question 63 Unsaved

Assume the variables f, g, h, and i are given and can be considered 32-bit integers in MIPS and treated as registers. Translate the following C code into MIPS:

f = g + (h - 5)

For example: f=g-h would translate to "sub f,g,h". Do not use spaces and use all lowercase letters. Write one instruction per blank in the correct order.

Question 63 options:

Blank # 1

Blank # 2

Save

Question 64 (1 point)

Question 64 Unsaved

Assume the variables f, g, h, i, and j are given and can be considered 32-bit integers in MIPS and treated as registers. Translate the following C code into MIPS:

f = i + (h-2)

For example: f=g-h would translate to "sub f,g,h". Do not use spaces and use all lowercase letters. Write one instruction per blank in the correct order.

Blank # 1

Blank # 2

Save

Question 65 (1 point)

Question 65 Unsaved

Assume the variables f, g, h, i, and j are given and can be considered 32-bit integers in MIPS and treated as registers. Translate the following C code into MIPS:

f = g + (-f - 5)

For example: f=g-h would translate to "sub f,g,h". Do not use spaces and use all lowercase letters. Write one instruction per blank in the correct order.

Blank # 1

Blank # 2

Blank # 3

Save

Question 66 (1 point)

Question 66 Unsaved

The following C code has been translated to MIPS assembly code. Assume that the values of a, b, i, and j are in registers $s0, $s1, $t0, and $t1, respectively. Fill in the blanks of the code.

code

Save

Question 67 (1 point)

Question 67 Unsaved

Match server sizes with their properties

123

least space-efficient, most expansion

123

less space-efficient, some expansion

123

most space-efficient, limited expansion

1.

1U

2.

2U

3.

4U

Save

Question 68 (1 point)

Question 68 Unsaved

Match the following definitions or advantages to the given properties of operating systems

12

hides details of different hardware configuratons

12

enables multiple applications to share the same hardware simultaneously

12

applications do not need to be tailored for each possible device that might be present on a system

12

manages access to shared hardware resources

1.

abstraction

2.

arbitration

Save

Question 69 (1 point)

Question 69 Unsaved

Match the following definitions or advantages to the given properties of operating systems

12

enables multiple applications to share the same hardware simultaneously

12

accessing two different hard disks

12

enabling video conferencing software to use different camera devices

12

supports both Intel and AMD processors

12

switching between application

1.

abstraction

2.

arbitration

Save

Question 70 (1 point)

Question 70 Unsaved

Fill in the blanks relating to magnetic disks: stacks of

are spun at high speed by an electric motor, while, a stack of

moves back and forth across the platters to read or write data.

Save

Question 71 (1 point)

Question 71 Unsaved

Match the following definitions

123

smallest unit of data that can be addressed on a disk

123

circular paths at a constant radius from the center of the disk

123

3-dimensional structures formed by stacking tracks vertically

1.

sectors

2.

tracks

3.

cylinders

Save

Question 72 (1 point)

Question 72 Unsaved

Question 72 options:

It is convenient to

a disk to isolate data, for example the main partition of the operating system from user data, and to minimize seek time.

Save

Question 73 (1 point)

Question 73 Unsaved

SSDs are slower than mechanical hard drives, because the moving parts do not have the same stacks of heads and platters that rapidly rotate.

True

False

Save

Question 74 (1 point)

Question 74 Unsaved

SSDs move data around the drive as files are updated, in order to spread writes across all cycles and reduce wear. This, however, reduces the useful life of the SSD.

True

False

Save

Question 75 (1 point)

Question 75 Unsaved

SSDs move data around the drive as files are updated, in order to spread writes across all cycles and reduce wear. This also has the advantage of making the disk more secure.

True

False

Save

Question 76 (1 point)

Question 76 Unsaved

Match the following roles a filesystem plays as being an arbitration function or abstraction function.

12

organization of files into folders/directories

12

quotas ensure single users don't take all the space

12

human readable names for files

12

file permissions provide privacy from other users

12

routines for querying, opening, and closing files

1.

abstraction

2.

arbitration

Save

Question 77 (1 point)

Question 77 Unsaved

Fill in the blank with one word: Filesystems maintain various pieces of information, called __________, about each file, such as file name, size, owner, group, permissions, and time stamps.

Save

Question 78 (1 point)

Question 78 Unsaved

Fill in the blank with one word. Placing a file system structure onto a disk partition is a process known as ___________ a disk.

Question 78 options:

Save

Question 79 (1 point)

Question 79 Unsaved

Formatting typically destroys the structure of any filesystem previously installed on the partition and securely erases it in a manner that cannot be retrieve by computer forensics tools.

True

False

Save

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!