100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Computer Architecture Final Exam Questions and Answers (Latest Update 2024) $3.99   Add to cart

Exam (elaborations)

Computer Architecture Final Exam Questions and Answers (Latest Update 2024)

 3 views  0 purchase
  • Course
  • Computer Architecture
  • Institution
  • Computer Architecture

Computer Architecture Final Exam Questions and Answers (Latest Update 2024) CH 5 - 1. Explain the difference between register-to-register, register-to-memory, and memory-to-memory instructions. - Answers Register to register - Arguments involve only registers, data moves only within the registers,...

[Show more]

Preview 4 out of 44  pages

  • October 27, 2024
  • 44
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Computer Architecture
  • Computer Architecture
avatar-seller
TutorJosh
Computer Architecture Final Exam Questions and Answers (Latest Update 2024)

CH 5 - 1. Explain the difference between register-to-register, register-to-memory, and memory-to-
memory instructions. - Answers Register to register - Arguments involve only registers, data moves only
within the registers, time execution is much faster and the length of the bus connecting the registers s
the shortest.



Register to memory - Arguments involve a register and a memory location, data moves between a
register and a location in memory, time of execution is slower and the length of the bus is longer.



Memory to memory - Arguments involve only memory locations, data moves between two locations in
memory, time of execution is the slowest and the length of the bus is longer.

CH 5 - 2. Several design decisions exist with regard to instruction sets. Name four and explain. - Answers
1) Complexity: How much efforts are required to decode an instruction, how complex it is and what
amount of time will be required.



2) Space: While designing the total amount of space needs to be calculated as everything comes with a
cost and we need to have a better design with as minimal cost as it could be.



3) Length: The length of instruction needs to undergo thinking while design decision, do we need fixed
length instruction or variable length as before executing the instruction the CPU needs to first decode
the instruction size and again everything comes with a price.



4) Number: Number of instructions needs to be thought properly as the more number of instructions
the more time consuming and complex the design becomes.

CH 5 - 3. What is an expanding opcode? - Answers There is always a trade-off involved in expanding
opcode. On the one hand a rich set of opcode and, on the other, short and concise opcode. While we
would need to truncate some opcode, we would also need an availability of longer ones when the need
arises. There is a greater space to accommodate the operands when the opcode is short. When an
instruction requires no operands, all the bits can be can be used for the opcode which allows for greater
number of instructions.

Hence, the longer the opcode, the lesser the operands and vice versa.

,CH 5 - 4. If a byte-addressable machine with 32-bit words stores the hex value 98765432, indicate how
this value would be stored on a little endian machine and on a big endian machine. Why does "endian-
ness" matter? - Answers The term endian-ness refers to computer architecture's "byte order", or the
way the computer stores the bytes of a multiple-byte data element. Little endian machines store
information with the least significant byte first.

The hexadecimal value 98765432 would be stored as follows: 32547698



Big endian machines store information with the most significant byte first. The hexadecimal value
98765432 would be stored as follows: 98765432

CH 5 - 5. We can design stack architectures, accumulator architectures, or general-purpose register
architectures. Explain the differences between these choices and give some situations where one might
be better than another. - Answers 1) The operands found on top of the stack are what are used by stack
architectures use to execute instructions. A stack cannot be accessed at random even though the code
density of stack-based machines is good and the model for evaluation of expressions is simple.



2) An accumulator architecture has one operand implicitly in the accumulator. This allows for shorter
instructions and the internal complexity of the machine is also minimized. However, there is a lot of
memory traffic since the accumulator is but a temporary storage.



3) The most popular models for machine architectures currently are the general-purpose register
architectures. They have a higher speed than memory, linking with compilers is smoother and this
supports its effective and efficient usage.

CH 5 - 6. How do memory-memory, register-memory, and load-store architectures differ? How are they
the same? - Answers 1 - If the architecture allows an instruction to perform an operation even if there is
no operand stored in a register, sometimes allowing up to two and three operands in memory, then the
architecture is said to be Memory-memory.



2 - In the case where at least one operand is in a register and one in memory, we can identify the
architecture as a Register-memory.



