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

IO Port Address Decoding - Microprocessor

Uploaded by

Ishita Mahajan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views

IO Port Address Decoding - Microprocessor

Uploaded by

Ishita Mahajan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 38

What you want to learn today ?

IO Port Address Decoding in Microprocessor


SLIDESMANIA

created by Ishita Mahajan & Tanvi Aggarwal


Here’s a RoadMap for Understanding I/O Port
Address Decoding
Basics of I/O Port Address Decoding Let’s Talk About Wide I/O Ports
- what are I/O Ports ? - What are wide I/O Ports?
- what are I/O Ports Address ? - 8-Bit wide I/O Ports
- I/O Port Address Decoding & its components - 16-Bit wide I/O Ports
- Memory Decoding and Isolated I/O decoding - 32-Bit wide I/O Ports The End
Level-2 Level-4

Level -1 Level-3

Let’s Dive Deeper Let’s talk about the differences


- Decoding 8-bit I/O Port Address - Decoding 8 & 16-Bit I/O Port
- Decoding 16-bit I/O Port Address Address
- 8,16,32-Bit wide I/O ports
SLIDESMANIA
LEVEL - 1
Basics of I/O Port Address
Decoding
SLIDESMANIA
What are I/O Ports ?
● I/O (Input/Output) ports, in the context of microprocessors and computer systems, refer
to the mechanisms by which a computer communicates with external devices.
● These ports are pathways through which data can be transferred between the
microprocessor and peripherals, such as keyboards, mice, displays, printers, and other
hardware.

● Think of a microprocessor (the brain of a


computer) as the manager of a busy office.
● The manager needs to communicate with various
tools and devices in the office, like the printer,
keyboard, and screen. To do this, the manager
uses something like special mailboxes called I/O
ports.
SLIDESMANIA
Types Of I/O Ports
I/O Ports

Parallel I/O Ports Serial I/O Ports

● ● Description: Serial ports transfer data one


Description: Parallel ports transfer
multiple bits of data simultaneously. bit at a time over a single wire. They are
They were commonly used for often used for connecting devices like
connecting printers. mice, keyboards, and modems.
● ● Example: RS-232 (Recommended
Example: The parallel port standard
IEEE 1284. Standard 232) is a common serial port
standard.
SLIDESMANIA
Types Of I/O Ports
Parallel Ports (like group of mailboxes):
● Imagine these as mailboxes where you can send or receive multiple letters at the same
time. This was like a fast lane for transferring lots of information, often used for printers.
SLIDESMANIA
Types Of I/O Ports
Serial Ports (like a single-person mailbox):
● Now, picture a mailbox where you can only deal with one letter at a time. It's a bit
slower, but it works well for certain things like connecting a mouse or a keyboard.
SLIDESMANIA
What are I/O Port Addresses ?
● I/O port addresses are unique identifiers assigned to input/output (I/O) ports in a
computer system.
● These addresses act as specific locations through which the central processing unit
(CPU) or microprocessor communicates with external devices such as keyboards,
monitors, printers, and other peripherals.
● In essence, each I/O port is like a dedicated mailbox, and the I/O port address is the label
on that mailbox.
SLIDESMANIA
What are I/O Port Addresses ?
Imagine a Neighborhood:
● Think of your computer as a neighborhood, and each device connected to it (like a printer or
keyboard) as a house.
● To talk to each house (device), the CPU uses unique addresses, similar to houses having unique
street addresses.

I/O Port as a Mailbox:


● Each device has its own "mailbox" (I/O port) where the CPU can send or receive information.
● The I/O port address is like the specific number on each mailbox that tells the CPU where to send
or fetch data.

Addressing Devices:
● When the CPU needs to print something, it looks at the "address" of the printer's mailbox and
sends the print job there.
● If it needs to get input from the keyboard, it checks the "address" of the keyboard's mailbox.
SLIDESMANIA
I/O Port Address Decoding
● I/O port address decoding is the process by which a computer system, particularly its central
processing unit (CPU) or microprocessor, determines the specific destination or source for data
transfer among various input/output (I/O) devices. In simpler terms, it's like figuring out which
"addressed mailbox" (I/O port) a piece of information should be sent to or retrieved from.

● I/O port address decoding is the process of figuring out which device corresponds to a particular
address. It's like knowing which house is associated with a specific street address.
SLIDESMANIA
Working Of I/O Port Address Decoding
● Identification of Destination or Source:
I/O port address decoding helps the computer system identify which I/O device (e.g., printer, keyboard,
display) is associated with a particular address.

