COMPUTER ORGANIZATION AND DESIGN
RISC V EDITION CERTIFICATION
EVALUATION SOLVED QUESTIONS WITH
VERIFIED ANSWER KEY
●● What is an "instruction set"?
Answer: An instruction set is the complete collection of commands that
a computer's processor can execute, forming the "vocabulary" of the
computer's language.
●● What are the key design principles for instruction sets?
Answer: Instruction sets are designed with simplicity, speed, and cost in
mind. The three core principles include:
Simplicity favors regularity
Smaller is faster
Good design requires compromises.
●● How does an assembly instruction like add a, b, c work in RISC-V?
Answer: The add a, b, c instruction in RISC-V takes the values from
registers b and c, adds them, and stores the result in register a.
,●● What is the three-operand format used in RISC-V, and why is it
used?
Answer: RISC-V instructions typically have three operands—two
sources and one destination—to simplify hardware design and ensure
regularity, following the principle that simplicity favors regularity.
●● Why are registers used as operands in RISC-V and what advantages
do they provide?
Answer: Registers are directly accessible by the CPU, allowing for faster
data retrieval and more efficient processing compared to memory. In
RISC-V, each register is 32 bits, also referred to as a word.
●● Why do RISC-V systems limit the number of registers?
Answer: The limit, typically 32 registers, is to keep hardware simpler
and faster, as adding more registers can increase delay due to the extra
hardware complexity required.
●● What is a data transfer instruction, and what is an example in RISC-
V?
Answer: Data transfer instructions move data between memory and
registers. For example, lw (load word) loads data from memory into a
register using a memory address composed of a base address and offset.
●● What is sign extension, and why is it used?
,Answer: Sign extension fills a larger register with copies of the sign bit
(the MSB) of a smaller signed number. This ensures the value remains
accurate when moving a number to a larger bit-width register.
●● What is a sign bit?
Answer: The sign bit is the most significant bit (MSB) in a binary
number that indicates whether the number is positive or negative. In
two's complement representation, a sign bit of 0 means the number is
positive, and 1 means it's negative.
●● What is a program counter?
Answer: The program counter is a register that holds the memory
address of the next instruction to execute. It increments sequentially, but
updates to a new address when a branch, jump, or function call occurs,
controlling the flow of the program
●● What is the stack pointer in a CPU?
Answer: The stack pointer is a register that holds the address of the most
recently allocated memory location on the stack. It shows where new
data (e.g., spilled registers, local variables) can be stored or where old
values can be retrieved. In RISC-V, the stack pointer is typically the sp
register (x2)
●● What is register spilling, and why is it used?
Answer: Register spilling occurs when there are more variables than
available registers, forcing some values to be temporarily stored in
, memory (usually on the stack). This allows programs to handle more
data than can fit in registers, at the cost of additional memory access
time.
●● What is a data race?
Answer: A data race occurs when two threads access the same memory
location simultaneously, with at least one being a write operation.
Without proper synchronization, this leads to unpredictable results
depending on the execution order
●● What is an ALU?
Answer: The Arithmetic Logic Unit (ALU) is a core computational
component of a computer, performing arithmetic (e.g., addition,
subtraction) and logical operations (e.g., AND, OR).
●● How is a 32-bit ALU constructed?
Answer: It is built from 32 1-bit ALUs, each responsible for operations
on a single bit of two operands. The CarryOut of one ALU connects to
the CarryIn of the next, forming a ripple carry adder.
●● What components are used in a 1-bit ALU?
Answer: Logic Gates: For AND, OR operations.
Adder: Handles addition and propagates carry bits.
Multiplexor: Selects between operations based on control signals
RISC V EDITION CERTIFICATION
EVALUATION SOLVED QUESTIONS WITH
VERIFIED ANSWER KEY
●● What is an "instruction set"?
Answer: An instruction set is the complete collection of commands that
a computer's processor can execute, forming the "vocabulary" of the
computer's language.
●● What are the key design principles for instruction sets?
Answer: Instruction sets are designed with simplicity, speed, and cost in
mind. The three core principles include:
Simplicity favors regularity
Smaller is faster
Good design requires compromises.
●● How does an assembly instruction like add a, b, c work in RISC-V?
Answer: The add a, b, c instruction in RISC-V takes the values from
registers b and c, adds them, and stores the result in register a.
,●● What is the three-operand format used in RISC-V, and why is it
used?
Answer: RISC-V instructions typically have three operands—two
sources and one destination—to simplify hardware design and ensure
regularity, following the principle that simplicity favors regularity.
●● Why are registers used as operands in RISC-V and what advantages
do they provide?
Answer: Registers are directly accessible by the CPU, allowing for faster
data retrieval and more efficient processing compared to memory. In
RISC-V, each register is 32 bits, also referred to as a word.
●● Why do RISC-V systems limit the number of registers?
Answer: The limit, typically 32 registers, is to keep hardware simpler
and faster, as adding more registers can increase delay due to the extra
hardware complexity required.
●● What is a data transfer instruction, and what is an example in RISC-
V?
Answer: Data transfer instructions move data between memory and
registers. For example, lw (load word) loads data from memory into a
register using a memory address composed of a base address and offset.
●● What is sign extension, and why is it used?
,Answer: Sign extension fills a larger register with copies of the sign bit
(the MSB) of a smaller signed number. This ensures the value remains
accurate when moving a number to a larger bit-width register.
●● What is a sign bit?
Answer: The sign bit is the most significant bit (MSB) in a binary
number that indicates whether the number is positive or negative. In
two's complement representation, a sign bit of 0 means the number is
positive, and 1 means it's negative.
●● What is a program counter?
Answer: The program counter is a register that holds the memory
address of the next instruction to execute. It increments sequentially, but
updates to a new address when a branch, jump, or function call occurs,
controlling the flow of the program
●● What is the stack pointer in a CPU?
Answer: The stack pointer is a register that holds the address of the most
recently allocated memory location on the stack. It shows where new
data (e.g., spilled registers, local variables) can be stored or where old
values can be retrieved. In RISC-V, the stack pointer is typically the sp
register (x2)
●● What is register spilling, and why is it used?
Answer: Register spilling occurs when there are more variables than
available registers, forcing some values to be temporarily stored in
, memory (usually on the stack). This allows programs to handle more
data than can fit in registers, at the cost of additional memory access
time.
●● What is a data race?
Answer: A data race occurs when two threads access the same memory
location simultaneously, with at least one being a write operation.
Without proper synchronization, this leads to unpredictable results
depending on the execution order
●● What is an ALU?
Answer: The Arithmetic Logic Unit (ALU) is a core computational
component of a computer, performing arithmetic (e.g., addition,
subtraction) and logical operations (e.g., AND, OR).
●● How is a 32-bit ALU constructed?
Answer: It is built from 32 1-bit ALUs, each responsible for operations
on a single bit of two operands. The CarryOut of one ALU connects to
the CarryIn of the next, forming a ripple carry adder.
●● What components are used in a 1-bit ALU?
Answer: Logic Gates: For AND, OR operations.
Adder: Handles addition and propagates carry bits.
Multiplexor: Selects between operations based on control signals