CPE 380 Exam 1

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which of the following registers, by convention, must be saved onto the stack before being used within a procedure?

$s0-$s7

Which of the following statements about MIPS's $zero register is false?

$zero can be changed by an arithmetic instruction.

MIPS's andi instruction corresponds to which of the following operators in C?

&

If we can decrease the average CPI by 50% while the clock frequency is 2GHz and instruction count is 3E5, what is the new CPU time?

0.1125 ms

For a program, instruction count is 3E5, and CPI = 1.5. Assume the clock rate of the processor is 2GHz. Answer Questions 1 to 3 accordingly. Question 1 10 / 10 pts What is the CPU time?

0.225 ms

What is the performance ratio if we reduce clock frequency to 1GHz and instruction count decreases to 2E5? (CPI remains unchanged)

0.75

What is the correct value for ? in the following table. (Note: each answer is a 26-bit number represented by 7 hexadecimal digits)

0x048D000

What is the MIPS machine code for addi $t0, $t1, 130?

0x2128 0082

What is the machine-level MIPS code for "sw $t6, 20($t7)" (list of registers is on page 105)

0xADEE0014

What is the representation of decimal number -44 in floating point?

0xC2300000

What is -63 ten in 16-bit 2's complement representation?

0xFFC1

What is the 16-bit 2's complement representation for -17?

0xFFEF

What is 1.111101×2^-3 after we round it (and normalize it if necessary) to 4 bits? (including the 1 on the left of decimal point)

1.000×2^(-2)

What is the value of floating point number0x3D540000?

1.10101×2^(-5)

What is 1.11011×2^-3 after we round it to 4 bits (including the 1 on the left of decimal point)?

1.111×2^(-3)

A program with 1.45E12 instructions takes 500 seconds to run on a 3.5 GHz processor. What is the CPI of the program?

1.21

Determine the number of instructions that P2 can execute in the same time that P1 needs to execute 2.0E9 instructions.

1.82E9

In I-format instructions, how many bits are used to encode the immediate value?

16

Assuming exponent can't be zero, we know the smallest value in floating point is 2^-126 . What is the second smallest value?

2^(-126) + 2^(-149)

We know the greatest value in floating point is (2^128 -2^104 ).What is the best approximate for the second greatest value?

2^128 - 2^105

A particular program takes 300 seconds total to run and it spends 200 seconds performing divides. Assume we can speed up the division operation. How much faster would divides need to execute to reduce the total program running time to 150 seconds? Is it possible to reduce running time to 75 seconds?

4 times faster, No

For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively. Assume that the base address of the arrays A and B are in registers $s6 and $s7, respectively. sll $t0, $s0, 2 # $t0 = f * 4 add $t0, $s6, $t0 # $t0 = &A[f] sll $t1, $s1, 2 # $t1 = g * 4 add $t1, $s7, $t1 # $t1 = &B[g] sll $t2, $s2, 2 add $t2, $s6, $t2 addi $t2, $t2, 4 lw $t3, 0($t0) # $t3 = A[f] lw $t4, 0($t2) add $t5, $t3, $t4 sw $t5, 0($t1)

B[g]=A[f]+A[h+1]

Which of the following components of performance refers to the average number of clock cycles per instruction?

Clock cycles per instruction (CPI)

'j' and 'jal' instructions can be used interchangeably in a program.

False

------ Performance is always defined as computational speed.

False

A computer cannot use a lot of power when it is at a low workload.

False

A higher-level programming language, like C++ or Java, can compute more than a lower-level programming language, like a assembly.

False

Assembler is always a single pass process.

False

Because floating point is faster than fixed point, most of modern computers support it.

False

CPI= 1.8 for a program means there is no instruction that completes in 1 clock cycles.

False

Even if we do not use register $ra in the main program, it has to be saved before calling a non-nested procedure.

False

For a given function, MIPS assembly language is likely to take fewer lines of code than the equivalent code written in C

False

ISA doesn't affect CPI.

