Docsity

Computer Architecture and Organization, Exams of Advanced Education

Toggle sidebar
bg1
KSU CSE 230 Final exam new update
questions and answers Kennesaw State
University
In the compilation process, the ______ separates the input source code text into tokens.
Lexical Analyzer (lexer)
Middle Stage
Assembler
Backend
Syntax Analyzer (parser)
Linker - answer Lexical Analyzer (lexer)
Select which of the following are part of the compilation process:
Debugging
Syntax Analysis
Optimization
Lexical Analysis
Testing
Machine Code Generation
Program Execution - answer Syntax Analysis
Optimization
Lexical Analysis
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Computer Architecture and Organization and more Exams Advanced Education in PDF only on Docsity!

KSU CSE 230 Final exam new update

questions and answers Kennesaw State

University

In the compilation process, the ______ separates the input source code text into tokens. Lexical Analyzer (lexer) Middle Stage Assembler Backend Syntax Analyzer (parser) Linker - answer Lexical Analyzer (lexer) Select which of the following are part of the compilation process: Debugging Syntax Analysis Optimization Lexical Analysis Testing Machine Code Generation Program Execution - answer Syntax Analysis Optimization Lexical Analysis

Machine Code Generation Which of the follow best matches the definition for an Assembler? Translates assembly language code into machine code. Performs program analysis and optimization. Arranges the symbol table in memory and generates final executable machine code. Combines partial programs and libraries into a single executable. Separates the input source code text into tokens. Performs syntax rules checking and constructs a symbol table and abstract syntax tree. - answer Translates assembly language code into machine code. Which of the follow best matches the definition for Syntax Analysis? Combines partial programs and libraries into a single executable. Separates the input source code text into tokens. Performs program analysis and optimization. Arranges the symbol table in memory and generates final executable machine code. Performs syntax rules checking and constructs a symbol table and abstract syntax tree. Translates assembly language code into machine code. - answer Performs syntax rules checking and constructs a symbol table and abstract syntax tree. In the compilation process, the ______ performs program analysis and optimization. - answer Middle Stage Which of the follow best matches the definition for Lexical Analysis?

Carries data between the ALU, registers, memory, and peripherals. - answer Operates on one or more numerical values to perform calculations and operations on data. The ______ of the CPU operates on one or more numerical values to perform calculations and operations on data. Registers Control Unit ALU IO / Peripherals Memory Bus - answer ALU A computer consists of five major modules. What module does ALU belong to? Memory Data Path Control Unit Peripheral - answer Data Path Which of the following best matches the definition of the Bus? Coordinates the flow of information around the processor. Stores a small number of pieces of information, commonly the temporary results of calculations. Carries data between the ALU, registers, memory, and peripherals. Acts as an interface between the processor and the outside world, including long-term storage and user interfaces. Contains the ALU and Registers, and the interconnection between them.

Stores a large number of pieces of information, including program data and instructions. Operates on one or more numerical values to perform calculations and operations on data. - answer Carries data between the ALU, registers, memory, and peripherals. The ______ of the CPU stores a small number of pieces of information, commonly the temporary results of calculations. - answer Registers Which of the following are NOT stages in the instruction cycle? Jump Fetch Execute Store Link Decode - answer Jump Link Select the hardware that is active during the Fetch Stage of the instruction cycle: Data Memory Instruction Memory ALU Program Counter Control Unit - answer Instruction Memory Program Counter Select the hardware that is active during the Execute Stage of the instruction cycle:

Fetch Hardware - answer Instruction Memory Program Counter Execute Hardware - answer ALU Store Hardware - answer Data Memory Program Counter System Clock - answer Coordinates ActivityLatches Memory 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. - answer 3. clock frequency - answer f = 1/T (1Hz = 1 cycle per second) For a given program, Clock period x CPI (average clock Cycles Per Instruction) * IC (Instruction Count) = ? Clock Period Average Execution time of One Instruction Instruction Count Execution Time of the program - answer Execution Time of the program What design effort can improve the performance of a computer?

Decrease the CPI Increase the clock period Increase the clock cycles used by the program. Decrease the clock rate - answer Decrease the CPI What design effort can improve the performance of a computer? Increase the clock period Increase the clock rate Increase the clock cycles used by the program. Increase the CPI - answer Increase the clock rate In the four-component performance formula, the CPU time is determined by (Select all correct answers) Clock rate CPI Compilation time Instruction count - answer Clock rate CPI Instruction count A benchmark is a set of programs that: Represent the worst case performance. Represent the best case performance.

How many times faster is Computer B than Computer A? - answer. propagation delay - answer the time taken for an electrical signal to travel through a wire or logic system 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? State the Same Decrease Increase - answer 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? Stay the Same Increase Decrease - answer 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 Increase Stay the Same - answer Decrease Which of the following do NOT contribute to propagation delay (select all that apply)? Logic Depth Transistor Size Wire length