● Address Mapping:
Each I/O device connected to the system has a unique address assigned to it. Address decoding involves
mapping these addresses to their corresponding devices.

● Routing Data:
When the CPU wants to send data to a specific device or receive data from it, it looks at the I/O port address
to determine where the data should be routed.

● Efficient Communication:
Efficient I/O port address decoding ensures that data is sent to the correct destination, preventing confusion
and enabling smooth communication between the CPU and external devices.
SLIDESMANIA
Working Of I/O Port Address Decoding
Integral to Microprocessor Operation:

● In the context of microprocessors, I/O port address decoding is a crucial part of the overall
operation. It allows the microprocessor to manage and control the flow of data between itself and
peripheral devices.

● In essence, I/O port address decoding is like having a well-organized system of addresses that helps
the microprocessor know exactly where to send or receive data when communicating with different
external devices in the computer system. It's a fundamental aspect of computer architecture and
interfacing.
SLIDESMANIA
Components of I/O Port Addresses
Address Bus:
The address bus is a set of wires that carry the memory addresses. In I/O port address decoding, specific
bits on the address bus are used to designate the target I/O port.

Address Decoder:
The address decoder is a logic circuit that interprets the address provided by the CPU and selects the
appropriate I/O port based on that address. It acts as a traffic director, determining which device should
respond to the CPU's request.

Address Lines:
These are the lines from the address bus that connect to the address decoder. The number of address lines
determines the range of addresses that can be assigned to different I/O ports. For example, with n
address lines, 2^n unique addresses can be generated.
SLIDESMANIA
Components of I/O Port Addresses
I/O Port Registers:
Each I/O port has an associated register or set of registers that store data to be sent or received. These
registers act as temporary storage for information being transferred between the CPU and the external
device.

Control Logic:
The control logic manages the flow of data between the CPU, the I/O port, and the associated registers.
It coordinates actions such as reading from or writing to the I/O port.

Chip Select (CS) or Enable Signals:


Chip select or enable signals indicate to the addressed I/O port that the CPU is communicating with it.
These signals are generated by the address decoder and inform the selected device to respond.
SLIDESMANIA
Components of I/O Port Addresses
Read/Write Control Lines:
These lines indicate whether the CPU is reading data from the I/O port or writing data to it. They help in
determining the direction of data flow.

Status Lines:
Status lines provide feedback from the I/O port to the CPU, indicating the status of the requested
operation. For example, they might signal whether data transfer is complete or if an error occurred.

Bus Buffer:
In some systems, a bus buffer may be used to isolate the CPU bus from the I/O port bus, ensuring that
the CPU and I/O devices operate at their own speeds.

Peripheral Devices:
These are the external devices, such as printers, keyboards, or displays, connected to the I/O ports. Each
peripheral device is associated with a specific I/O port address.
SLIDESMANIA
Memory Decoding and Isolated I/O decoding
Aspect Memory Decoding Isolated I/O Mapped Decoding

Address Space Unified Address space for Separate address spaces for
memory and I/O memory and I/O

Address Range Different Ranges for Different Dedicated address range for I/O
Assignment memory types operations

Potential Conflicts Potential for conflicts if not Conflicts Minimized due to


managed properly separate address spaces

Control Signals Control signals differentiate Control Signals used similarly


memory and I/O operations for I/O operations

Example Address 0*0000 to 0*FFFF(entire 0*8000 to 0*FFFF(dedicated I/O


Range address space) address range)
SLIDESMANIA
LEVEL - 2
Let’s Dive Deeper
SLIDESMANIA
Decoding 8-Bit I/O Port Addresses
● Fixed I/O instruction uses an 8-bit I/O port address that on A0-A15 as 0000H - 00FFH.
● we often decode only address connections A0-A7 for an 8-bit I/O Ports 00H-FFH
● The DX register can also address I/O ports 00H-FFH
● If the address is decoded as an 8-bit address, we can never include I/O devices using a 16-bit address.
● The PC never uses or decodes an 8-bit address.
● The diagram shows a 74ALS138 decoder that decodes 8-bit I/O ports F0H - F7H.
● This circuit is identical to a memory address decoder except that only address bits A0-A7 are connected to the inputs of
the decoder.
● The diagram also shows the PLD version, using a GAL22V10 (a low-cost device) for this decoder.
● A PLD (Programmable Logic Device) is an integrated circuit that can be programmed to perform a variety of logic
functions.
● The GAL22V10 is a specific type of PLD that is well-suited for this application due to its
low cost and high performance.
● The PLD is a more efficient decoder circuit than the 74ALS138 because it reduces the
number of integrated circuits required to one device.
SLIDESMANIA
Diagram of Decoding 8-Bit Port Addresses
SLIDESMANIA
Decoding 16-Bit Port Addresses
● PC systems typically use 16-bit IO addresses, while 16-bit addresses are rare in embedded
systems.
● The difference between decoding an 8-bit and a 16-bit IO address is that eight additional
address lines (A8 - A15) must be decoded.
● The diagram illustrates a circuit that contains a Programmable Logic Device (PLD) and 4-
input NAND gate used to decode IO Ports EFF8H-EFFFH.
● A PLD is an integrated circuit that can be programmed to perform a variety of logic
functions.
● Address strobes are signals that are used to enable or disable a memory device or other
device. In this case, the PLD generates address strobes for IO Ports EFF8H-EFFFH.
SLIDESMANIA
Diagram of Decoding 16-Bit Port Addresses
SLIDESMANIA
LEVEL - 3
Let’s talk about Wide I/O
Ports
SLIDESMANIA
What are Wide I/O Ports?
● Wide I/O ports are data ports that can transmit or receive multiple bits of data
simultaneously.