False

If $f2= 0x02011112 and $f4= 0x02010112, the program jumps to label after running the following code? c.gt.s $f2, $f4 bclf label

False

If every instruction in an ISA (processor) took exactly 2 clock cycles to complete, then two different programs running on that processor could have different CPI.

False

If we add a positive and a negative n-bit 2's complement number overflow may happen.

False

In MIPS ISA, hardware saves the results of each division on the stack.

False

In MIPS, there is an indirect addressing mode similar to Intel x86 processor.

False

In SPEC2006 for MIPS, data transfer instructions are very common. (They're used more than other instructions.)

False

MIPS J-format is used to encode the beq instruction.

False

MIPS includes an addressing mode that adds two registers together in order to obtain the address.

False

Multiplying an unsigned number by 8 is the same as performing a logical right shift by 3 bits.

False

PC-relative addressing can cover (access) the whole memory space of MIPS.

False

The ISA is designed after the micro-architecture of a processor has been created.

False

To save cost, we should pay most attention to optimize the power consumption of a processor for its peak workload and not its low workload.

False

Today, the most common representation for signed numbers in computers is called sign and magnitude.

False

Which of the following answers is not normally a step for the linker?

Generate symbol table

The set of instructions decoded by the computer that provide the interface connecting the lowest-level software to the CPU hardware is the _______.

Instruction set architecture

Calculate the MIPS (millions of instructions per second) for P1 and P2. Based on questions 15-17, can we determine which processor has better performance just by comparing their clock rate or MIPS?

MIPS (P1) = 4.71e3, MIPS (P2) = 4.29e3, No

What is abstraction in computer design?

Making lower-level details hidden to present a simpler model for other levels.

Operations like addition and subtraction naturally need 3 operands in programming. Which of the following are the purposes of the operands in these operations?

One operand to store the result of the operation. Two operands to act as the numbers being combined.

Find the percentage of the total dissipated power comprised by static power and the ratio of static power to dynamic power for each technology.

Pentium 4: 10%. Core i5 Ivy Bridge: 42.9%

For each processor find the average capacitive loads.

Pentium 4: C = 3.2e-8 F, Core i5 Ivy Bridge: C = 2.9e-8 F

What is the difference between Von Neuman and Harvard Computer Architectures?

Separated Instruction and Data memories in Harvard Architecture

Consider we are running a given program with the following two processors. P1 has a clock rate of 4 GHz, average CPI of 0.85, and requires the execution of 6.0E9 instructions. P2 has a clock rate of 3 GHz, an average CPI of 0.7, and requires the execution of 1.5E9 instructions. For this program what is the execution time, T, for each P1 and P2 processors? Which one has better performance for this program?

T (P1) = 1.275, T(P2) = 0.35, performance (P1) < performance (P2)

Which one of the following statements is correct? (Check the results for questions 1 and 2)

The difference between first and second greatest values is much larger than the difference between first and second smallest values.

"lb" and "sb" instructions can be used to work with characters.

True

A 16-bit Intel 80286-based computer can compute as much as modern multi-core 64-bit x86 architecture if given enough time and memory.

True

A hardware designer must often trade off clock frequency versus cycle count because increasing clock frequency can increase cycle count for instructions.

True

ALU does not have direct access to main memory.

True

For MIPS, stack is part of the main memory.

True

For a MIPS program, if the current value of the PC is 0x00000000, a single jump instruction can jump to the instruction in address 0x00100400.

True

For calling a procedure if we use instruction 'jal' we have to use register $ra for the return address but if we use instruction 'jalr' we can avoid using register $ra. (read information about jalr at page A-64 of textbook)

True

ISA for MIPs has three basic instruction formats.

True

In MIPS ISA, results of multiplication are saved in Hi,Lo registers.

True

It is not easy to speed up division by parallelism similar to multiplication because we need to know the sign of difference in each step.

True

It is possible to use registers $a0-$a3 and $t0-$t9 to return results from a procedure when programming in assembly language, but $v0 and $v1 are used by convention in MIPS software.

True

Register $ra has to be saved before calling nested procedures using 'jal' instruction.

True

Registers $s0-$s7 have to be saved at the beginning of a procedure (callee) and restored at the end of the procedure if they are modified inside the procedure and the calling program (caller) needs them after return from the procedure.

True

Registers $t0-$t9 have to be saved and restored by the caller or procedure (callee) if they are modified inside the procedure and the caller program needs them after return from the procedure.

True

The data transfer instruction that copies data from a register to memory is traditionally called store.

True

The exact range for an 8-bit 2's complement number is -2^7 to 2^7 .

True

When we are programming in assembly language, we cannot use $ra for passing arguments to a procedure if 'jal' is used to call the procedure.

True

What could be an example of abstraction?

Using a set of algorithms to solve a problem. Designing a band pass filter circuit using individual electronic elements. Creating an image processing algorithm using the C programming language. Correct Answer All of the above

Which statement is NOT correct?

When processor designers start to design a processor, they consider the current technology rather than relying on the future technology.

Which of the following are problems with using Millions of Instructions Per Second (MIPS for short) as a measure for comparing computers' performance?

While MIPS specifies the instruction excution rate, it doesn't take into account what the instructions actually do. Different programs on the same computer will have different MIPS. If, for a given algorithm, a new program executes more instructions, but each instruction ends up being faster, MIPS can vary independently from performance. All of the above

What MIPS instruction is represented in machine-level code as 0x02354020?

add $t0,$s1,$s5

If we wanted to create a program to solve a problem, we would probably build the solution through a combination of ______.

algorithms

The Computer revolution is mainly due to...

both the advancement of semiconductor technology and the great ideas used in the design of computer architectures

How are the processing events inside a processor synchronized?

by the rising or falling edges of an internal square-shape clock signal

What is the hexadecimal value for ? in the following machine code?

c) 0x048D158

