Understand how different ports provide connection to peripheral devices

4.1 Central Processing Unit (CPU) Architecture

What is a CPU? 🧠

The CPU is the brain of a computer. It fetches instructions, decodes them, and executes operations. Think of it as a super‑fast chef that follows recipes (programs) to prepare dishes (results).

CPU Ports: The Doors to the Outside World 🔌

Ports are like doors on the CPU’s house. They let data flow in and out, connecting the CPU to peripheral devices such as keyboards, mice, displays, and storage.

  • Serial Ports – one wire at a time, like a single‑lane road.
  • Parallel Ports – multiple wires at once, like a multi‑lane highway.
  • USB – universal, plug‑and‑play, the modern “smart door.”
  • PCI/PCIe – high‑speed lanes for graphics cards and SSDs.
  • Memory‑Mapped I/O – treats peripheral addresses as part of memory.

How Ports Connect to Peripheral Devices 📺🎮

When a peripheral wants to send data, it writes to a specific port address. The CPU reads that address, processes the data, and may write back a response.

  1. Peripheral sends data to a port address (e.g., 0x3F8 for a serial port).
  2. CPU’s Input/Output (I/O) controller detects the write and stores the data.
  3. CPU fetches the data during its next cycle, decodes the instruction, and acts.
  4. CPU writes a response back to the same or another port.

Exam Tip Box 📚

Exam Tip: Remember that memory‑mapped I/O treats peripheral addresses as part of the CPU’s address space. This means you can use normal load/store instructions to communicate with peripherals, unlike port‑mapped I/O which requires special instructions (e.g., IN/OUT in x86).

Quick Question: If a device uses port‑mapped I/O, which instruction would you use to read from port 0x3F8?
Answer: IN (or its equivalent in the ISA you are studying).

Remember: Port numbers are often expressed in hexadecimal (e.g., 0x3F8).

Port Types Comparison Table 📊

Port Type Typical Use Communication Style
Serial (UART) Keyboard, Modems One bit at a time (serial)
Parallel (LPT) Printers (old) Multiple bits simultaneously (parallel)
USB Mice, Keyboards, Flash Drives High‑speed, plug‑and‑play
PCIe Graphics Cards, SSDs High‑bandwidth, point‑to‑point
Memory‑Mapped I/O Display Controllers, Sound Cards Same instructions as memory access

Revision

Log in to practice.

2 views 0 suggestions