Computer architecture - Advanced CPU Design - lecture 6a - Charles Fox - University of Lincoln
Overview
Charles Fox of the University of Lincoln explains how CPU designers extend the Manchester Baby’s basic principles through instruction-set choices, richer addressing and arithmetic, subroutines, interrupts, and privilege modes. Examples from the 6502 show how architectural features trade silicon cost and complexity against compiler support, execution speed, operating-system capabilities, and security.
Key takeaways
- An ISA is both a machine-code specification and a hardware-software interface, so an instruction that is powerful in principle may be wasted if compilers cannot use it effectively.
- Indirect addressing supports pointer-based code by loading an address from memory, while base-plus-offset addressing helps implement array access.
- Hardware arithmetic and floating-point units can speed up programs, but they cost silicon area, power, and implementation effort; IEEE floating-point edge cases make correctness especially demanding.
- A stack enables nested and recursive subroutine calls by preserving each return address in last-in, first-out order.
- Operating-system scheduling depends on hardware interrupts and privilege modes: timer IRQs transfer control to the kernel, which can choose the next user program and restrict its memory access.
- The Manchester Baby’s seven-instruction design and the 6502’s richer instruction set illustrate how CPU designers trade simplicity against specialized functionality.
Chapters
- The Manchester Baby provides a deliberately simple model of CPU principles, with basic loading, storing, and branching.
- Most architectural development adds functionality, performance, and efficiency to those underlying principles.
- The lecture moves from instruction sets and subroutines to parallel execution and the RISC versus CISC design debate.
- An instruction set architecture, or ISA, specifies the binary machine-code instructions a CPU can execute.
- Assembly mnemonics make machine instructions more readable, while modern compilers are often the ISA’s direct users.
- Architects balance performance and specialized features against compiler writers’ need for instructions that are practical to use.
- An accumulator architecture makes instructions compact because operations implicitly use a single register.
- The 6502 exposes accumulator A and index registers X and Y, with separate instructions such as LDA, LDX, and LDY.
- With multiple registers, an instruction can specify source and destination operands, such as adding registers 2 and 3 into register 1.
- Register-to-register addition avoids a RAM access, while register-plus-memory addition fetches an operand during the instruction.
- Immediate addressing embeds a constant, such as 32, directly in the instruction.
- Indirect addressing reads a pointer from memory, supporting pointer-based languages such as C.
- Base-plus-offset addressing can select an array element, for example by combining base address 50 with offset 3.
- An ALU may provide increment, decrement, multiplication, division, Boolean operations, shifts, and comparisons in addition to basic addition and subtraction.
- Older 8-bit CPUs such as the 6502 lacked multiplication instructions, so software had to implement multiplication through repeated addition.
- Adding hardware functions can improve execution speed but increases silicon area, cost, and power consumption.
- Floating-point support grew from software libraries and add-on chips such as Intel’s 8087 to logic integrated into many CPUs; IEEE special cases make correct implementation difficult.
- A subroutine call jumps to a function or procedure, while a return must restore the program counter to the instruction after the call.
- Saving a return address in one register or fixed RAM location prevents nested or recursive calls from keeping separate return points.
- A last-in, first-out stack solves this by pushing a return address on each call and popping it on return.
- Compiled function calls can push arguments as well as return addresses, and CPUs such as the 6502 expose stack operations to programmers.
- An interrupt redirects execution to a handler when an external event or exception needs attention, without the running program explicitly requesting a call.
- The 6502 provides a physical IRQ pin that can signal an interrupt request to the CPU.
- The CPU saves its current program counter, consults a configured handler address, and later returns to the interrupted code.
- Modern CPUs distinguish privileged kernel execution from restricted user-program execution using internal mode state.
- Memory-access checks prevent one user program from freely reading or writing another program’s memory.
- A timer interrupt can return control to the kernel, which selects a program to run and restores restricted mode.
- These architectural mechanisms enable operating-system scheduling and access control, while attempts to gain kernel privileges are a security risk.
- The lecture contrasts a lean, RISC-style instruction set with a larger set of specialized instructions.
- The Manchester Baby has seven instructions, while the 6502 provides a broader collection of register-specific operations and addressing modes.
- The 6502 examples include indirect addressing for pointers, offset addressing for arrays, Boolean and shift operations, comparisons, branches, subroutines, and IRQ support.
Transcript excerpt
0:00 So this week we are going to continue our study of CPU. Um we've pre previously built a basic understanding of the CPU. We were looking at the Manchester baby architecture in particular which is chosen to be a deliberately simple and easy architecture. But everything you need to understand the principles of CPU design is is there in the data. Um, beyond that, it's a case of just adding more stuff. It's about adding more functionality, um, making things bigger, faster, finding ways to do things more efficiently. That's what we're going to talk about in this week's lecture. CPU. So, I I mentioned last time if you
0:47 understand the basic CPU principles, you're over the hump of the module. I know there's there's a lot of content that arrives around that time. Everything we do beyond that is kind of adding to it. with with building in extra features, extra functions, um extra refinements. So, make sure you've got the basic understandings first and then you can put all this extra stuff on top. This is going to continue next week and after as we go out beyond the CPU to IO and memory and then the final part of the module, we will consolidate everything we've learned by looking at examples of how the concepts show up in particular architectures. So once we have a basic CPU like a baby, what what can we do to make it better? >> And this this is what working
1:36 architecture tends to consist of, right? How how do we improve an existing design? How do we actually um the most visible part of this from a users perspective is what goes in the instruction set. We've seen that baby has quite a small set of available instructions, right? can load things,
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.