Chapter 4 Exam Questions & Answers
(Grade A+)
Memory-reference instructions -
correct answer ✅load word (lw) and store word (sw)
Arithmetic-logical instructions -
correct answer ✅add, sub, and, & or
Conditional branch instruction -
correct answer ✅branch if equal (beq)
Key Design Principle 1 -
correct answer ✅Simplicity favors regularity
First 2 steps of every instruction, regardless of class -
correct answer ✅1. Send program counter to the memory
containing the code and fetch the instruction from memory
2. Read 1 or 2 registers, using fields of the instruction to select the
registers to read (For lw, need to read only 1 register but most
others require 2)
,Computer Organization and Architecture -
Chapter 4 Exam Questions & Answers
(Grade A+)
3 classes of instruction -
correct answer ✅1. Memory-reference instruction (lw sw)
2. Arithmetic-logical instruction (add, sub, and, or)
3. Conditional branch instruction (beq)
3rd step of instruction (after instr fetch & reg read): ALU -
correct answer ✅All 3 classes use ALU for next step:
**Memory-reference instruction: use ALU for address calculation
**Arithmetic-logical instruction: use ALU for operation execution
**Conditional branch instruction: use ALU for equality test
Step of instruction after ALU -
correct answer ✅**Memory-reference instruction: access the
memory to either read data for load or write data for store
**Arithmetic-logical or load instruction: write data from ALU or
memory back into register
**Conditional branch instruction: may need to change the next
instruction address based on the comparison, that or the program
counter should be incremented by 4 to get address of subsequent
instruction
,Computer Organization and Architecture -
Chapter 4 Exam Questions & Answers
(Grade A+)
General process of instruction execution -
correct answer ✅Value written into program counter comes from
1 of 2 adders
Data written into reg file come from either data memory or ALU
2nd input to ALU comes from register or immediate field of
instruction
Multiplexor acts as data selector that is the logic element choosing
among these sources to steer them to destination
Multiplexor selects from several inputs based on setting of its
control lines, which are set mostly on info taken from to-be-
executed instruction
Controls required depending upon class of instruction -
correct answer ✅**Data memory must read on a load and write
on a store
, Computer Organization and Architecture -
Chapter 4 Exam Questions & Answers
(Grade A+)
**Reg file must be written only a load or arithmetic-logical
instruction
**ALU must perform one of several operations
Set based on various fields of instruction
Control Unit -
correct answer ✅Has instruction as input
Determines how to set the control lines for functional units and two
of the multiplexors
Top Multiplexor - what it does and how it's set -
correct answer ✅Determines whether program counter + 4 or
branch destination address is written into program counter
Set based on Zero output of ALU, which is used to perform beq
instruction comparison