EECS 31/CSE 31/ICS 151 Homework 8 Questions

View Questions with Strategies
View Questions with Solutions

Problem 1

Question

(Instruction formats) Write a sequence of instructions that will compute the value of y = x2 + 2x + 3 for a given x using

  1. three-address instructions
  2. two-address instructions
  3. one-address instructions

Problem 2

Question

(Addressing modes) Write procedures for reading from and writing to a FIFO queue, using a two-address format, in comjunction with:

  1. indirect addressing
  2. relative addressing

Problem 3

Question

(Addressing modes) Write a sequence of instructions that will compute Sumaixi where A = [a1, a2, ..., a100] and X = [x1, x2, ..., x100] represent arrays that are stored in the main memory. Use two-address instructions, in conjunction with:

  1. direct addressing
  2. relative addressing
  3. indexed addressing with an auto-increment mode

Problem 4

Question

(Instruction set) Add a dedicated base register ( BR ) to the 16-bit processor shown in Figure 9.9, and then show the changes this requires in the instruction set and the processor schematic.

Problem 5

Question

(Reduced instruction set) Using the instruction set presented in Figure 9.11, propose the changes that enable it so to accommodate a register file with:

  1. 16 registers
  2. 32 registers
  3. 64 registers
  4. 256 registers

Problem 6

Question

(IS flowchart) Develop an IS flowchart for the reduced instruction set presented in Figure 9.11.

Problem 7

Question

(Branch prediction) Write a program that will compute absolute value for the RISC processor shown in Figure 9.12. Develop a timing diagram for this processor,

  1. without branch prediction
  2. with branch prediction