







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








Which of the follow best matches the definition for Syntax Analysis?
Performs syntax rules checking and constructs a symbol table and abstract syntax tree.
Which of the follow best matches the definition for Lexical Analysis?
Separates the input source code text into tokens.
Which of the follow best matches the function of the Middle Stage in the compilation process?
Performs program analysis and optimization.
In the compilation process, the ______ separates the input source code text into tokens.
Lexical Analyzer (lexer)
A computer consists of five major modules. What module do registers belong to?
Data Path
The ______ of the CPU stores a small number of pieces of information, commonly the temporary results of calculations.
Registers
Which of the following best matches the definition of the Bus? Carries data between the ALU, registers, memory, and peripherals.
The ______ of the CPU acts as an interface between the processor and the outside world, including long-term storage and user interfaces.
IO / Peripherals
A computer consists of five major modules. What module does ALU belong to?
Data Path
If two computers made by different companies have the same machine language, that means they have the same:
Architecture
Which of the following best matches the definition of the Datapath?
Contains the ALU and Registers, and the interconnection between them.
The ______ of the CPU carries data between the ALU, registers, memory, and peripherals.
Bus
A program consisting of 323 instructions is executing on a simple processor. Each instruction takes 4 cycles to complete, with a clock rate of 339 KHz. How long will it take to execute the program? Give your answer in units of milliseconds with at least 1 decimal place of precision.
Select the hardware that is active during the Store stage of the instruction cycle:
Data Memory Program Counter
Select the hardware that is active during the Fetch Stage of the instruction cycle:
Program Counter Instruction Memory
A program consisting of 946 instructions is executing on a simple processor. Each instruction takes 2 cycles to complete, with a clock rate of 6 MHz. How long will it take to execute the program? Give your answer in units of microseconds with at least 1 decimal place of precision
clock frequency f = 1/T (1Hz = 1 cycle per second)
Speed 1 Program Execution / Time
X is n times faster than Y SpeedX / SpeedY = n TimeY/TimeX = n
Pareto Principle 80% of results generated by 20% of code
What design effort can improve the performance of a computer?
Decrease the clock cycles used by the program. Decrease the CPI
In comparing two computers, we execute a benchmark on each and measure the resulting speeds: Computer A: 733 Computer B: 979 How many times faster is Computer A than Computer B?
Which of the follow best matches this definition: The total number of instructions in a given program.
Instruction Count
Which of the follow best matches this definition: The duration of one clock cycle in seconds.
Clock Period
Which of the follow best matches this definition: The frequency of the clock signal, in cycles per second.
Clock Rate
In comparing two computers, we execute a benchmark on each and measure the resulting execution times: Computer A: 85 Computer B: 243 How many times faster is Computer B than Computer A?
propagation delay the time taken for an electrical signal to travel through a wire or logic system
A designer chooses to use a cheaper polymer for packaging that decreases the transfer of heat to a heat sink. All else being constant, will the performance likely increase, decrease, or stay the same?
Decrease
Select the items below that a designer can modify to effect propagation delay (select all that apply).
Manufacturing Process Processor Organization
A designer chooses to use a manufacturing process that decreases the feature size on the processor. All else being constant, will the performance likely increase, decrease, or stay the same?
Increase
A designer chooses to use an organization that increases the logic depth of the processor. All else being constant, will the performance likely increase, decrease, or stay the same?
Decrease
A designer chooses to use an organization that decreases the logic depth of the processor. All else being constant, will the performance likely increase, decrease, or stay the same?
Increase
Which of the following are causes of overflow? Adding to a variable when its value is at the upper end of the datatype range.
A variable of type unsigned short stores a value of zero. If the variable value is decremented, what exception will occur?
Underflow.
A variable of type unsigned short stores a value of 32767. If the variable value is decremented, what exception will occur?
No exception.
A variable of type unsigned int stores a value of 4,294,967, If the variable value is decremented what exception will occur?
No exception.
Which of the following are causes of underflow? Subtracting from a variable when its value is at the lower end of the datatype range.
A variable of type unsigned int stores a value of zero. If the variable value is decremented, what exception will occur?
Underflow.
In which of the following situations will endianness become an issue?
Transferring a memory block from a Little-Endian processor to a Big-Endian processor. Transferring a memory block from a Big-Endian processor to a Little-Endian processor.
Select the definition of big-endian The most significant byte of a multi-byte datatype is stored at a lower address than the least significant byte.
Select the definition of little-endian. The least significant bit of a single byte datatype is stored at a lower address than the most significant bit.
What register stores a return value of a procedure? $v
What register stores a temporary value that the caller procedure must save before calling a nested procedure?
$t
What register stores a parameter value of a procedure? #a
What are the main reasons for writing procedures in assembly programs? Select all that apply.
Easier to reuse the code Easier to understand and to debug
What register stores the return address of a procedure? $ra
What register stores a temporary value that the callee procedure must save before performing it's task?
$s
What register does the "jal" instruction automatically update? $ra
In a procedure call, what is responsible for saving the $s0 - $s7 registers?
Callee Procedure
In a procedure call, what is responsible for saving the $t0 - $t registers?
Caller Procedure
In MIPS, the stack pointer is manipulated using the instruction addiu $sp, $sp, XX where "XX" is a number that may be positive or negative. If we need to reserve enough room on the stack for 8 integers in addition to the $ra register, what is the value of XX?
A procedure does not call another procedure. How does it differ from a procedure that does call another procedure?
Register $ra does not need to be saved to stack
In a procedure call, the $a0-$a3 registers are used for what purpose?
Passing Parameters
A set of registers are reserved for procedure calls. How do we preserve all values when a procedure calls another procedure?
Use stack memory
When we write the instruction "addi $sp, $sp, -8", most likely we are preparing for:
Saving registers to stack
In a procedure call, the $ra register is used for what purpose? Storing the return address
When we write the instruction "addi $sp, $sp, 8", most likely we are preparing for:
Executing instruction jr $ra
Given a pipelined processor with 3 stages, what is the theoretical maximum speedup of the the pipelined design over a corresponding single-cycle design?
True or False: Given the following code, forwarding alone can resolve all of the hazards.
lw $s1, 0($s0) lw $s2, 4($s0) add $s3, $s1, $s sw $s3, 12($s0) lw $s4, 8($s0) add $s5, $s1, $s
Given the following code, what hazards occur? (select all that apply) lw $s1, 0($s0) lw $s2, 4($s0) sw $s3, 12($s0) lw $s4, 8($s0) add $s5, $s0, $s
None of these.
Given the following code, what hazards occur? (select all that apply) lw $s1, 0($s0) lw $s2, 4($s0) add $s3, $s1, $s beq $s3, $s2, Next lw $s4, 8($s0) Next: add $s5, $s1, $s
Data Hazards Control Hazards
Which of the following techniques can reduce the effect of the hazards in this piece of code (Select all that apply):
lw $s1, 0($s0) lw $s2, 4($s0) add $s3, $s1, $s sw $s3, 12($s0) lw $s4, 8($s0) add $s5, $s1, $s
Forwarding Stall
What MIPS instruction will always cause a stall if the next instruction uses its result?
What types of hazards does a pipelined processor need to deal with specifically? Select all that apply.
Structure Hazards Control Hazards Data Hazards
What is an advantage of static branch prediction? (Select all that apply)
Simple implementation.
Which of the following describes 2-bit history table branch prediction?
A history table is used to store multiple bits, mapped to the branch instruction address, indicating the history of the branch behavior. A state machine is used to update the table.
What is a disadvantage of a dynamic branch prediction method, like history table?
Increases hardware complexity.
What is an advantage of a dynamic branch prediction method, like history table?
Increased performance. High branch prediction accuracy (better than chance)
Which of the following describes 1-bit history table branch prediction?
A history table is used to store a single bit mapped to the branch instruction address, indicating that the branch was previously taken or untaken.
Which of the following describes static branch prediction? Hardware designer specifies to always predict a taken or untaken branch.
In the memory hierarchy design, what type of memory should be placed close to the CPU?
Which of the following types of memory is the slowest? Disk
Which of the following types of memory are generally used for the intermediate results of calculations?
Large-scale, long term storage is typically implemented with what kind of memory technology?
Disk
You are designing an internet router that will need to save it's settings between reboots. Which type of memory should be used to save these settings?
Flash
Which of the following products are an example of the SIMD architecture?
Basic Graphics Processing Unit
What is the name for an architecture that executes one instruction on one set of data at a time?
What is the name for an architecture that executes several instructions, operating on different sets of data at a time?
Which of the following products are an example of the MIMD architecture?
Intel Xeon Processor
Which of the following products are an example of the SISD architecture?
Intel Pentium Processor
Which of the following are reasons that CPU designers have adopted multiprocessing architectures?
Manage heat dissipation problems. Processing demand to solve complex problems