Computer architecture - Advanced CPU Design - lecture 6b - Charles Fox - University of Lincoln
Overview
Charles Fox explains instruction-level parallelism (ILP), techniques that let a CPU execute parts of a serial program concurrently without changing its instruction set. Using binary addition and the Manchester Baby as examples, he covers pipelining and its hazards, hazard mitigation, out-of-order execution, hyperthreading, and the trade-offs between CISC and RISC designs.
Key takeaways
- Instruction-level parallelism improves CPU throughput inside the processor while leaving the programmer's serial instruction set unchanged.
- A ripple-carry adder propagates carries sequentially; parallel column processing can speed addition in typical cases but uses more hardware and can still face long carry chains.
- Pipelining overlaps instruction stages, but control, data, and structural hazards can force stalls, replay, speculation, or extra forwarding circuitry.
- Branch prediction exploits patterns such as loops repeating until a final iteration, while incorrect predictions require discarding work from the wrong path.
- Out-of-order execution uses register dependencies to identify independent instructions that can run concurrently without changing program results.
- CISC offers complex instructions that reduce the number of instructions required for some tasks, whereas RISC favors simpler operations that are well suited to fast pipelines.
Chapters
- ILP increases internal CPU concurrency while preserving the user-visible instruction set and serial-program model.
- A ripple-carry adder processes number columns in sequence, with each carry depending on the previous column.
- Computing column sums and carry information in parallel can reduce typical addition time, but requires more full adders and silicon.
- A register stores a multi-bit word, allowing operations such as addition to process its bits within one user-visible instruction.
- The 6502 is an 8-bit processor, with logic arranged to operate across the bits of its registers.
- Charles Fox connects regular, repeated bit-level logic to structures found in Charles Babbage's Analytical Engine.
- The Manchester Baby divides a CPU cycle into eight ticks, activating different control logic at different points.
- Fetch, decode, and execute use different parts of the processor, leaving many components idle during a sequential instruction cycle.
- Pipelining overlaps stages from different instructions, like workpieces moving through stations on a production line.
- A branch creates a control hazard because later instructions may enter the pipeline before the branch decision is known.
- A data hazard occurs when instructions access the same memory location or depend on a value that an earlier instruction has not produced yet.
- A structural hazard occurs when simultaneous stages compete for one resource, such as RAM or an ALU.
- A compiler or CPU can insert a NOP, an instruction that does no work, to leave space between conflicting operations.
- Stalling reduces the risk of incorrect execution but gives up some of the speed gained from pipelining.
- Replay detects a hazard, resets relevant control state, and reruns affected instructions, sometimes after flushing or spacing the pipeline.
- Speculative execution can follow both possible branch paths, then keep the correct results when the branch resolves, at the cost of extra hardware.
- Predicting that a branch will be taken often works for loops, which usually repeat until their final iteration; a wrong guess requires discarding speculative work.
- Compiler hints and branch history can inform predictions, while forwarding wires send information such as a resolved branch or computed value to other pipeline stages.
- A dependency diagram represents instructions as nodes and data dependencies as arrows, revealing which operations must wait.
- Instructions that use independent registers can run in parallel or in a different order while preserving the program's results.
- The example schedule starts instructions 1, 3, and 4 together, then schedules dependent instructions as their input values become available.
- Implementing this requires additional execution resources and careful coordination, especially when combined with pipelining.
- Pipelining keeps CPU resources busy by overlapping instructions from one program; hyperthreading uses available execution slots for other programs.
- A single physical core can appear to software as multiple virtual CPUs, allowing independent threads to share its execution resources.
- The approach aims to use hardware that would otherwise sit idle between stages of a thread's work.
- CISC designs, including Intel and AMD desktop and server processors, use complex instructions that can combine steps such as loading, multiplying, and storing.
- RISC designs use simpler instructions; a multiplication involving memory may require separate loads, a multiply, and a store.
- RISC's simpler operations can be easier to pipeline and execute quickly, while CISC can reduce instruction count and support specialized operations.
- The lecture contrasts RISC's potential advantages in power and simplicity with CISC's feature-rich instruction set and discusses the security implications of architectural complexity.
Transcript excerpt
0:00 We're going to study instruction level parallelism. This means modifying the CPU without changing the user visible part of the instruction set. This means modifying stuff inside the CPU to try and hot rod the execution of user program. We're going to try and do more than one thing at the same time. That's what parallelism means. Um, but we're going to do it in a way that does not the end user. Later in the module, we'll talk about other forms of parallel where the user does have to care about it. This is where we keep everything secret inside the black box of the CPU. So, the user at least thinks they're still giving us a serial program at the same time, which is executing as normal. But
0:49 internally, we're going to be more clever and we're going to try and do more than one thing at the same time. Um >> so this can be done in several ways. Um most basically just looking at the structure of individual registers and operations occurring on registers such as addition. You might have addition as a single instruction in your set. So as far as the user's concerned they're just giving you the same instruction this register to this other register. But we can think about how we actually do that level of mod. Um when most of us learn to do addition at primary school, we are taught that mathematics is a sadly individual
1:39 solitary activity, right? It consists of you personally stepping through this algorithm doing one thing at a time. So how do we add two numbers together? Well, we start with the column on the right. um we we add this column and there might be a carry and there might not be carry. If there's carry, we bring it into the
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.