Problem Set Answers: Computer Systems
- The PC holds the address of the next instruction to be executed. The IR holds the
instruction being executed.
-
- address
- data
- control
- power
- This is done for better performance. If there is only one bus then devices
have to wait to use the bus. This slows the system down significantly, especially when
the CPU is trying to fetch an instruction from memory and has to wait.
- Interrupts provide a mechanism to signal the CPU that some event has occurred that
needs to be handled.
-
- I/O
- timer
- memory fault
- debugging break point reached
- divide by zero
- overflow/underflow
- An interrupt handler is software. There is one handler for each type
of interrupt. The handler takes care of the conditions that caused the
interrupt, so that execution of the current process can resume.
-
- IF: instruction fetch
- ID: instruction decode/register fetch
- EX: execute/compute effective address
- MEM: memory access
- WB: write back
- The next instruction is fetched from memory (at the address given by the PC)
and stored in the IR. The PC is incremented by 4 to get the address of the
next instruction (assuming there is no branch).
-
- ID: The control circuits decode the instruction in the IR to determine
what operation is specified. The registers specified in the instruction
are fetched from the register file and loaded into the ALU inputs.
- EX: The operation specified by the instruction is performed
by the ALU and placed on the output of the ALU.
- MEM: Nothing is done.
- WB: The result of the operation is copied from the ALU output to
the destination register.
-
- ID: The control circuits decode the instruction in the IR to determine
what operation is specified. The registers specified in the instruction
are fetched from the register file and loaded into the ALU inputs.
The immediate operand is sign extended.
- EX: The new PC is calculated: the sign extended immediate operand is
left shifted twice (to multiply by 4) and then added to the PC.
The register(s) from the instruction are subtracted by the ALU
(to see whether
they are equal, or which one is larger) and then the branch logic
determines whether the branch will be taken.
- MEM: Nothing is done.
- WB: Nothing is done.
-
- ID: The control circuits decode the instruction in the IR to determine
what operation is specified. The registers specified in the instruction
are fetched from the register file and loaded into the ALU inputs.
The immediate operand is sign extended.
- EX: The sign extended immediate operand is added to Rs by the ALU to
calculate the effective address.
- MEM: The effective address is sent to memory and the data at
that address is read.
- WB: The data read is written to
the destination register.
-
- ID: The control circuits decode the instruction in the IR to determine
what operation is specified. The registers specified in the instruction
are fetched from the register file and loaded into the ALU inputs.
The immediate operand is sign extended.
- EX: The sign extended immediate operand is added to Rs by the ALU to
calculate the effective address.
- MEM: The effective address and the value of Rt are sent to
memory and the value of Rt is written to memory at that address.
- WB: Nothing is done.
-
SpeedUp = (200ns x 200)/((5+200-1)(40ns)) = 40000/8160 = 4.91
Max SpeedUp = 5
-
SpeedUp = (100ns x 100)/((5+100-1)(20ns)) = 10000/2080 = 4.8
Max SpeedUp = 5
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2021