0% found this document useful (0 votes)
4 views

W3 Working Principles of Microprocessor and Implementation of Interrupts

The document covers the working principles of microprocessors, defining them as integrated circuits that function as the CPU of a computer, detailing their components, advantages, and common terms. It also explains the implementation of interrupts, which are signals that alert the processor to events needing immediate attention, and categorizes them into hardware and software interrupts. Additionally, it discusses triggering methods for interrupts and their system implementation.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

W3 Working Principles of Microprocessor and Implementation of Interrupts

The document covers the working principles of microprocessors, defining them as integrated circuits that function as the CPU of a computer, detailing their components, advantages, and common terms. It also explains the implementation of interrupts, which are signals that alert the processor to events needing immediate attention, and categorizes them into hardware and software interrupts. Additionally, it discusses triggering methods for interrupts and their system implementation.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts

Objectives:
At the end of the lesson the learner will be able to:
Define microprocessor
Describe the working principles of microprocessor
Define Interrupts

WORKING PRINCIPLES OF MICROPROCESSOR

What is a Microprocessor?

A microprocessor is an integrated circuit (IC) which incorporates core functions of a


computer’s central processing unit (CPU). It is a programmable multipurpose silicon
chip, clock driven, register based, accepts binary data as input and provides output
after processing it as per the instructions stored in the memory.

Block Diagram of a Computer

Block Diagram of a Computer

1|Page Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts
How does a Microprocessor work?

A processor is the brain of a computer which basically consists of Arithmetical and


Logical Unit (ALU), Control Unit and Register Array. As the name indicates ALU
performs all arithmetic and logical operations on the data received from input devices
or memory. Register array consists of a series of registers like accumulator (A), B, C, D
etc. which acts as temporary fast access memory locations for processing data. As the
name indicates, control unit controls the flow of instructions and data throughout the
system.

So basically a microprocessor takes input from input devices, process it as per


instructions given in the memory and produces output.

Advantages of a Microprocessor

 Low Cost
Microprocessors are available at low cost due to integrated circuit technology.
Which will reduce the cost of a computer system.
 High Speed
Microprocessor chips can work at very high speed due to the technology
involved in it. It is capable of executing millions of instructions per second.
 Small Size
Due to very large scale and ultra large scale integration technology, a
microprocessor is fabricated in a very less footprint. This will reduce the size of
the entire computer system.
 Versatile
Microprocessors are very versatile, the same chip can be used for a number of
applications by simply changing the program (instructions stored in the
memory).

2|Page Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts
 Low Power Consumption
Microprocessors are usually manufactured using metal oxide semiconductor
technology, in which MOSFETs (Metal Oxide Semiconductor Field Effect
Transistors) are working in saturation and cut off modes. So the power
consumption is very low compared to others.
 Less Heat Generation
Compared to vacuum tube devices, semiconductor devices won’t emit that much
heat.
 Reliable
Microprocessors are very reliable, failure rate is very less as semiconductor
technology is used.
 Portable
Devices or computer system made with microprocessors can be made portable
due to the small size and low power consumption.

Common Terms used in a Microprocessor

Here are some common terms that we will use in microprocessor field.

Bus

A bus is a set of conductors intended to transmit data, address or control information


to different elements in a microprocessor. Usually a microprocessor will have 3 types
of buses : Data Bus, Control Bus and Address Bus. An 8-bit processor will be using 8-
bit wide bus.

3|Page Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts

Instruction Set

Instruction set is the group of commands that a microprocessor can understand. So


instruction set is an interface between hardware and software (program). An
instruction commands the processor to switch relevant transistors for doing some
processing in data. For eg. ADD A, B; is used to add two numbers stored in the register
A and B.

Word Length

Word Length is the number of bits in the internal data bus of a processor or it is the
number of bits a processor can process at a time. For eg. An 8-bit processor will have
an 8-bit data bus, 8-bit registers and will do 8-bit processing at a time. For doing higher
bits (32-bit, 16-bit) operations, it will split that into a series of 8-bit operations.

Cache Memory

Cache memory is a random access memory that is integrated into the processor. So the
processor can access data in the cache memory more quickly than from a regular RAM.
It is also known as CPU Memory. Cache memory is used to store data or instructions
that are frequently referenced by the software or program during the operation. So it
will increase the overall speed of the operation.