3 - When it is mandatory that, for any operations on data to be performed, it first needs to be moved
into registers then the architecture is of the Load-store type.

,CH 5 - 7. What are the pros and cons of fixed-length and variable-length instructions? Which is currently
more popular? - Answers The advantage of fixed length instructions is that they perform better during
instruction pipelining. The down side though is that they are not storage efficient.

In contrast, it demands more effort to decode a variable length instructions but easier to store.

CH 5 - 8. How does an architecture based on zero operands ever get any data values from memory? -
Answers The use of a stack is necessary when machine instructions that do not allow for operands need
to perform those that do.

CH 5 - 9. Which is likely to be longer (have more instructions): a program written for a zero-address
architecture, a program written for a one-address architecture, or a program written for a two-address
architecture? Why? - Answers One-address instructions have longer in programming:

Arithmetic, logical and comparison instructions of accumulator based machines contains the address of
only one operand. It is implied that the other operand is in the accumulator. The result of the operation
is placed in the accumulator.

CH 5 - 10. Why might stack architectures represent arithmetic expressions in reverse Polish notation? -
Answers stack architectures represent arithmetic expressions in reverse Polish notation because a stack
organisation is used for evaluating the airthmetic expressions.

CH 5 - 11. Name the seven types of data instructions and explain each. - Answers 1) data movement,
arithmetic, Boolean, bit manipulation, I/O, transfer of control, and special purpose.



2) Data movement: These are the most frequently used instructions. Data is moved from memory into
registers, from registers to registers, and from registers to memory, and many machines provide
different instructions depending on source and destination. Examples of this type are MOVE, LOAD,
STORE, PUSH, POP etc.



3) Arithmetic Operations: They include those instructions that use integers and floating point numbers.
Many instruction sets provide different arithmetic instructions for various data sizes. As with data
movement instructions, there are sometimes different instructions for providing various combinations
of register and memory accesses in different modes. This class of instructions also affects the flag
registers. Examples are ADD, SUBTRACT...its, setting specific bits, and toggling specific bits.



4) Input/Output Instructions: These vary greatly among architectures. The input instruction transfers
data from a device or port to either memory or a register. The output instruction transfers data from a
register or memory to a specific port or device. The basic schemes for handling I/O are programmed I/O,
interrupt-driven I/O, and DMA devices.

, 5) Instructions for Transfer of Control: Controls instructions are used to alter the normal sequence of
program execution. These include branches, skips, procedure calls, returns and program termination.
Skip instructions are essentially branches with implied addresses. Procedure calls are special branch
instructions that automatically save the return address.



6) Special purpose Instructions: These include string processing, high-level language support, protection,
flag control, word/byte conversions, cache management etc. and any other instructions that do not fit in

CH 5 - 12. What is the difference between an arithmetic shift and a logical shift? - Answers 1) Arithmetic
Shift: These are commonly used to multiply or divide by 2, treat data as signed two's complement
numbers, and do not shift the leftmost bit, since this represents the sign of the number.



2) Logical Shift: These instructions simply shift the bits to either the left or the right by a specified
number of bits, shifting in zeros on the opposite end.

CH 5 - 13. Explain what it means for an instruction set to be orthogonal. - Answers This characteristic of
uniqueness is known as orthogonal. Consistency is another requirement of every instruction in the
instruction set besides its independence of other instructions. Orthogonal determines the uniformity in
the availability of operands and addressing modes across various operations. This implies that the
operands should not have a bearing on their addressing modes.

CH 5 - 14. What is an address mode? - Answers Addressing modes are used to identify the instruction
operand. An addressing mode can specify a constant, a register or a location in memory.

CH 5 - 15. Give examples of immediate, direct, register, indirect, register indirect, and indexed
addressing. - Answers 1 - Immediate Addressing: Operation code in the instruction is immediately
followed by the value to be referenced.



2 - Direct Addressing: Here, the memory address of value to be referenced is specified in the instruction.



3 - Register Addressing: Instead of memory location, a register is used to specify the operand.



4 - Indirect Addressing: The contents of the address field specify a pointer (address) to another location.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller TutorJosh. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $3.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

84197 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$3.99
  • (0)
  Add to cart