● This is in contrast to standard I/O ports, which can only transmit or receive one bit of
data at a time.

● Wide I/O ports are used in a variety of applications, including high-speed data transfer,
real-time signal processing, and industrial control.
SLIDESMANIA
Difference between I/O Port address and I/O port wide

Basis I/O Port Address I/O Port Wide

Definition I/O Port address are the I/O port wide is the wide of data
address the decode the I/O read or written from the I/O
device to enable it for read or device and it may be8-bit wide
write operation. or 16-bit wide or 32-bit wide or
64-bit wide.

Purpose Facilitates communication Determines how many bits of


between the CPU and data can be transferred
external devices simultaneously during I/O
operations

Representation Represents a unique address Represents the size of the data


for a specific device. bus, often expressed in bits(e.g.,
8-bit, 16-bit, 32-bit)
SLIDESMANIA
8-bit or 16-bit wide I/O devices
I/O Banks in a 16-bit Microprocessor:
● In a 16-bit microprocessor like the 80386SX, data transferred to an 8-bit I/O
device exists in one of the I/O banks.
● There are 64K (64 kilobytes) different 8-bit ports, but only 32K unique 8-bit
ports because a 16-bit port uses two consecutive 8-bit ports.
Separate I/O Banks for 16-bit System:
● The I/O system in this microprocessor has two 8-bit memory banks, similar to
how memory is organized.
● Figure 11–13 illustrates separate I/O banks for a 16-bit system like the
80386SX.
SLIDESMANIA
8-bit or 16-bit wide I/O devices
Write Strobe for 8-bit I/O Write:
● Because there are two I/O banks, an 8-bit I/O write requires a separate write strobe to
function correctly.
● I/O reads do not require separate read strobes; the microprocessor reads only the expected
byte and ignores the other.
Potential Issues with I/O Reads:
● Issues can arise if an I/O device responds incorrectly to a read operation.
● Separate read signals might be necessary in situations where an I/O device responds to a read
from the wrong bank.
Example System with Two 8-bit Output Devices:
● Figure 11–14 illustrates a system with two different 8-bit output devices, located at 8-bit I/O
addresses 40H and 41H.
● Because these are 8-bit devices in different I/O banks, separate I/O write signals are
SLIDESMANIA

generated for each to capture port data.