Clock Rate - answer Clock Rate 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? State the Same Increase Decrease - answer Increase 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? - answer decrease Select the items below that a designer can modify to effect propagation delay (select all that apply). - answer Manufacturing ProcessProcessor Organization A compiler produces a program with the following mix of instructions: Instruction Class Count 1 9 2 5 3 9 If it is executed on a processor with a clock period of 8 microseconds, and the following Instruction Class CPIs, what is the execution time in microseconds? Round to the nearest 0.1 microseconds. Instruction Class CPI 1 8 2 3 3 8 - answer 1272

In the field below, enter the decimal representation of the 2's complement value 11000010. - answer - 62 In the field below, enter the 2's complement representation of the decimal value -60 using 8 bits. - answer 11000100 In the field below, enter the decimal representation of the 2's complement value 11110000. - answer - 16 In the field below, enter the decimal representation of the 2's complement value 11001111. - answer - 49 In the field below, enter the 2's complement representation of the decimal value -46 using 8 bits. - answer 11010010 What indicates a negative number in the two's complement representation? - answer The most significant bit is 1 In the field below, enter the binary result of the following calculation.The numbers are given 8-bit 2's complement format, and can be positive or negative.Your answer should also be provided as 8-bit 2's complement format.11001110 + 11001111 =? - answer 10011101 In the field below, enter the binary result of the following calculation.The numbers are given 8-bit 2's complement format, and can be positive or negative.Your answer should also be provided as 8-bit 2's complement format.11000100 + 11001101 =? - answer 10010001 In the field below, enter the binary result of the following calculation.The numbers are given 8-bit 2's complement format, and can be positive or negative.Your answer should also be provided as 8-bit 2's complement format.00010011 + 00010101 =? - answer 00101000

In the field below, enter the binary result of the following calculation.The numbers are given 8-bit 2's complement format, and can be positive or negative.Your answer should also be provided as 8-bit 2's complement format.00101100 + 00010011 =? - answer 00111111 Which of the following are causes of underflow? - answer 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 4,294,967,295 If the variable value is incremented, what exception will occur? Overflow. No exception. Underflow. - answer Overflow A variable of type signed short stores a value of -32768, If the variable value is decremented what exception will occur? - answer Underflow. A variable of type unsigned int stores a value of zero. If the variable value is decremented, what exception will occur? - answer underflow A variable of type unsigned short stores a value of 32767. If the variable value is decremented, what exception will occur? - answer No exception Select the definition of big-endian. The least significant byte of a multi-byte datatype is stored at a lower address than the most significant byte. The least significant bit of a single byte datatype is stored at a lower address than the most significant bit.

sw $t0, 0($t1) Load 4 into register t Load 0 into register t Copy the contents at memory address, 4, into register t Copy the contents at memory address, 0, into register t Copy the contents of register t0 into the memory address, 4 Copy the contents of register t1 into the memory address, 0 - answer Copy the contents of register t into the memory address, 4 If register t2 contains 1 and register t3 contains 1, what value will they contain after running the following instruction? addiu $t2, $t3, 1 t2 will contain 1 and t3 will contain 1 t2 will contain 1 and t3 will contain 2 t2 will contain 2 and t3 will contain 1 t2 will contain 2 and t3 will contain 2 - answer t2 will contain 2 and t3 will contain 1 Which of the following code snippets results in a loop? j label lw $t0, 0($t1) label: label:

j new_label new_label: lw $t0, 0($t1) label: j label j label label: - answer label: j label Which of the following instructions will read a value from memory and copy it into a register? li lw sw addiu sll - answer lw Which of the following instructions will write a value from a register into memory? li lw sw addiu sll - answer sw

0xf 256 0xff 0xf01000ff - answer 0xff Which value, when written to the memory address of the LED array, will turn on LEDs 0, 2, and 4? 0b 0b 0b 0b 420 - answer 0b Assume that register $s1 contains 0xf0100000. Which instruction will copy the current value of the switches into register $t2? addu $t2, $s1, $s li $t2, 0xf lw $s1, 0($t2) lw $t2, 0($s1) sw $s1, 0($t2) sw $t2, 0($s1) - answer lw $t2, 0($s1) Assume that register $s3 contains 0xf0200000 and register $t4 contains 0b101. Which instruction will turn on LEDs 2 and 0? addu $s3, $s3, $t li $s3, 0b lw $s3, 0($t4)

lw $t4, 0($s3) sw $s3, 0($t4) sw $t4, 0($s3) - answer sw $t4, 0($s3) For the following program, which label will be branched to? main:li $t0, 1li $t1, 3beq $t0, $t1, label_anopaddiu $t0, $t0, 1beq $t0, $t1, label_bnopaddiu $t0, $t0, 1beq $t0, $t1, label_cnopaddiu $t0, $t0, 1beq $t0, $t1, label_dnopaddiu $t0, $t0, 1label_a:j mainnoplabel_b:j mainnoplabel_c:j mainnoplabel_d:j mainnop label_a label_b label_c label_d More than one of the labels will be branched to None of the labels will be branched to - answer label_c The following branch will never be taken: bne $t0, $t0, label True False - answer True If registers $t1, $t2, and $t3 all contain 2, what value will each of them contain after running the following instruction? addu $t1, $t2, $t3 - answer 4 2 2