Fundamentals of Computer Architecture: Understanding the Structure Behind the Hardware

yihongz

Paulo Almeida

Posted on October 6, 2024

Fundamentals of Computer Architecture: Understanding the Structure Behind the Hardware

Welcome to our series of articles where we will, together, build a 6502 processor simulation in C++! But before diving into the coding, it’s essential to understand the concepts of Computer Architecture and Computer Organization, which will serve as the foundation for all the work we’ll be doing.

These two terms, though they may seem similar, have very distinct meanings in the context of computer science. Let’s explore what each one means and why they are important for building a simulated processor.

What is Computer Architecture?

Computer Architecture refers to the attributes of a system that are visible to the programmer. In other words, it’s how the computer is organized and designed from the perspective of someone programming it, focusing on what directly affects the execution of a program. This includes:

  • The set of instructions the processor can execute (known as the ISA – Instruction Set Architecture).
  • The addressing modes, which are the ways data in memory can be accessed.
  • Data formats and the number of bits used to represent numbers or characters.
  • Registers, which store temporary data within the processor.

In summary, architecture is related to what the programmer “sees” and interacts with, like the instructions and resources of the processor. A classic example of architecture is the ISA, which defines the logical structure that a machine language programmer works with.

What is Computer Organization?

Computer Organization is different from architecture. It refers to the internal components of the hardware and how these components operate and interconnect to implement the specifications of the architecture. While architecture is concerned with “what” a processor can do, organization deals with “how” it is done, involving aspects such as:

  • Control signals and interfaces between the processor and external devices, like memory or peripherals.
  • The memory technology used.
  • How an instruction is executed at the hardware level.

For example, an architectural question would be: Does the processor have a multiplication instruction? An organizational question would be: Is that instruction executed by a dedicated multiplication unit or through repeated addition operations?

Difference Between Architecture and Organization

Although these terms are often used interchangeably, the distinction between architecture and organization is important. The same processor can have various organizational implementations over the years, but its architecture remains the same. For example, the famous Von Neumann Architecture defines how memory and the processor interact, and this structure can be used in different hardware implementations.

Practical Example

Let’s use an example to clarify this:

  • The decision to include a multiplication instruction in the processor is part of the architecture.
  • How that multiplication is executed (using dedicated hardware or through other instructions like repeated additions) is part of the organization.

Thus, computer manufacturers can produce models with the same architecture but differences in organization, such as speed, cache, or memory capacity.

Why Does This Matter?

If you want to emulate a processor like the 6502, it’s crucial to understand these two aspects. The architecture will define which instructions your emulator needs to support and how the processor should “appear” to the programmer. The organization will help you understand how to implement these instructions in code, dealing with registers, the ALU, memory, and other hardware components.

Next Steps

Before we get hands-on with building the 6502 processor simulation, we’ll first cover some key foundational topics in Computer Organization and Architecture (COA). These will provide the essential theoretical background to help you understand how processors work at a deeper level. Once we’ve established this groundwork, we’ll move into the practical aspects, starting with C++ programming to emulate the processor.

Stay tuned for the next steps as we explore these crucial concepts before diving into the coding phase!

💖 💪 🙅 🚩
yihongz
Paulo Almeida

Posted on October 6, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related