The number of clock cycles per second is referred to as the _______.

clock frequency (rate)

Regarding the performance, compiler cannot affect:

clock rate

The concept of designing processors to use x% of their peak energy at x% of their peak workload is known as:

energy-proportional computing

Computational speed is always the best measure of performance.

false

The unconditional go to instruction of MIPS is which of the following?

j

MIPS provides which of the following instructions for loading from memory?

lb

Which instruction is valid in MIPS assembly? Hint: pg.162 has some instructions that you may want to reference.

lbu $t2, 3($t1)

As power becomes more of a limiting factor in creating faster processors, there has been a shift towards _____ to improve computer performance.

parallelism and multiprocessors

What are the levels of abstraction in computer design?

problem, algorithm, programming language, ISA, microarchitecture, logic structures, transistor-level circuits, device

Assume "bge $t2, $t1, Label" means conditionally branch to the instruction at the Label if register $t2 is greater than or equal to register $t1. Which of the following instructios can implement this instruction?

slt $t0, $t2, $t1 beq $t0, $zero, Label bne $t0, $zero, Label

Which of the following MIPS instructions is encoded with I-format?

sw

A computer spends 90% of its time executing addition instructions and 10% of its time executing other instructions in a certain process. Designing to make the common case fast would suggest that changes should be focused on improving the speed of:

the addition instruction

We use abstraction in computer design to improve:

the productivity


Conjuntos de estudio relacionados

(Textiles) Chapter 3 Textile Fibers and their Properties

View Set

Worksheet 20.3: Contracts for the International Sales of Goods

View Set

Ch. 15- Nursing Care of a Family During Labor and Birth

View Set

Business Chapter 11 Human Resource Management: Finding and Keeping the Best Employees

View Set

ENTR Ch.2: Recognizing Opportunities & Generating Ideas

View Set

Assassination of JFK and After Effects

View Set

How Marketing Channels and Supply Chains Create Value Quiz Questions

View Set

Exam 4 endocrine and reproductive proctored assessment

View Set