Professional Documents
Culture Documents
CH-02. Central Processing Unit (Instruction Set Architecture & Alu)
CH-02. Central Processing Unit (Instruction Set Architecture & Alu)
COMPUTER ARCHITECTURE
Prepared By:
Prof. Smita Dash, Assistant Professor, Dept. of CSE
CH-02 CENTRAL PROCESSING UNIT (INSTRUCTION SET ARCHITECTURE &
ALU)
The things that the CPU must do to execute the stored sequence of instructions are:
i) Fetch Instruction: The CPU must read instructions from memory one at a time.
ii) Decode Instructions: The instruction must be interpreted to determine what action is required and to
be taken.
iii) Fetch Data: The execution of an instruction may require reading data from memory or an I/O
module.
iv) Execute Instructions: the execution of an instruction may require the performance of some
arithmetic or logical operation on the data.
v) Write Data: The result of an execution may require writing data to targeted memory location or to
an I/O module.
The part of the computer performs the bulk of data processing operations is called the central processing
unit
i) The Control Unit: It is responsible for fetching instructions from the main memory and determining
their type. It supervises, monitors and controls the movement of data and instructions into and out of
the CPU and also controls the operation of ALU.
ii) The Arithmetic and Logic Unit (ALU):It performs the required micro-operations for executing the
instructions .
iii) Registers: The CPU also contains a small, high speed memory used to store temporary results and
certain control information. This memory consists of a number of registers, each of which has a
certain functions. These registers store the intermediate data during the execution of instructions.
The one-bit register FULL is set to 1 when the stack is full, and the one-bit register EMTY is set to 1 when
the stack is empty of items. DR is the data register that holds the binary data to be written into or read out of
the stack.
1. Fetch the next instruction from memory into the instruction register (IR).
2. Change the Program counter (PC) to point to the following instruction.
3. Determine the type of instruction just fetched (Decode).
4. If the instruction uses data in memory, determine where they are.
5. Fetch the data, if any, into internal CPU registers (DR).
6. Execute the instruction.
7. Store the result in the appropriate place.
8. Go to step 1 to begin executing the following instruction.
This sequence of steps (micro-operations) is central to the operation of all computers and is frequently
referred to as fetch-decode-execute cycle or Instruction cycle.
➢
The control unit of a computer is designed to go through an instruction cycle that is divided into three
major phases:
1. IMPLIED MODE:
2. IMMEDIATE MODE:
4.
6.
7.
• Memory cell pointed to by address field contains the address of (pointer to) the operand
• EA = (A)
— Look in A, find address (A) and look there for operand
• e.g. ADD (A)
— Add contents of cell pointed to by contents of A to accumulator
• Large address space
• 2n where n = word length
• May be nested, multilevel, cascaded
— e.g. EA = (((A)))
• Draw the diagram yourself
• Multiple memory accesses to find operand
• Hence slower
9.
10.
❖ INSTRUCTION SETS:
2. Internal Interrupts:
3. Software Interrupts:
What is ALU? An arithmetic logic unit (ALU) represents the fundamental building block of the central
processing unit of a computer. An arithmetic logic unit (ALU) is a digital circuit used to perform arithmetic
and logic operations. Modern CPUs contain very powerful and complex ALUs. In addition to ALUs,
modern CPUs contain a control unit (CU).
Most of the operations of a CPU are performed by one or more ALUs, which load data from input registers.
A register is a small amount of storage available as part of a CPU. The control unit tells the ALU what
operation to perform on that data and the ALU stores the result in an output register. The control unit moves
the data between these registers, the ALU, and memory.
******************************************************************************************
******************************************************************************************