ALU, Data Path and Control Unit

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

ALU,Data path and control

unit
ALU
 Arithmetic-Logic Unit (ALU)
 ALU is the part of a central processing unit that carries out arithmetic and logic
operations on the operands
 ALU is divided into two units:
 An arithmetic unit (AU) and
A logic unit (LU).
 The control unit supplies the data required by the ALU from memory, or from
input devices, and directs the ALU to perform a specific operation based on the
instruction fetched from the memory
Different operations

 logical operations − These include operations like AND, OR, NOT,


XOR, NOR, NAND, etc.
 Bit-Shifting Operations − This pertains to shifting the positions of
the bits by a certain number of places either towards the right or
left, which is considered a multiplication or division operations.
 Arithmetic operations − This refers to bit addition and
subtraction
How ALU works?

 ALU has direct input and output access to the processor controller,
main memory (random access memory or RAM in a personal computer)
and input/output devices
 Inputs and outputs flow along an electronic path that is called a bus
Configurations of the ALU

 Instruction Set Architecture


 Accumulator
 Stack
 Register to Register
 Register Stack
 Register Memory
Types of the bus
 BUS: communication system that transfers data between components inside a
computer, or between computers

Types:
 Address bus: The buses which are used to carry address.

 Data bus: The buses which are used to carry data.

 Control bus: If the bus is carrying control signals.

 Power bus: If it is carrying clock pulse, power signals it is known as a power


bus
One Bus organization
One bus datapath
 Disadvantage
 It is one of the simplest and also this is very cheap to implement.
Disadvantage
 It has only one bus and this “one bus” is accessed by all general-purpose
registers, program counter, instruction register, MAR, MDR making each and
every operation sequential. No one recommends this architecture nowadays
Two Bus organizations
Three Bus organization

•Reduction in the
number of cycles for
execution.

•Increases the speed


of execution
Multi bus Datapath
 The main advantages of multiple bus organizations over the single bus
are as given below.

1. Increase in size of the registers.

2. Reduction in the number of cycles for execution.

3. Increases the speed of execution or we can say faster execution.


4. It was developed to overcome the “busy waiting” problem of two bus
organizations.
Control unit
 Control Unit is the part of the computer’s central processing unit (CPU), which directs
the operation of the processor.
 Synchronize the tasks with the help of sending timings and control signals
 Control unit of the CPU must generate the required control signal in the proper sequence
 Types:

 Micro programmed control units


 Hardwired control units
Control Signals
 Control signals are used to know what operation is going to be performed
 It is used to know about the sequence of operations that are performed by
the processor
 It is used to know about the timing at which an operation must be executed

Block Diagram of control unit


Functions of the Control Unit:

 It coordinates the sequence of data movements into, out


of, and between a processor’s many sub-units.
 It interprets instructions.
 It controls data flow inside the processor.
 It receives external instructions or commands to which it
converts to sequence of control signals.
 It controls many execution units (i.e. ALU, data buffers
and registers) contained within a CPU.
 It also handles multiple tasks, such as fetching, decoding,
execution handling and storing results.
Hardwired Control Unit

 Hardwired control unit, the control


signals that are important for
instruction execution control are
generated by specially designed
hardware logical circuits
 Control signals are generated using a
state counter and a PLA circuit
 hardwired CU is generally .faster
Hardwired Control Unit
 Instruction register: is a type of processor register used to contain an instruction that is
currently in execution
 instruction register is used to generate the OP-code bits respective of the operation
 instruction decoder: interprets the operation and instruction's addressing mode
 instruction decoder sets the corresponding Instruction signal INSi to 1
 instruction fetch, decode, operand fetch, Arithmetic and logical unit, and memory
store
 Step Counter - information about the current step of instruction must be known by the
control unit , to know the current step, a Clock is implemented
 Counter Enable : To stop if the execution of an instruction is interrupted for some
reason
 Condition Signals : conditions in which the signals are generated with the help of
control signals that can be less than, greater than, less than equal, greater than equal,
and many more
 External input :It is used to tell the Control Signal Generator about the interrupts
Micro-programmed Control Unit

 Generating control signals, and sequencing through


microinstructions
 It will generate the control signals with the help of programs
 The program which is used to create the control signals is known
as the "Micro-program"
 The micro-program is placed on the processor chip, which is a
type of fast memory
 This memory is also known as the control store or control memory
 A micro-program is used to contain a set of microinstructions.
Micro-programmed Control Unit
 Instruction fetch is the first step.
 Decode is the second step. In this step, the instructions
obtained from the instruction register will be decoded with
the help of a microinstruction address generator. Here we
will also get the starting address of a micro-routine.
 Increment is the third step. In this step, the control word,
which corresponds to the starting address of a micro-
program, will be read.
 End bit is the fourth step. In this step, the microinstruction
of a micro-routine contains a bit, which is known as the end
bit. The execution of the microinstruction will be
successfully completed when the end bit is set to 1.
Difference between Hardwired and Microprogrammed Control Unit:
Speed
In the hardwired control unit, the speed of operations is very fast. In contrast, the micro-
programmed control unit needs frequent memory access. So the speed of operation of
a micro-programmed control unit is slow.
Modification
If we want to do some modifications to the Hardwired control unit, we have to redesign
the entire unit. In contrast, if we want to do some modification in the micro-programmed
control unit, we can do that just by changing the microinstructions in the control
memory. In this case, the more flexible control unit is a micro-programmed control unit.
Cost
The implementation of a Hardwire control unit is very much compared to the Micro-
programmed control unit. In this case, the micro-programmed control unit will save our
money at the time of implementation.
Handling Complex Instructions
If we try to handle the complex instructions with the help of a hardwired control unit, it
will be very difficult for us to handle them. But if we try to handle the complex
instructions with the help of micro-programmed control unit, it will be very easy for us to
handle them. In this case also, the Micro-programmed control unit is better.
Instruction decoding
In the hardwired control unit, if we want to perform instruction decoding, it will
be very difficult. But if we do the same thing in a micro-programmed control
unit, it will be very easy for us.
Instruction set size
A small instruction set is used by the hardwired CU. On the other hand, a
large instruction set is used by the micro-programmed control unit.
Control Memory
The hardwired control unit does not use the control memory to generate the
control signals, but the micro-programmed CU needs to use the control
memory to generate the control signals.
Applications
The hardwired control unit is used in those types of processors that basically
use a simple instruction set. This set is called a Reduced Instruction Set
Computer.
A micro-programmed control unit is used in those types of processors that
basically use a complex instruction set. This set is called a Complex
Instruction Set Computer.

You might also like