part1 - muneeb-mbytes/computerArchitectureCourse GitHub Wiki

INTRODUCTION

This topic discusses overall processor design, highlighting the fundamental building blocks required to construct a processor, including the Arithmetic Logic Unit (ALU) also the transition to a multicycle design, a more sophisticated approach where the processor's functionality is divided into distinct cycles will be discussed.

MIPS INSRUCTIONS

ARITHMETIC -LOGIC INSTRUCTIONS

  • add

  • sub

  • and

  • or

  • slt

Refer this link in order to understand the arithmetic logic instructions

MEMORY REFERENCE INSTRUCTIONS

  • lw

  • sw

CONTROL FLOW INSTRUCTIONS

  • beq

Refer this link in order to understand the memory reference instructions and control flow instructions

How will a processor design be implemented?

To achieve use the register or counter which is called as program counter(PC) to supply the address of an instruction to be executed.

Step 1: Fetch the instruction

The processor fetches the instruction from memory based on the address stored in the program counter (PC). The PC points to the memory location where the next instruction is stored. This fetched instruction is then stored in a special register within the processor

Step 2: Decode the Instruction

Once the instruction is fetched, the processor decodes it to determine the operation to be performed and the operands involved. For example, if the instruction is an ADD operation, the processor identifies that it needs to add two operands

Step 3: Read Operands

Based on the instruction, the processor reads the required operands. These operands could be stored in registers, memory locations, or immediate values within the instruction itself. For instance, in the case of an ADD operation, the processor would read the values from the specified registers or memory locations

Step 4: Execute the Operation

After fetching the instruction, decoding it, and reading the operands, the processor executes the operation specified by the instruction. For example, in the case of an ADD operation, the processor adds the values of the operands together

image

COMPONENTS:

components drawio

PC: A program counter(PC) is a register which keeps track of the memory address of the next instruction to be executed.

Instruction memory(IM): It is a component of a computer that stores prefetch instructions.

ALU: ALU stands for Arithmetic Logic Unit. The ALU in the computer performs arithmetic and logical operations as part of the CPU.

Data memory: Data memory serves for storing and keeping data required for the proper operation of the programs.

DATAPATH AND CONTROLLER:

Processors consist of two main components:

A datapath and a controller.

  • The datapath is the hardware that performs all the required operations.

    For example: ALU, registers, and internal buses.

  • The controller is responsible for telling the datapath what to do according to the instructions in the executing program.

    For example: switching, operation selection, data movement between ALU components, etc.

datapath drawio (1)

Two kinds of signals which flows from controller to data path and data path to controller.

  • There are control signals which go from the controller to data path
  • The status signal which comes from the data path to controller which help the controller in deciding the action.