Computer architecture - IO - lecture 7a - Charles Fox - University of Lincoln
Overview
Charles Fox explains how input/output connects a computer to the physical world, from peripherals and bus-connected I/O modules to the devices they control. He traces bus architecture through examples such as the Commodore 64 and the telegraph, then explains memory-mapped I/O, buffering, error handling, polling, interrupts, and DMA, showing how I/O modules manage slower tasks and increasingly perform computation themselves.
Key takeaways
- An I/O module is hardware mapped to CPU-visible addresses, while a device driver is software that issues commands to the module and manages its protocol.
- A bus simplifies connecting components through shared address, data, and control lines, but contention makes access coordination a central design problem.
- Buffering handles mismatched data rates: double buffers support tear-free frame updates, while ring buffers track continuous streams such as audio.
- Polling uses repeated CPU status checks, IRQs notify the CPU when an event occurs, and DMA lets devices transfer data over the bus with less CPU involvement.
- DMA-enabled graphics lets a device fetch sprite data directly from RAM and render it, replacing CPU-driven loops that process pixels individually.
Chapters
- I/O links computation to real-world inputs and outputs such as cameras, screens, speakers, and robot actuators.
- Charles Fox compares I/O to the peripheral nervous system, noting that components such as GPUs increasingly perform computation themselves.
- A peripheral is physically outside the computer enclosure, while architectural design focuses on connectivity and component roles.
- An I/O module connects to the bus and appears to the CPU as addressable storage; a device handles the logic controlling a physical sensor or actuator.
- The Commodore 64 combines a 6510 CPU, RAM, ROM, and multiple I/O chips connected through a bus.
- I/O modules accept CPU loads and stores, then communicate with device logic that may control peripherals such as a television or speakers.
- The 6581 SID sound chip gives the Commodore 64 its distinctive sound and was later used by pop producers for retro 8-bit sounds.
- The example shows that I/O hardware helps distinguish computers such as the Commodore 64, BBC Micro, and ZX Spectrum even when they use similar CPUs.
- A point-to-point network directly connects two nodes, while fully connected networks require increasingly large amounts of wiring as nodes are added.
- A mesh network connects only some node pairs, so messages may need to be routed through intermediate nodes, as on the internet.
- A bus shares one channel among all connected components, which must take turns transmitting.
- The 1830s telegraph illustrates bus coordination: operators shared a wire, and simultaneous transmissions could collide or expose messages to everyone connected.
- Charles Babbage's Analytical Engine used a mechanical bus, while modern buses implement the same broad idea with electronic logic.
- The CPU's MAR holds an address, allowing a bus transaction to identify its destination; the data lines carry the actual information.
- Address-line count determines the address space: 32 address bits can identify 2^32 byte locations, or 4 GiB if each location stores one byte.
- Control lines coordinate transactions, including whether a request is a load or store and which component may use the bus.
- Address and data bus widths often match CPU word length, but they do not have to.
- The 8-bit MOS 6502 uses 16-bit addressing, requiring separate high-byte and low-byte address values.
- The Motorola 68000 has a 32-bit internal architecture but a 16-bit bus, a combination reflected in the Atari ST's 16/32 name.
- A shared bus makes devices easy to add when their addresses are unique, but congestion and coordination overhead can encourage designs to evolve toward mesh-like networks.
- I/O modules appear to assembly programmers as address ranges that can be accessed with load and store operations.
- A store to RAM preserves data, while a store to an I/O address can trigger a command interpreted by the module.
- Early GPU commands could request a high-level operation such as drawing a triangle rather than making the CPU write each pixel individually.
- An I/O module is hardware that handles bus transactions; a device driver is software that communicates with the module and manages its protocol and operating-system permissions.
- I/O modules bridge the speed gap between fast CPUs and slower devices, allowing the CPU to continue other work while a printer or disk handles a long task.
- Buffers collect data arriving at a different or unpredictable rate, such as microphone samples that the CPU later reads in word-sized chunks.
- Double buffering lets a game display one completed frame while the next is drawn; ring buffers use read and write pointers to manage continuous audio samples.
- I/O modules must detect physical-world failures such as printer jams or disk-sector errors and either handle them or report status to the CPU.
- A typical interaction checks a device's status through an I/O address, sends a command if the device is ready, and later reads results or completion data.
- Long-running operations, such as writing a 40 GB file, need a way to notify the CPU when work is complete.
- The three approaches introduced are polling, interrupt-driven I/O, and DMA, or direct memory access.
- Polling makes the CPU repeatedly read a status address to check whether an operation has finished.
- Polling is simple for hardware but makes the CPU repeatedly check device status, much like a manager checking on a task at intervals.
- With interrupt-driven I/O, an I/O module raises an IRQ when work is complete, avoiding repeated checks but adding interrupt handling and scheduling complexity.
- DMA lets an I/O device initiate bus transactions and move data between RAM and the device without the CPU transferring each item.
- For game graphics, a DMA controller can fetch a sprite from RAM and render it to the screen after one CPU command; the device may signal completion with an IRQ.
Transcript excerpt
0:00 Input output IO means connecting the computer to the real world. [clears throat] Computers do two things. They perform computation and most most of the theory in computer science is focused on doing computation. Know there are theorems about how long it takes to compute certain things or which things are computable and which things are not computable. IO tends to take a backseat in the the theory of computer science, but it is just as important. If you don't have input and output, you can compute all you like, but it's not really going to mean anything because it doesn't actually connect to anything real in the the physical world. So, we often say if the if the processor is like a brain, then IO is like the rest
0:47 of the nervous system, right? that the the brain is known as the central nervous system in biology, but the peripheral nervous system is all the other stuff um connected to the brain via the spinal cord. And we know in biology nowadays there's actually a lot of computation is performed outside of the brain in the rest of this peripheral nervous system that there are neurons out here. There are neurons going into your senses and processing information before it even reaches the brain. And it's becoming like that in computer architecture. Now you'll find the IO systems of computers have started taking over a lot of computation themselves and are in some cases most notably GPUs are becoming computers in their own right.
1:36 So tra traditionally IO is seen as the less glamorous part of architecture compared with being a hot shot CPU designer but it it it is important. There's a lot of different forms of IO. There's a lot of different devices out there that all have to be designed and
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Charles Fox.