Clock Speed

Microprocessors uses a clock signal to control the rate at which instructions are
executed, synchronize other internal components and to control the data transfer
between them. So clock speed refers to the speed at which a microprocessor executes

4|Page Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts
instructions. It is usually measured in Hertz and are expressed in megahertz (MHz),
gigahertz (GHz) etc.

Classification of Microprocessors

Based on Word Length

Hope you read about word length above. So based on the word length of a processor
we can have 8-bit, 16-bit, 32-bit and 64-bit processors.

RISC – Reduced Instruction Set Computer

RISC is a type of microprocessor architecture which uses small, general purpose and
highly optimized instruction set rather than more specialized set of instructions found
in others. RISC offers high performance over its opposing architecture CISC (see
below). In a processor, execution of each instruction require a special circuit to load
and process the data. So by reducing instructions, the processor will be using simple
circuits and faster in operation.

 Simple instruction set


 Larger program
 Consists of large number of registers
 Simple processor circuitry (small number of transistors)
 More RAM usage
 Fixed length instructions
 Simple addressing modes
 Usually fixed number of clock cycles for executing one instruction

5|Page Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts
CISC – Complex Instruction Set Computer

CISC is the opposing microprocessor architecture for RISC. It is made to reduce the
number of instructions per program, ignoring the number of cycles per instruction. So
complex instructions are directly made into hardware making the processor complex
and slower in operation.

This architecture is actually designed to reduce the cost of memory by reducing the
program length.

 Complex instruction set


 Smaller program
 Less number of registers
 Complex processor circuitry (more number of transistors)
 Little RAM usage
 Variable length instructions
 Variety of addressing modes
 Variable number of clock cycles for each instructions

Special Purpose Processors

There are some processors which are designed to handle some specific functions.

 DSP – Digital Signal Processors


 Coprocessors – processors used along with a main processor (8087 math-
coprocessor used with 8086)
 Input/Output processors
 Transputer – Transistor Computer : Microprocessor with its own local memory

6|Page Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts
Examples

 Intel 4004 – The First Microprocessor


 Intel 8085
 Intel 8086
 Intel Pentium 4
 Intel Core i7
 AMD Athlon

IMPLEMENTATION OF INTERRUPTS

In digital computers, an interrupt is an input signal to the processor indicating an


event that needs immediate attention. An interrupt signal alerts the processor and
serves as a request for the processor to interrupt the currently executing code, so that
the event can be processed in a timely manner. If the request is accepted, the processor
responds by suspending its current activities, saving its state, and executing
a function called an interrupt handler (or an interrupt service routine, ISR) to deal with
the event. This interruption is temporary, and, unless the interrupt indicates a fatal
error, the processor resumes normal activities after the interrupt handler finishes.
Interrupts are commonly used by hardware devices to indicate electronic or physical
state changes that require attention. Interrupts are also commonly used to
implement computer multitasking, especially in real-time computing. Systems that use
interrupts in these ways are said to be interrupt-driven.

TYPES

Interrupt signals may be issued in response to hardware or software events. These are
classified as hardware interrupts or software interrupts, respectively. For any
particular processor, the number of hardware interrupts is limited by the number of
interrupt request (IRQ) signals to the processor, whereas the number of software
interrupts is determined by the processor design.
7|Page Computer Architecture and Organization
WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts
Hardware interrupts
A hardware interrupt request (IRQ) is an electronic signal issued by an external (to the
processor) hardware device, to communicate that it needs attention from the operating
system (OS) or, if there is no OS, from the "bare-metal" program running on the CPU.
Such external devices may be part of the computer (e.g., disk controller) or they may
be external peripherals. For example, pressing a keyboard key or moving
the mouse triggers hardware interrupts that cause the processor to read the keystroke
or mouse position.
Unlike software interrupts, hardware interrupts can arrive asynchronously with
respect to the processor clock, and at any time during instruction execution.
Consequently, all hardware interrupt signals are conditioned by synchronizing them
to the processor clock, and acted upon only at instruction execution boundaries.
In many systems, each device is associated with a particular IRQ signal. This makes it
possible to quickly determine which hardware device is requesting service, and to
expedite servicing of that device.

