Unit 1 Part I
Unit 1 Part I
It is a chip which is called single chip computer. It is a general purpose device which is called a CPU.
Microcontroller Microprocessor
Microcontroller have no advantage of designing RAM, It have advantages of versatility such that designer can
ROM, I/O port. decide the amount of RAM, ROM, I/O port as needed.
Each instruction needs an internal operation. Each instruction needs an external operation.
• External Communication
• Very Slow
Components of a System Bus
The system bus typically consists of three main components:
1. Data Line/Bus
2. Address Line/Bus
3. Control Line/Bus
Components of a System Bus - Data
Line/Bus
Function: Carries actual data
between the CPU, memory, and
I/O devices.
Direction: Bi-directional,
allowing data to flow both to
and from the CPU.
Characteristics: The width of
the data bus (number of wires)
determines how much data can
be transferred simultaneously
(e.g., 8-bit, 16-bit, 32-bit).
Components of a System Bus - Address
Line/Bus
Function: Carries the addresses
of data (not the data itself) to
specify where data should be
sent or read from in memory.
Direction: Unidirectional; it
only sends addresses from the
CPU to other components.
Characteristics: The width of the
address bus determines how
much memory can be addressed
(e.g., a 20-bit address bus can
address 220 locations).
Components of a System Bus - Control
Line/Bus
Function: Transmits control
signals that manage the
operations of the CPU and
other components.
Direction: Bi-directional; it
carries signals that coordinate
activities among various
devices.
Characteristics: Ensures that
data transfers occur without
collisions by managing timing
and control signals.
Components of a System Bus - Control
Line/Bus
• Used to control the access to and
the use of the data and address
lines
• Since the data and the address line
shared by all the components, there
must be a means of controlling their
use
• Control signal transmit both
commands and timing information
between the modules
• Typical control lines includes;
Memory write , Memory read, I/O
write, I/O read, Clock, Reset, Bus
request, Bus grant, Interrupt request
Bus Type Direction Function Characteristics Examples
Address Unidirectional Carries address - Only sends addresses Used in all computer
Bus information for from CPU to systems
data locations memory/I/O devices
- Determines how
much memory can be
accessed based on
width (n lines
= 2n2n addresses)
Data Bus Bidirectional Transfers actual - Allows data to flow System bus in PCs,
data between both ways PCI bus
components - Width determines
how much data can be
transferred
simultaneously (e.g., 8-
bit, 32-bit)
Control Typically Carries control - Sends control signals Used in all computer
Bus Unidirectional signals to manage from CPU to other systems
operations components
- Coordinates activities
Importance of the System Bus
• The system bus is essential for enabling communication between
independent components within a computer system. It simplifies
interconnections by providing a common pathway rather than
requiring direct connections between all components, which
would be complex and costly.
• It allows for modular design in computer systems, facilitating
upgrades and modifications without extensive rewiring.
How the System Bus Works
When the CPU needs to access data from memory:
• It places the address of the desired data on the address bus.
• The control bus sends signals indicating whether to read or write
data.
• The data bus carries the actual data to or from memory based on
these signals.
Peripheral Component Interconnect
(PCI)
Peripheral Component Interconnect (PCI) is a computer bus
standard developed in the early 1990s for attaching peripheral
devices to a computer's motherboard.
It facilitates data transfer between the central processing unit
(CPU) and connected devices, enhancing the system's capabilities
by allowing the addition of various hardware components such as
graphics cards, network cards, and sound cards.
Peripheral Component Interconnect
(PCI)
Peripheral Component Interconnect (PCI) is a computer bus
standard developed in the early 1990s for attaching
peripheral devices to a computer's motherboard.
It facilitates data transfer between the central processing unit
(CPU) and connected devices, enhancing the system's capabilities
by allowing the addition of various hardware components such as
graphics cards, network cards, and sound cards.
A peripheral device is a device that connects to a
computer and works with it in some way.
Key Features of PCI
• Data Transfer Method: PCI is a parallel bus that operates
synchronously with a single bus clock. It supports
both 32-bit and 64-bit data paths, enabling data
transfer rates of up to 133 MBps for 32-bit
configurations and 266 MBps for 64-bit configurations.
What is a clock
signal?
a steady
What is a clock signal? pulse
1. Architecture
• Bus Structure: PCI uses a parallel bus architecture, meaning multiple bits of
data can be transmitted simultaneously across multiple wires. It typically
supports 32-bit and 64-bit data paths.
• Slots and Cards: The motherboard has PCI slots where expansion cards (like
graphics cards, network cards, etc.) can be inserted. Each card connects to
the PCI bus, allowing it to communicate with the CPU and memory.
How PCI Works Cont...
2. Data Transfer
• Bus Mastering: PCI supports bus mastering, which allows devices to
initiate data transfers without CPU intervention. This improves
efficiency by reducing CPU workload.
• Data Flow: When a device needs to send or receive data, it sends a
request over the PCI bus. The CPU or another device acting as the bus
master can then control the data transfer process.
3. Addressing
• Address Space: Each device connected to the PCI bus is assigned an
address within the processor's address space. This addressing allows
the CPU to identify and communicate with specific devices.
• Memory Mapping: Devices can be memory-mapped, meaning they can
be accessed as if they were part of the system's memory, simplifying
programming and data handling.
How PCI Works Cont...
4. Interrupt Handling
• Interrupt Requests (IRQs): PCI includes multiple interrupt lines (INTA#
through INTD#), allowing devices to signal the CPU when they need
attention. Devices share IRQs, which helps manage multiple devices
without conflicts.
• Level-triggered Interrupts: The PCI standard uses level-triggered
interrupts, which are more reliable for shared lines compared to edge-
triggered interrupts.
5. Configuration
• Plug-and-Play: PCI supports plug-and-play capabilities, allowing the
operating system to automatically detect and configure new devices as
they are added to the system without requiring manual setup.
• Configuration Space: Each device has a configuration space that stores
information about its capabilities and settings, which is used during
initialization.
PCI Bus Architecture
A computer bus is used to transfer data from one location
or device on the motherboard to the central processing
unit where all calculations take place.
Two different parts of a Bus
– Address bus‐transfers information about where the data
should go
– Data bus‐transfers the actual data
PCI Bus Architecture
• PCI(Peripheral Component Interconnect) bus is based on ISA (Industrd
Standard Architecture) Bus and VL (VESA Local) Bus.
• Introduced by Intel in 1992
• Revised twice into version 2.1 which is the 64‐bit standard that it is
today.
• Great feature of PCI Bus was that it was invented as an industry
standard
• PCI provides direct access to system memory for the devices that are
connected to the bus which is then connected through a bridge that
connects to the front side bus.
• This configuration allowed for higher performance without slowing
down the processor
Instruction Cycle
Registers Involved In Each Instruction Cycle:
Memory address registers(MAR) : It is connected to the
address lines of the system bus. It specifies the address in
memory for a read or write operation.
Memory Buffer Register(MBR) : It is connected to the data
lines of the system bus. It contains the value to be stored
in memory or the last value read from the memory.
Program Counter(PC) : Holds the address of the next
instruction to be fetched.
Instruction Register(IR) : Holds the last instruction fetched.
In computer organization, an instruction cycle, also known as a fetch-
decode-execute cycle, is the basic operation performed by a central
processing unit (CPU) to execute an instruction.
The instruction cycle consists of several steps, each of which performs
a specific function in the execution of the instruction. The major steps
in the instruction cycle are:
1. Fetch: In the fetch cycle, the CPU retrieves the instruction from
memory. The instruction is typically stored at the address specified
by the program counter (PC). The PC is then incremented to point
to the next instruction in memory.
2. Decode: In the decode cycle, the CPU interprets the instruction and
determines what operation needs to be performed. This involves
identifying the opcode and any operands that are needed to
execute the instruction.
3. Execute: In the execute cycle, the CPU performs the operation
specified by the instruction. This may involve reading or writing
data from or to memory, performing arithmetic or logic operations
on data, or manipulating the control flow of the program.
Additional steps
00 : Fetch Cycle
01 : Indirect Cycle
10 : Execute Cycle
11 : Interrupt Cycle
When a device raises an interrupt at let’s say process i,e., the processor first completes the execution
of instruction i. Then it loads the Program Counter (PC) with the address of the first instruction of the
ISR. Before loading the Program Counter with the address, the address of the interrupted instruction is
moved to a temporary location. Therefore, after handling the interrupt the processor can continue with
process i+1.
Types of Interrupt
Sequences of Events Involved in
Handling an IRQ(Interrupt Request)
1. Devices raise an IRQ.
2. The processor interrupts the program currently being
executed.
3. The device is informed that its request has been
recognized and the device deactivates the request
signal.
4. The requested action is performed.
5. An interrupt is enabled and the interrupted program is
resumed.
Flowchart of Interrupt Handling
Mechanism
Step 1:- Any time that an interrupt is raised, it may either be an I/O interrupt or a
system interrupt.
Step 2:- The current state comprising registers and the program counter is then
stored in order to conserve the state of the process.
Step 3:- The current interrupt and its handler is identified through the interrupt
vector table in the processor.
Step 4:- This control now shifts to the interrupt handler, which is a function located
in the kernel space.
Step 5:- Specific tasks are performed by Interrupt Service Routine (ISR) which are
essential to manage interrupt.
Step 6:- The status from the previous session is retrieved so as to build on the
process from that point.
Step 7:- The control is then shifted back to the other process that was pending and
the normal process continues.
Managing Multiple Interrupts
• Polling: In polling, the first device encountered with the IRQ bit set is the
device that is to be serviced first. Appropriate ISR is called to service the
same. It is easy to implement but a lot of time is wasted by interrogating
the IRQ bit of all devices.
• Vectored Interrupts: In vectored interrupts, a device requesting an interrupt
identifies itself directly by sending a special code to the processor over the
bus. This enables the processor to identify the device that generated the
interrupt. The special code can be the starting address of the ISR or where
the ISR is located in memory and is called the interrupt vector.
• Interrupt Nesting: In this method, the I/O device is organized in a priority
structure. Therefore, an interrupt request from a higher-priority device is
recognized whereas a request from a lower-priority device is not. The
processor accepts interrupts only from devices/processes having priority.
Q.
• Draw a block diagram of basic components of a
computer system. Explain each component in detail.
[10M]
• Explain the instruction cycle in detail.[7M]
• Difference between microprocessor and microcontroller.
[8]