128 Flashcards
Select which of the following are part of the compilation process:
Lexical Analysis, Syntax Analysis, Optimization, linking, code generation
In the compilation process, the ______ performs program analysis and optimization.
Middle Stage
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
The ______ of the CPU contains the ALU and Registers, and the interconnection between them.
Datapath
Which of the following best matches the definition of the Control Unit?
Coordinates the flow of information around the processor.
The ______ of the CPU stores a small number of pieces of information, commonly the temporary results of calculations.
Registers
Instruction cycle
fetch, decode, execute, store
Decode Hardware
Data Memory, control unit
Fetch Hardware
Instruction Memory, program counter
Execute Hardware
ALU
Store Hardware
Data Memory, program counter
System Clock
Coordinates Activity, latches memory
Select the hardware that is active during the Execute Stage of the instruction cycle:
ALU
Which of the following are stages in the instruction cycle?
Execute, decode, fetch, store
Which of the following are NOT stages in the instruction cycle?
Link, jump
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.
3.8
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, instructon 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
315.3
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?
0.7
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?
0.3
the time taken for an electrical signal to travel through a wire or logic system
propagation delay
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
A designer chooses to use a manufacturing process that increases the feature size on the processor. All else being constant, will the performance likely increase, decrease, or stay the same?
Decrease
How many symbols are used in the binary number system?
2
How many symbols are used in the decimal number system?
10
A binary “0” is represented by what physical phenomena in a modern computer?
Low Voltage
A binary “1” is represented by what physical phenomena in a modern computer?
High Voltage
What indicates a negative number in the two’s complement representation?
The most significant bit is 1
A variable of type signed short stores a value of -32768, If the variable value is decremented what exception will occur?
Underflow.
A variable of type unsigned char stores a value of zero. If the variable value is decremented, what exception will occur?
Underflow.
A variable of type signed int stores a value of -2147483648, If the variable value is decremented what exception will occur?
Underflow.
A variable of type signed short stores a value of 32767. If the variable value is incremented what exception will occur?
Overflow.
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,295 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?
$v0
What register stores a temporary value that the caller procedure must save before calling a nested procedure?
$t0
What register stores a parameter value of a procedure?
$a0
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?
$s0
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 - $t9 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?
-36
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?
3
Which of the following are true about single cycle vs. pipelined processor designs? (Select all that apply).
In a pipelined design, the processor components are fully utilized, but by different instructions. In a single cycle design, a single instruction is executing in the processor during any single clock cycle.
Pipelined processor designs increase performance, but at the cost of:
Increased processor design complexity.
Which of the following must be added to a single-cycle processor in order to implement a pipelined design? (Select all that apply)
Pipeline Registers, Modified Registers for simultaneous read/write. Hazard Detection & Mitigation Hardware
Pipeline registers store (select all that apply):
Control signals related to the instruction The results of pipeline stage execution. Instruction data necessary for the execution of later stages.
What is the maximum speedup (upper limit) of an N-stage pipelined processor?
N
Given a pipelined processor with 3 stages, what is the theoretical maximum speedup of the the pipelined design over a corresponding single-cycle design?
3
Where do we save the control signals for different instructions in a pipelined datapath?
In pipeline registers between the stages.
A load instruction can cause a stall, because:
The memory read operation takes too long
Forwarding (bypassing) alone can completely avoid stall (bubble) caused by: (select all that apply)
Arithmetic Instructions
What MIPS instruction will always cause a stall if the next instruction uses its result?
LW
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?
SRAM
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?
SRAM
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 types of memory are volatile?
DRAM, SRAM
Which of the following types of memory is the most expensive?
SRAM
Caches are typically implemented with what kind of memory technology?
SRAM
Registers are typically implemented with what kind of memory technology?
SRAM
A level 1 cache is focused on supporting what kind of locality?
Temporal Locality
An element in an array is accessed in memory. The pre-loading of other data in that array is an example of what kind of locality?
Spatial Locality
The pre-loading of instructions into a cache that follow the instruction currently being executed is an example of what kind of locality?
Spatial Locality
The instructions that make up a loop that iterates more than once are kept in a cache. This is an example of what kind of locality?
Temporal Locality
In a multilevel cache system, the level-2 cache focuses on
Low miss rate
What types of locality are used in memory design? Select all that apply.
Spatial locality, temporal locality
A variable that has been accessed more than once is kept in cache. This is an example of what kind of locality?
Temporal Locality
A level 2 cache is focused on supporting what kind of locality?
Spatial Locality
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?
SISD
What is the name for an architecture that executes several instructions, operating on different sets of data at a time?
MIMD
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