Masking
Processors typically have an internal interrupt mask register which allows selective
enabling and disabling of hardware interrupts. Each interrupt signal is associated with
a bit in the mask register; the interrupt is enabled when the bit is set and disabled
when the bit is clear, or vice versa. When the interrupt is disabled, the associated
interrupt signal will be ignored by the processor. Signals which are affected by the
mask are called maskable interrupts.
Some interrupt signals are not affected by the interrupt mask and therefore cannot be
disabled; these are called non-maskable interrupts (NMI). NMIs indicate high priority
events which cannot be ignored under any circumstances, such as the timeout signal
from a watchdog timer.

8|Page Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts

Spurious interrupts
A spurious interrupt is the occurrence of a false interrupt request signal. These are
typically short-lived, invalid signal levels which are generated by electrical
interference or malfunctioning devices.
Software interrupts
A software interrupt is requested by the processor itself upon executing particular
instructions or when certain conditions are met. Every software interrupt signal is
associated with a particular interrupt handler.

A software interrupt may be intentionally caused by executing a


special instruction which, by design, invokes an interrupt when executed. Such
instructions function similarly to subroutine calls and are used for a variety of
purposes, such as requesting operating system services and interacting with device
drivers (e.g., to read or write storage media).
Software interrupts may also be unexpectedly triggered by program execution errors.
These interrupts typically are called traps or exceptions. For example, a divide-by-zero
exception will be "thrown" (a software interrupt is requested) if the processor executes
a divide instruction with divisor equal to zero. Typically, the operating system will
catch and handle this exception.

TRIGGERING METHODS

Each interrupt signal input is designed to be triggered by either a logic signal level or a
particular signal edge (level transition). Level-sensitive inputs continuously request
processor service so long as a particular (high or low) logic level is applied to the input.
Edge-sensitive inputs react to signal edges: a particular (rising or falling) edge will
cause a service request to be latched; the processor resets the latch when the interrupt
handler executes.

9|Page Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts
Level-triggered
A level-triggered interrupt is requested by holding the interrupt signal at its particular
(high or low) active logic level. A device invokes a level-triggered interrupt by driving
the signal to and holding it at the active level. It negates the signal when the processor
commands it to do so, typically after the device has been serviced.
The processor samples the interrupt input signal during each instruction cycle. The
processor will recognize the interrupt request if the signal is asserted when sampling
occurs.

Level-triggered inputs allow multiple devices to share a common interrupt signal via
wired-OR connections. The processor polls to determine which devices are requesting
service. After servicing a device, the processor may again poll and, if necessary, service
other devices before exiting the ISR.

Edge-triggered
An edge-triggered interrupt is an interrupt signaled by a level transition on the interrupt
line, either a falling edge (high to low) or a rising edge (low to high). A device wishing
to signal an interrupt drives a pulse onto the line and then releases the line to its
inactive state. If the pulse is too short to be detected by polled I/O then special
hardware may be required to detect it.

PROCESSOR RESPONSE
The processor samples the interrupt trigger signal during each instruction cycle, and
will respond to the trigger only if the signal is asserted when sampling occurs.
Regardless of the triggering method, the processor will begin interrupt processing at
the next instruction boundary following a detected trigger, thus ensuring:

 The Program Counter (PC) is saved in a known place.


 All instructions before the one pointed to by the PC have fully executed.

10 | P a g e Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts
 No instruction beyond the one pointed to by the PC has been executed, or any such
instructions are undone before handling the interrupt.

 The execution state of the instruction pointed to by the PC is known.

SYSTEM IMPLEMENTATION

Interrupts may be implemented in hardware as a distinct component with control


lines, or they may be integrated into the memory subsystem.

If implemented in hardware as a distinct component, an interrupt controller circuit


such as the IBM PC's Programmable Interrupt Controller (PIC) may be connected
between the interrupting device and the processor's interrupt pin to multiplex several
sources of interrupt onto the one or two CPU lines typically available. If implemented
as part of the memory controller, interrupts are mapped into the system's
memory address space.

11 | P a g e Computer Architecture and Organization


WEEK 3: Working Principles of Microprocessor and Implementation of Interrupts

REFERENCES:

https://electrosome.com/microprocessor/

https://en.m.wikipedia.org/wiki/Interrupt

12 | P a g e Computer Architecture and Organization

You might also like