
Design a cpu 4 integrates the floating point unit into the system, organizes libraries, and builds a linker and emulator, continuing the design cycle from basic gates to a compiler.
Extract the correct zip, organize folders, install Java and Python, and configure Visual Studio Code and Logisim to run the first assembly test.
Upgrade your Python environment by updating pip and installing pandas and openpyxl. Use command prompt on Windows (or an equivalent on Mac) to run the upgrade commands.
Design a new system clock by Timothy Morgan that eliminates a long-standing blip and ensures stable resets when loading new code, improving CPU stability.
Explore the full instruction set in assembly terms, using Visual Studio Code with instruction set dot em, covering machine codes, mnemonics, data, load, store, jumps, cordic, and graphics library.
Demonstrates bubble sort by swapping adjacent elements to sort numbers 5, 1, 4, 2, 8 in ascending order. Shows the algorithm's passes and a simple assembly language implementation.
Learn to assemble and run the propeller ASM on a software emulator, load the graphics dot dot file, and render the propeller using the emulator's graphics dump.
Explore the command line interpreter for microcode, editing, adding, deleting instructions, exporting control signal tables to text and Excel, and inspecting hex values to verify micro-operations.
Organize library subroutines into dedicated files for bios and each library: fixed point, floating point, graphics, maths, and string, with ROM addresses and documented usage examples.
learn how a linker joins six library machine codes into one operating system file, loads it into ROM, and prevents memory overlaps by assigning unique addresses for RAM and ROM.
Integrate floating point unit into cpu die, connect X and Y to ALU, and control it with FPU enable and select lines for add, subtract, multiply, division, or square root.
Learn to write assembly code that adds two floating point numbers using registers R0 and R1, with data and dot code directives, the f add instruction, and CPU simulation.
Edit and generate CPU microcode using a JSON file and a command-line interpreter, replacing spreadsheets with Visual Studio Code workflows to produce the microcode ROM and compression ROM LUT.
Demonstrates executing the f add floating point instruction through micro instructions, showing data moving from registers to the ALU and FPU, via microcode steps and addressing modes.
Convert a 16-bit binary floating point number to decimal and back using pi as an example, explaining the sign, exponent, mantissa, bias, and normalization.
Explore how floating point numbers are multiplied by combining signs with an exclusive or, adding exponents, and multiplying mantissas, followed by normalization and optional rounding in a cpu multiplier circuit.
Explore the floating point adder-subtractor, using sign handling and an xor-based decision to add or subtract, plus mantissa normalization across exponent ranges.
Explore floating point add subtract realisation in a dual path unit, detailing near and far paths, exponent swap, mantissa alignment, subtraction logic, leading zero count, and rounding with sticky bit.
Explore how the float to integer conversion rounds coordinates, centers the screen origin, and packs x and y into a 16-bit output to plot points while clipping out-of-range values.
Explain floating point to integer conversion in a 16-bit format, showing how the mantissa, exponent with bias 15, and a ten-bit shift produce the integer, plus rounding by half-range check.
Explore the Cordic algorithm, balancing mathematical detail with practical circuit realization in Logicism, and know that a full Cordic course covers deeper math and functions.
Show how rotation matrix rotates a point and yields x1 = x0 cos φ - y0 sin φ, y1 = y0 cos φ + x0 sin φ, introducing Cordic algorithm.
Explore how the Cordic algorithm enables efficient sine and cosine calculations by replacing large lookup tables with iterative approximations, reducing memory usage and computational complexity in digital architectures.
demonstrates rotating a point on a circle via an iterative rotation matrix, replacing sine and cosine with simple arithmetic using the Cordic approach and powers-of-two angles for hardware synthesis.
Learn how the Cordic algorithm solves for an angle using a quadratic approach, a graphical calculator simulation, and pseudo rotations with scaling across nine iterations to obtain 30 degrees.
Demonstrates the Cordic algorithm in vectoring mode with initialization, iterative x and y updates, and the gain factor 1/k that scales outputs x, y, and z.
Explore the Cordic algorithm to generate inverse sine and inverse cosine using vectoring mode, with y and r to determine the angle.
Explore the inverse cosine function by turning adjacent and hypotenuse into angles, using vector rotations and quadrants, and compare with the inverse sine and tangent in rotation mode.
Apply the Cordic rotation mode to compute sine and cosine by angle comparisons and pseudo rotations, then derive tangent as sine over cosine.
Explore how the CORDIC simulator demonstrates circular vectoring and rotation modes to compute inverse sine and arctan, using initialization values x0, y0, z0 and nine approximations.
Master the Cordic algorithm mathematics, visualize its circuit in Logisim, and implement Cordic within your CPU in the upcoming steps.
Explore the Cordic core, detailing rotation and vectoring modes, how x, y, z inputs and arctan values drive iterative hardware operations in a Cordic unit.
Explore the cordic top level in the cpu design, detailing iterative rotation and vectoring modes, initialization, feedback loops, and outputs for sine, cosine, and arctan.
Explore how cordic sine instructions integrate into a cpu's floating point unit, revealing clocked iterations, select lines, and microcoded control that compute sine.
Extend Cordic sine accuracy beyond minus ninety to ninety degrees by folding angles with the floating point fold function. Then compute with the floating point Cordic sine and cosine routines.
Develop cosine with the cordic unit across the full domain by extending the sine workflow, using three addressing modes, and employing a subroutine approach to obtain the result.
Plot sine, cosine, and tangent with the cordic algorithm on a graphics screen, assigning memory addresses and colors, and verify results first in the emulator before final hardware run.
Explore Cordic based inverse tangent computation, generating arctan with a floating point unit select line, testing with pi/4, and simulating the output via assembly and graphics plots.
Explore how to generate arcsine and arccosine from arctan using the cordic method, via a right-triangle identity and a microcode implementation, with testing and plotting.
The lecture demonstrates implementing the cordic inverse cosine function using arc cos, arc sine, and microcode on a cpu design, covering domain limits, arctan iterations, and emulator testing.
Explore the secant function, the reciprocal of cosine, and its Cordic folding into the zero to pi over two core, addressing periodicity, quadrant mapping, and the asymptote.
Explore the cordic cotangent implementation by folding angles into zero to pi over two, mapping quadrants, and computing cotangent as cosine over sine with sign adjustments, plus plotting results.
Learn how a microcode sequencer uses a microcode rom lookup table and microinstructions to support branching, looping, and nested jumps, enabling reusable, faster cpu control.
Welcome to Design a CPU 4
Are you ready to take the next big step in your CPU design journey?
In Design a CPU 4, we move beyond the basics and into advanced concepts that bring your custom processor closer to a fully functional computer system.
This course builds directly on everything you’ve learned so far in the Design a CPU series. If you’ve completed Design a CPU 1, 2, and 3, you’ve already mastered integer arithmetic, basic assembly, and core CPU organisation. Now, it’s time to push further and start developing real-world features that modern CPUs depend on.
By the end of this course, you’ll not only understand how CPUs handle floating-point numbers and organise code efficiently, but you’ll also have laid the foundations for your very own operating system.
What You’ll Learn in This Course
In Design a CPU 4, we focus on four key milestones that bring your CPU to life:
1. Integrate a Floating-Point Unit (FPU)
We start by enhancing your CPU with floating-point arithmetic capabilities. Many real-world applications — from scientific computing to graphics processing — rely heavily on floating-point operations, and now your CPU will too.
You’ll learn:
How floating-point numbers are represented in binary
How to integrate a hardware-based FPU into your existing CPU design
How to handle floating-point add, subtract, multiply, divide, and square root operations
How modern CPUs optimise speed and accuracy
This is a huge leap forward in making your CPU practical for real-world workloads.
2. Write Assembly Code Using New Instructions
With floating-point capabilities comes a powerful new set of assembly instructions.
We’ll show you how to:
Write efficient assembly code that uses the new FPU instructions
Optimise your programs for speed and clarity
Debug and test floating-point operations using the emulator
By the end of this section, you’ll be confident writing both integer and floating-point programs directly on your custom CPU.
3. Organise Subroutines into Libraries
As your programs grow, code organisation becomes critical. In this course, you’ll learn best practices in computer organisation by creating reusable libraries:
Package commonly used subroutines into separate libraries
Link libraries together when compiling and assembling your code
Build the early framework of your CPU’s own operating system
This approach mirrors how professional software development works, helping you develop scalable, maintainable codebases — even when working close to the hardware.
4. Run, Test, and Debug with the Emulator
Theory is nothing without practice, so we’ll spend time using the RTM-16 emulator to:
Load and run your programs
Test new FPU instructions in action
Debug issues step by step
See how your CPU executes instructions at the microcode level
The emulator makes the learning process interactive and intuitive, helping you visualise what’s happening inside the CPU.
Who This Course Is For
This course is perfect for anyone who:
Has completed Design a CPU 1, 2, and 3 and wants to continue building
Loves understanding how computers work at the deepest level
Enjoys hands-on projects and learning by building
Wants to develop skills in computer architecture, assembly language, and low-level programming
Is considering a future in computer engineering, embedded systems, or CPU/FPU design
If you’ve ever wanted to truly build a computer from the ground up, this course will take you there step by step.
Why This Course is Different
Unlike other courses that just explain concepts, Design a CPU 4 is fully hands-on.
You’re not just reading slides or watching diagrams — you’re building.
You’re not just writing generic assembly — you’re creating programs that run on your own CPU.
You’re not just learning floating-point theory — you’re designing an FPU and using it.
By the end, you won’t just understand how CPUs work — you’ll have designed, programmed, and tested one yourself.
Prerequisites
To get the most from this course, you should:
Have completed Design a CPU 1, 2, and 3
Be comfortable with basic assembly programming
Have a basic understanding of binary, hexadecimal, and logic circuits
If you’re new to CPU design, start with the earlier courses first — they’ll give you the strong foundation you need to succeed here.
Your Next Step: Design a CPU 5
At the end of this course, we’ll take a quick look at what’s coming next in Design a CPU 5. This is where we move to an even higher level of abstraction:
Building a compiler from scratch
Designing your own high-level programming language
Writing programs that automatically translate into assembly for your custom CPU
Everything you’re learning in Design a CPU 4 lays the groundwork for this exciting next stage.
What You’ll Achieve by the End
By completing this course, you’ll:
Understand how floating-point numbers are handled in hardware
Integrate an FPU into your CPU design
Write assembly programs using extended instruction sets
Create and manage libraries of reusable code
Build the foundation of your own operating system
Test, debug, and refine your work with the emulator
These are the skills professional computer architects, embedded engineers, and systems programmers rely on every day.
Let’s Get Started
Your CPU journey is about to take an exciting turn. You’ve built the foundation — now it’s time to expand your design, write powerful new code, and take the first steps towards creating your very own operating system.
Enrol today and start building the next stage of your CPU!