Microprocessor
Microprocessor
By Shuvra Baral
Introduction to Microprocessors
• Microprocessor is brain of microcomputer
• It is a single chip which is capable of processing data
• It controls all components (memory, i/o)
• It executes sequence of instruction
• It fetch, decode and execute the instruction
• A microprocessor is a computer processor that incorporates the
functions of a central processing unit on a single integrated circuit
(IC), or small number of integrated circuits
• It has ALU, a control unit, registers, bus systems and clock to perform
computational tasks
• It is a programmable, multipurpose registered-based device that
reads binary instructions
• Used in – tv remote, traffic light, computer- where programming is
involved
Block Diagram of a Computer with the Microprocessor as CPU
Microprocessor as
CPU
ALU
Array
Input Register Output
Control Unit
Memory
• Arithmetical Logical Unit (ALU)
• Performs computing functions on data
• Performs arithmetic operations such as addition and
subtraction and logical operations such as AND, OR and
exclusive OR
• Register Unit
• It consists of various registers
• Registers are used primarily to store data temporarily during
the execution of a program
• Memory
• Can store instructions, data and intermediate results
• Supplies information to other units of the computer when
needed
• Also known as Main memory or primary storage
• Its size affects speed, power and capability
• All inputs and outputs are transmitted through the main
memory
• Control Unit
• Controls the operations of all parts of the computer but does not
carry out any actual data processing operations
• It is responsible for controlling the transfer of data and instructions
among other units of a computer
• It manages and coordinates all the units of the computer
• It obtains the instructions from the memory, interprets them and
directs the operation of the computer
• It communicates with I/O devices for transfer of data or results from
storage
• It does not or process or store data
• Features of Microprocessor
• Low Cost – Due to integrated circuit technology microprocessors are
available at very low cost. It will reduce the cost of a computer system.
•High Speed – Due to the technology involved in it, the microprocessor can
work at very high speed. It can execute millions of instructions per second.
CPU
Arithmetic Logic
Unit (ALU)
Memory
Control Bus
Address Bus
Data Bus
• Main parts of microcomputer (CPU, memory and I/O unit) are connected
through three sets of parallel lines called buses.
• Address Bus , Data Bus and Control Bus
15 14 13 12 11 10 9 …................. 0
Other inputs
3*8
I Decoder Combinational
Control Logic
76543210
D0
D7 Control
Signal
T15
T0
15 14 13 210
4 *16 decoder
Increment (INR)
4 bit
Sequence Counter Clear (CLR)
(SC) Clock
• First 12 bits (0-11) are applied to control logic gates
• The operation code bits (12-14) are decoded with 3*8 decoder
• The 8 output (D0-D7) from a decoder goes to the control logic gates
to perform specific operation
• Last bit 15 is transferred to a I flipflop
• The 4 bit sequence counter (SC) can count in binary from 0-15
• The counter output is decoded into 16 timing pulses T0-T15
• The sequence counter can be incremented by INR Input or clear by
CLR synchronously
•Hardwired Control Unit consists of
• Instruction registers
• Number of control gates
• 2 decoders
• 4-bit sequence counter
• In the hardwired control, the control units use fixed logic circuit to
interpret instructions and generate control signals from them.
• Hardwired control is faster than microprogrammed control
• A controller that uses this approach can operated at high speed.
• This organization is very complicated if we have a large control unit.
• In this organization, if design has to be modified or changed, requires
changes in the wiring among the various components.
• Thus the modification of all the combinational circuits may be very
difficult.
• Advantages
• Hardwired control unit is fast because control signals are generated
by combinational circuits
• The delay in generation of control signals depends upon the number
of gates
• Disadvantages
• More the control signals required by CPU, more complex will be
design on control unit
• A modification in control signal is very difficult. That means it
requires rearranging of wired in the hardware circuit
• It is difficult to correct mistake in original design or adding new
features in existing design of control unit.
Microprogrammed Control Unit
• It is implemented using programming approach
• A sequence of micro-operation re carried out by executing a program
consisting of micro-instructions. Micro-instruction consist of 9micro-
operation
• Micro-program consisting of micro-instruction stored in the control
memory of the control unit
• Execution of a micro-instruction is responsible for generation of a set
of control signals
• Architecture of Micro-programmed control unit
External Control
input word
Next address Control address Control Data
Control Memory
generator register register
Memory
Input
Output
Control Unit ALU
accumulator
Processor
1. Control Unit
A control unit (CU) handles all processor control signals. It directs all
input and output flow, fetches code for instructions, and controls how
data moves around the system.
• Arithmetic and Logic Unit (ALU) –
The arithmetic logic unit is that part of the CPU that handles all the
calculations the CPU may need, e.g. Addition, Subtraction,
Comparisons. It performs Logical Operations, Bit Shifting Operations,
and Arithmetic operations.
• CPU:
1. Main Memory Unit (Registers) – Accumulator: Stores the results of
calculations made by ALU.
2.Program Counter (PC): Keeps track of the memory location of the
next instructions to be dealt with. The PC then passes this next
address to Memory Address Register (MAR).
3.Memory Address Register (MAR): It stores the memory locations of
instructions that need to be fetched from memory or stored into
memory.
1.Memory Data Register (MDR): It stores instructions fetched from
memory or any data that is to be transferred to, and stored in,
memory.
2.Current Instruction Register (CIR): It stores the most recently fetched
instructions while it is waiting to be coded and executed.
3.Instruction Buffer Register (IBR): The instruction that is not to be
executed immediately is placed in the instruction buffer register IBR.
• Input/Output Devices – Program or data is read into main memory
from the input device or secondary storage under the control of CPU
input instruction. Output devices are used to output the information
from a computer. If some results are evaluated by computer and it is
stored in the computer, then with the help of output devices, we can
present them to the user.
• Buses – Data is transmitted from one part of a computer to another,
connecting all major internal components to the CPU and memory, by
the means of Buses. Types:
• Data Bus: It carries data among the memory unit, the I/O devices,
and the processor.
• Address Bus: It carries the address of data (not the actual data)
between memory and processor.
• Control Bus: It carries control commands from the CPU (and
status signals from other devices) in order to control and
coordinate all the activities within the computer.
Bottleneck of Von Neuman Architecture
• In the von Neumann architecture, a computer's main components
include the central processing unit (CPU), the memory unit, and the
input and output devices.
• The CPU contains the control unit, arithmetic and logic unit and
registers.
• The processor and memory are separate components, with data
moving between them via the system bus.
• The memory unit, often referred to as main memory or primary
memory, stores both the program instructions and data.
• The system bus is used to transfer all data between the components
that make up the von Neumann architecture, creating what has
become an increasing bottleneck as workloads have changed and
data sets have grown larger.
• Over the years, computer components have evolved to try to meet
the needs of these changing workloads. For example, processor
speeds are significantly faster, and memory supports greater
densities, making it possible to store more data in less space.
Introduction to register transfer language
• Register: it is a very fast computer memory used to store
data/instruction in execution.
• A register temporarily holds frequently used data, instructions, and
memory address that are to be used by CPU
P
Control function R2
P=1 n
R1
n= number of bits
• It indicates that if P=1, then the content of R1 is transferred to R2. it
is a unidirectional operation.
3. Simultaneous Operation:
If 2 or more operations are to occur simultaneously then they are separated
with (,).
clock
P:R2<-R1, R1<-R2 P
Control function R2
P=1 n
R1
n= number of bits n
• If the control function P=1, then load the content of R1 into R2 and at
the same clock load the content of R2 into R1.