Hey everyone,
I know I've been a bit quiet lately. Been juggling a personal project (more on that soon, I promise!) and mentoring some of our first-year students on campus. That aside I’ve also been going deep into some technical topics, putting together some great reads and catching a film or two. It's been a whirlwind, but in the best way possible. Now, let’s get into the big stuff
Computer Architecture
One thing that's always fascinated me is Computer Architecture. I first discovered this when I went deep into a rabbit hole exploring the difference between ARM architecture and x86. Remember that time Apple shocked the entire industry with their M1 chips back in 2020? Yeah.
Anyways, I had the chance to dive deep into it last semester, and I wanted to share some of the key concepts I learned. Partly because I feel like it’s not talked about enough, and also cause I want to flex my understanding of the topic: Enjoy😎
Core concepts
At its core, computer architecture is the blueprint of a computer system. It's not just about the individual components (like the CPU or memory), but also how those components are interconnected and how they communicate. Think of it as the functional behavior of a computer system.
One of the fundamental concepts is the Instruction Set Architecture, or ISA. This is really the interface between the hardware and the software. It defines the set of instructions that the CPU can execute. You can think of it as the language that the software uses to talk to the hardware. The ISA includes things like instruction formats, which dictate how instructions are structured (think opcode and operands), and addressing modes, which explain how the CPU locates the data it needs to process (like direct, indirect, and register addressing). It also defines the data types the CPU can work with, such as integers and floating-point numbers.
Then you have the Central Processing Unit, or CPU. This is the brain of the computer, fetching, decoding, and executing instructions.
Remember these three terms because they are the very foundation of what goes on in the CPU.
The CPU has several key components. You have registers, which are small, high-speed storage locations used to hold data and instructions that the CPU is actively working on (Fetching). There's the Arithmetic Logic Unit (ALU), which performs all the arithmetic and logical operations (Decoding) and then the Control Unit (CU), which manages the flow of instructions within the CPU(Execution)
Memory, IO and CPU tricks
Computers also use a memory hierarchy to balance speed and cost. Registers are the fastest, smallest, and most expensive type of memory. Then comes cache, which is faster and smaller than main memory, holding frequently accessed data. We often talk about L1, L2, and L3 caches. Main memory, or RAM, is larger and cheaper than cache, but slower. Finally, you have secondary storage, like hard drives and SSDs, which are the largest and cheapest, but also the slowest.
The Input/Output system is another crucial part of the architecture. This is how the computer interacts with the outside world, using devices like keyboards, mice, displays, and network interfaces.
There are also some more advanced concepts. Pipelining is a technique that allows the CPU to work on multiple instructions at the same time, which increases throughput. You can think of it like an assembly line for processing instructions. Parallel processing involves using multiple processors to execute instructions simultaneously, which can significantly speed up complex computations. There are different types of parallel processing architectures, like SIMD (Single Instruction, Multiple Data), where one instruction operates on multiple data items, and MIMD (Multiple Instruction, Multiple Data), where multiple processors execute different instructions on different data.
Advanced stuff
Virtual memory is another important concept. It's a technique that allows a computer to use more memory than is physically available by swapping data between RAM and secondary storage. Operating systems use various strategies for memory management, including paging and segmentation. In multiprocessor systems, cache coherence is essential. This means ensuring that all processors have a consistent view of the data in the cache. Protocols like MESI (Modified, Exclusive, Shared, Invalid) help maintain this coherence. And modern computer architecture also considers power efficiency, using techniques like dynamic voltage and frequency scaling (DVFS) to reduce power consumption.
Understanding computer architecture is crucial for anyone working in software or hardware. It helps you write more efficient code, design better systems, and troubleshoot performance problems. For example, knowing how cache works can help you optimize your code to improve data locality and reduce memory access times.
ARM vs x86
If you made it this far. You can handle whats coming:
ARM and x86 are two types of computer processor architectures that differ significantly in design and functionality. ARM processors use a Reduced Instruction Set Computing (RISC) approach, prioritizing simplicity, efficiency and power conservation, making them ideal for battery-powered devices like smartphones.
In contrast, x86 processors utilize a Complex Instruction Set Computing (CISC) approach, focusing on high performance and compatibility, often at the cost of higher power consumption, which suits them for demanding tasks like gaming and data analysis. While ARM excels in energy efficiency, x86 leads in raw computing power. But, recent advancements in ARM technology have narrowed the performance gap, making ARM a viable option for more complex tasks. Circling back to Apple’s mind blowing PC performance using ARM technology, you can tell there’s a lot more in store.
Computer architecture really is a vast and fascinating field. These notes only scratch the surface, but I hope they provide a useful overview. I'm always eager to learn more, so if you have any questions or insights, feel free to share them in the comments
We’ll see if I can drop Computer Networking notes next, because why not, right?
Links and Resources
• Video explaining computer architecture into detail - YouTube
• Build AI powered apps in hours with Glide