Computer architecture: Digital CPU design lecture 5b Charles Fox University of Lincoln
Overview
Charles Fox explains how branching lets a CPU depart from sequential instruction execution, then traces how the Manchester Baby implements fetch, decode, execution, and program-counter updates using Logisim digital logic. He connects the design to physical chip fabrication and to the larger 6502 reconstruction, showing how a simple CPU’s registers, decoder, sequencer, ALU, and control logic scale into real hardware.
Key takeaways
- A CPU branch changes the program counter, allowing machine code to implement conditionals, loops, and transfers to subroutines instead of executing instructions only in memory order.
- The Manchester Baby’s three-bit sequencer represents eight timing states, while a separate decoder translates instruction opcodes into control signals.
- The Manchester Baby is a 32-bit accumulator machine whose load, store, and subtract operations are coordinated through RAM buses and timed register write enables.
- The Baby’s control logic increments the program counter by default, loads a jump operand for unconditional branches, and tests whether the accumulator is negative for conditional skips.
- A Logisim circuit can be translated into a physical chip design: transistor regions form logic-gate cells, and layered copper wiring connects those cells into a CPU.
- The 6502 reconstruction preserves the Baby’s basic CPU structure while scaling up to more registers, instructions, and control states.
Chapters
- In the normal fetch, decode, execute cycle, the program counter increments to the next memory address.
- Branches change that sequence, supporting conditional decisions such as if statements and the control logic behind for and while loops.
- Subroutines, functions, and procedures can also be implemented using changes to program flow.
- A jump instruction loads its target address into the program counter instead of incrementing the counter normally.
- Jumps can skip data embedded among instructions or return execution to an earlier address to create a loop.
- A jump to a separate code address can transfer execution to a subroutine, though returning requires another mechanism.
- Conditional branches test machine state, often an arithmetic result such as zero, overflow, or a positive or negative value.
- A status register can hold flags that instructions use to decide whether to branch; Charles Fox illustrates the idea with a flag on Babbage’s Analytical Engine.
- The same branch mechanism supports both simple if decisions and loop continuation tests.
- In the jump style, a compare instruction such as CMP sets a condition flag, and a separate BEQ instruction branches if the values are equal.
- In the skip style, a conditional-skip instruction advances past one instruction when its condition is true.
- The skip style can simplify implementation because the skip instruction does not need a target-address operand; programmers commonly pair it with an unconditional jump.
- Charles Fox uses a Logisim reconstruction of the Manchester Baby to show how digital logic gates form a working CPU.
- A clock, three-bit counter, and decoder produce eight timing states for the machine’s fetch, decode, and execute operations.
- During fetch, the program counter supplies the RAM address on one tick, and the RAM output is captured in the instruction register on the next.
- The Baby uses 32-bit registers and 32-bit RAM words; its instruction register separates the opcode from the operand.
- An instruction decoder activates the circuit associated with operations including load, store, subtract, jump, skip, and halt.
- For load, the operand provides the RAM address, and the returned data is negated before being stored in the Baby’s single user register, the accumulator.
- A store instruction sends the operand to the RAM address input and the accumulator value to RAM’s data input, then activates write enable.
- The Baby’s ALU performs subtraction: it combines the accumulator’s existing value with data read from RAM and writes the result back.
- Load, store, and subtract operations depend on coordinating RAM access, data routing, and register write-enable signals across clock ticks.
- The control logic normally increments the program counter, but a jump routes the instruction operand to it instead.
- The Baby’s skip instruction checks whether the accumulator is negative; if the condition is met, control logic loads the branch address rather than the next sequential address.
- The integrated CPU combines clock state, decoded instruction, multiplexers, buses, RAM, accumulator, and control logic into a complete fetch-decode-execute cycle.
- Charles Fox describes weeks or months of verification with AMD chip verifier Andy Bauer to check states, timing, and unusual input combinations.
- A modified Logisim workflow converts the Manchester Baby circuit into a mask set, showing doped silicon regions, transistor cells, copper wiring layers, and power distribution.
- The Manchester Baby design was fabricated as a real integrated-circuit chip that can run Baby programs.
- Charles Fox compares it with a reconstructed 6502, the 8-bit processor used in systems including the Commodore 64, Nintendo Entertainment System, Apple II, and BBC Micro.
- The 6502 Logisim design has more registers, instructions, and control states; Charles Fox recommends studying the Baby and 6502 designs during reading week.
Transcript excerpt
0:03 Okay, so in in second half we're going to talk a little bit more about um what the control unit is doing. And then I'm going to show you how some of these structures actually get implemented out of digital logic. Um in the in the basic programs we've seen so far, we've assumed that when you finish an instruction, you go to the next instruction in sequence in memory. Yeah, we we saw this. We saw this basic flow control which goes through fetch, decode, execute, and then at the end we said we're going to go back to fetch having incremented the program counter. Yeah, so you usually the program counter is storing the line number of the program here. That's the address in memory that we're reading from. Usually when we finish doing fetch, decode, execute, we are then going to increment the program counter. That means we're now pointing to the
0:52 next line in the program and that sets us up for the next fetch, decode, execute cycle. Now, that's usually the case, but if your program is in sequence, you can't make a church computer, right? To to make a church powerful computer, you need to have this ability to move around in the program. You need to be able to to jump and in particular you need to do what is called a branch. A branch means jumping to different lines in the program depending on what is going on. Right? So in high level language, this appears as a a statement with a name like if. If something is the case, then go to this part of the program. Else, go and do this other thing. Um so in general we we call this branching. You'll you'll find there are many concepts you are used to in high
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.