8-bit or 16-bit wide I/O devices
Addressing 8-bit Ports:
● All I/O ports use 8-bit addresses. For example, ports 40H and 41H can be
addressed separately as 8-bit ports or together as one 16-bit port.
PLD Decoder Program:
● The program for the Programmable Logic Device (PLD) decoder used in Figure
11–14 is provided in Example 11–4.
SLIDESMANIA
Diagram of 8-bit or 16-bit wide I/O devices
SLIDESMANIA
Simplifying 8-bit or 16-bit wide I/O devices
I/O Banks in a 16-bit Microprocessor:
● Think of the microprocessor as a librarian in a big library (computer). The librarian
manages communication channels, like different sections in the library where books are
stored.
64K Different 8-bit Ports, but Only 32K Unique Ports:
● In the library, there are many shelves (ports) where information is stored. Each shelf can
hold a certain amount of books (bits). There are 64 thousand shelves, but some are
paired up (16-bit ports), so effectively, there are 32 thousand unique shelves.
Separate I/O Banks for 16-bit System:
● The library is organized into different sections (banks). In a 16-bit system, there are two
sections, each handling different types of information.
SLIDESMANIA
Simplifying 8-bit or 16-bit wide I/O devices
Write Strobe for 8-bit I/O Write:
● When the librarian wants to put a new book on a shelf, they use a special signal (write
strobe) to confirm, "I'm putting the book here."
Issues with I/O Reads:
● Sometimes, when the librarian asks a question (read operation), the response might be
confusing. To avoid this, the librarian may need extra signals to make sure they get the
right answer.
Example System with Two 8-bit Output Devices:
● Imagine two special shelves (8-bit output devices) in different sections (I/O banks). To
put a book on each shelf, the librarian uses separate signals to ensure each book goes to
the right place.
SLIDESMANIA
Simplifying 8-bit or 16-bit wide I/O devices
Addressing 8-bit Ports:
● When the librarian wants to find a specific book on a shelf, they use an address (like a
call number). It's like saying, "Go to shelf 40 and get the book." The librarian can address
each shelf separately or both together.
PLD Decoder Program:
● The librarian has a guidebook (PLD decoder program) that helps them understand the
library layout and efficiently manage the shelves. It's like having a map to navigate the
library effectively.

In summary, the microprocessor, like a librarian, manages different sections (I/O banks) and shelves
(ports) in a library (computer). Using signals (write strobes), addresses, and a guidebook (PLD
decoder program), it ensures that information is stored and retrieved accurately in this organized
SLIDESMANIA

system.
32-Bit Wide I/O Ports
1. Definition:

● A 32-bit wide I/O port refers to a communication channel or interface in a computer system that can
transfer 32 bits of data simultaneously.

2. Bit Width:

● "32-bit" indicates the size of the data bus associated with the I/O port. This means that 32 bits of
information can be transferred in parallel during input or output operations.

3. Use in Computer Systems:

● 32-bit wide I/O ports are used for communication between the central processing unit (CPU) and external
devices or peripherals. These can include devices like graphics cards, network controllers, or other
hardware components that require the transfer of large amounts of data.
SLIDESMANIA
32-Bit Wide I/O Ports
4. Support in Buses:

● Computer buses, such as the EISA (Extended Industry Standard Architecture), VESA (Video Electronics
Standards Association) local bus, and PCI (Peripheral Component Interconnect), can support 32-bit I/O
operations. These buses provide pathways for data transfer between the CPU and various hardware
components.

5. Physical Implementation:

● Physically, a 32-bit wide I/O port may consist of a set of electrical lines or conductors that can carry 32
individual bits of data simultaneously.

6. Example Circuit:

● In the context of a microprocessor like the 80386DX through the 80486DX, a circuit for a 32-bit input
port might involve a Programmable Logic Device (PLD) for decoding I/O ports and buffers (like
SLIDESMANIA

74HCT244) to connect the I/O data to the data bus.


32-Bit Wide I/O Ports

● I/O Ports decoded by this


interface are the 8-bit ports 70H -
73H
● When writing to access this
port,it is crucial to use the
address 70H for 32-bit input.
● As Intruction- IN EAX,70H
SLIDESMANIA
LEVEL - 4
Let’s talk about the Difference
SLIDESMANIA
Decoding 8-bit & 16-Bit I/O Port Addresses
Aspect 8-Bit I/O Port Address 16-Bit I/O Port Address Decoding
Decoding

Data Bus Width 8 bits !6 bits

Address Bus Width Depends on the system Depends on the system


architecture; Typically 16 bits architecture; Typically 16 bits

Maximum No. Of 2^8=256 2^16=65,536


Addresses

I/O Port Address Range Limited to 256 unique Extended to 65,536 unique
Addresses Addresses

Size of I/O Ports Usually 8 Bits(1 byte) Can be 8,16 or 32 bits,


SLIDESMANIA

depending on system design


8-Bit, 16-Bit & 32-Bit Wide I/O Ports
Aspect 8-bit wide I/O Ports 16-bit wide I/O Ports 32-bit wide I/O Ports

Data width 8 bits 16 bits 32 bits

Data transfer rate Up to 8 Mbps Up to 16 Mbps Up to 32 Mbps

Common applications Low-speed peripherals, Mid-speed peripherals, such High-speed peripherals,


such as keyboards and as printers and scanners such as video cards and
mouse network adapters

Cost Lowest Middle Highest

Size Smallest Middle Largest


SLIDESMANIA

Complexity Simplest Middle Most complex


Thank You
Thank you for “decoding the world of IO Address Ports” with us today
SLIDESMANIA

You might also like