Understanding von Neumann Architecture

Let's learn Computer Systems!

After two weeks of procrastination, I !finally converted my notes into an article and published it!

Prologue

I identify as a Kibo student, or as I like to call it, a "Kiboan." The primary objective of this blog is to share my learning experiences as I navigate my journey towards achieving the "kibo." Admittedly, I've been absent for an extended period, and during this time, you've missed out on both my challenges and triumphs. I apologize for that and aim to use this article as a means to reconnect you with my life as a Kibo student.

Now that my apologetic remarks are behind us, I'll delve into the von Neumann architecture—a topic covered in the Computer Systems course I'm enrolled in this term, which is the second term of my second year. It's worth noting that we are presently in the third week of this term as I compose this carefully considered article (as you'll soon discover).

Overview of the von Neumann Architecture

To keep this article semi-reader-friendly, let's start like this:

Hey, did you know about John von Neumann? He was this cool Hungarian-American guy who rocked the worlds of math, physics, and computers—all at the same time! I mean, who does that? Anyway, he wasn't just collecting titles for show; he actually did some pretty amazing stuff.

Now, why do we care about him for this article? Well, turns out he's the brain behind the architecture that forms the backbone of today's computers. Yep, he basically set the stage for our digital lives. Talk about leaving a mark! Go, von Neumann!

Did you catch on to the fact that my nickname last year was PoeticMan(iac)? I hope my pun was as obvious as a scent from a distance.

This architectural framework delineated several subsystems or interfaces that were organized and streamlined to collectively form a cohesive computer system.

Did you notice the article has gone "formally" rogue again? Your gift of forbearance is needed shortly.

Some of the interfaces include:

  • Arithmetic Logic Unit ("What on earth is that?" I hear you shouting)

  • Control Unit ("Am I not the boss around here?" I hear you bragging)

  • Memory ("My brain should be plenty, thank you very much," you said, looking puzzled)

  • I/O ("Hey, you lost me at 'I,' and 'O' sounds like 'oh no!' Am I right or what?" you protested)

The aim of this article is to outline the nature of these interfaces and illustrate how they collaborate to shape the device through which you are currently perusing this article.

Show Me the Blueprint, Victor Ohachor!

Absolutely! What's the point of an architecture article without some visuals, right?

I've even heard the saying that a picture is worth more than a thousand words, though I'm not entirely sold on being a fanboy of that statement.

Von Neumann Architecture - Computer Science GCSE GURU

That picture right there describes a computer system design based on stored-program concept where programs and data are stored in separate memories but treated the same.

You might not be vibing with my article—maybe you think I'm a lousy writer, or technical jargon isn't your thing. No worries! For all you visual learners out there, I've got you covered with a video that breaks down this architecture.

"Every computer system is made up of three (3) basic components," says von Neumann architecture. This was the model used later to develop the first programmable computers.

These three components include:

  1. Central Processing Unit - This serves as the primary component responsible for executing instructions and performing calculations. It acts as the brain of the computer, coordinating the overall operation of the system.

    The CPU interacts with the computer's memory to fetch instructions and data, and it includes subcomponents such as the Control Unit and the Arithmetic and Logic Unit (ALU).

  2. Memory Unit - This is crucial component responsible for storing data and instructions. Unlike some alternative architectures, von Neumann architecture integrates the storage of program instructions and data within the same memory space. As such, it allows the CPU to access and retrieve data and instructions as needed during the execution of a program.

    Simply put, the memory unit is like the computer's short-term memory, holding the information the CPU needs to perform tasks and execute programs.

  3. Input/Output (I/O) Unit - This is responsible for managing the communication between the computer and external devices. This component facilitates the transfer of data between the computer's internal components, such as the CPU and memory, and external devices like keyboards, mice, printers, and storage devices.

    With the I/O unit, the computer can interact with the outside world, receive data from users, execute instructions based on input commands, and much more.

Into the rabbit hole, shall we?

Central Processing Unit

The CPU is made up of three (3) components:

  1. Arithmetic Logic Unit (ALU)

  2. Control Unit (CU)

  3. Registers

Arithmetic Logic Unit (ALU)

Similar to a chef in the kitchen who adheres to the instructions in her recipe handbook to create the most delectable dishes known to humanity, the Arithmetic Logic Unit (ALU) follows the instructions provided by the main memory to execute a variety of calculations and logical decisions.

💡
You know what?That guy's the real deal! He can make smart choices using data, no emotions involved. Way to go, ALU!

Lecture on ALU and Control Unit Design Presented

Control Unit (CU)

Oh, I lied! My bad, I don't lie. I just chose not to share some details about ALU because jumping to the future is a bit too much when the present isn't sorted out.

Recall when I mentioned that the ALU carries out instructions from the main memory? Unfortunately, the main memory isn't that clever. It can't assign instructions to a unit; it only stores data and instructions while a program is running.

The Control Unit is the go-to person when you need to manage the entire operation or flow of program execution. It's the one you reach out to if you want to avoid your computer system going haywire and unexpectedly printing money.

Do you know?
An orchestra conductor is one who directs musicians, ensuring that each plays their parts at the right time.

The Control Unit (CU) directs the operations of the computer, ensuring each process happens in the correct sequence and at the right time. It does this by fetching instructions from the memory, decoding the instructions to understand the actions required, coordinating other units (ALU, Memory, and I/O devices) to execute these actions.

💡
Oh, wow!Now, that's what I call true leadership! She's got the knack for delegating tasks effectively, understanding the art of the "how" in task distribution. It's a skill that sets her apart as a remarkable leader.

The control unit directs and coordinates most of the operations in the ...

Registers

They are small, fast storage locations in the CPU used to hold temporary data and instructions. I can't imagine how slow the CPU would execute instructions without registers, can you?

How exciting would it be to write a book or article that explores the scenario "If There Were No Registers"?

Imagine that! Registers are these petite, high-speed storage spots designed for temporary data storage and swift access. Whenever there's a variable to be utilized, its value finds a home in the register... and the list of their essential functions goes on and on.

Without registers, some of the consequences that would arise include:

  1. Reduced Processing Speed - Exercise caution when devising a system that necessitates accessing the main memory for utilized data, exercise caution.

    Accessing data from a register is typically faster than retrieving it from the RAM (main memory). Consequently, in the absence of registers, the CPU would be compelled to depend solely on accessing data from RAM, resulting in a noteworthy deceleration in processing speed.

  2. Limited Capacity for Immediate Operations: Registers are crucial for immediate operations and storing intermediate results during calculations. Without them, the CPU would need to perform more operations directly on data stored in the main memory, which is less efficient.

  3. Reduced Overall System Performance: The absence of registers would lead to reduced parallelism and efficient data handling. The CPU would spend more time waiting for data transfers, resulting in decreased overall system performance.

    Do you know?
    In the context of computer systems, parallelism involves dividing a larger task into smaller subtasks that can be executed concurrently. It can happen at instruction level (multiple instructions running simultaneously), task level (a program broken down into components to be executed concurrently by multiple processors), and data level. You can learn more here.

Back to our discussion on registers, shouldn't we?

Registers play a key role in getting instructions executed as they store operands from an instruction, intermediate results, and so on. They are like small workbenches in a workshop where tools are temporarily kept for immediate use.

💡
Question: Do registers exist within the ALU to enhance the efficiency of arithmetic and logical operations?

Memory

Consider a scenario where humans lack the capacity for memory—no recollections to contemplate, learn from, or lament. On a lighter note, at least a bomb squad wouldn't be necessary in such a memory-free existence.

Without memory, a computer would cease to exist, unless you're inclined to refer to a machine that takes as long to power up as the time spent in a restroom and requires light years to execute a program. Fortunately, in such a scenario, concerns about data structures would be unnecessary, as there would be no place to apply them.

The memory comprises RAM (Random Access Memory), which is the space where your program, along with its associated data, resides when you execute it. It is also the area the CPU references when executing instructions or when there is a need to store or retrieve data.

The Memory is made of two (2) components:

  • Primary memory

  • Cache memory.

Primary Memory

This includes the RAM that stores data and instructions that are immediately needed for execution. RAM is like an office desk that can hold just as many files and items for as long as they are being used or as much as there is still space on the desk.

A Picture of RAM

Primary memory encompasses ROM (Read-Only Memory), a storage unit that retains the essential data and instructions required for the computer's operation. Typically programmed by the computer's manufacturer, this data in ROM is immutable.

An illustration of such programs inscribed in ROM is the BIOS, initiating operation as soon as the computer is powered on. The BIOS conducts a thorough check to ensure the proper functioning of the computer's hardware before advancing to execute the bootup program. This program transfers the operating system from the secondary memory to the RAM.

A Picture of ROM (Read Only Memory)

Cache Memory

A cache stores, temporarily, frequently accessed or recently used data to enable quicker access to the data in the future.

The primary purpose of a cache is to reduce the latency and speed up data retrieval by keeping a copy of frequently requested information close to the processor.

Caches are located close to the CPU, precisely between the CPU and the RAM. They are faster than RAM, slower than registers, and have less storage capacity than RAM. They could be likened to sticky notes where you can scribble down something really quickly so you can access it very easily without having to search through your notes.

I/O Devices

When an external device needs to communicate with the CPU or transfer data, an I/O operation is initiated, involving the exchange of data between the CPU and the external device. Special I/O instructions are employed to control and manage these operations, distinct from the regular arithmetic and logical instructions.

It's essential to note that I/O devices are typically memory-mapped; certain addresses in the main memory are reserved for communication with specific I/O devices. Consequently, writing to or reading from these memory addresses triggers communication with the associated I/O device.

Also, whenever an external device requires the attention of the CPU or an I/O operation is completed, it generates an interrupt. This signal prompts the CPU to temporarily pause its current task and address the I/O request.

Some components of the I/O mechanism include:

  1. Input devices.

  2. Output devices.

  3. I/O controllers.

Input Devices

These peripherals are utilized to input data into the system. They comprise a keyboard, mouse, scanner, microphone, joystick, and more.

Occasionally, external data from a source, such as a person, is required for the execution or completion of an instruction. These devices facilitate that process.

Output Devices

These components include monitors, printers, speakers, and more. They are used by the computer to output data or information from the result of an execution to users.

I/O Controller

This component manages the communication between the computer's system and its external environment, including handling user inputs and system outputs.

Of course, they are in control!

Summary

Assuming you enter a hardware lab where a group of world-class hardware engineers is designing the next-generation computer system, you glance at the wall and encounter a diagram of the von Neumann architecture. The familiarity hits you as you recall reading this article about it, and your excitement is palpable.

You point at the diagram and exclaim, catching the attention of the entire hardware crew, who look at you with puzzled expressions. "I recognize this architecture; if I explain it, can I join your team?" you enthusiastically inquire. Your excitement is evident.

The team leader gives you the go-ahead, and you begin to describe the architecture. However, halfway through, you start to stutter, realizing you've forgotten much of what you learned from the article. Hisses from some team members indicate their dissatisfaction with what seems like a waste of time.

Disappointment sets in as you grapple with the realization that you faltered. Suddenly, a voice resonates, "I am impressed." It's the team lead's voice. As he speaks, he removes his goggles and helmet, revealing himself. Lo and behold, it's ME. I extend my hand, shake yours, and inform the team that you are now a part of the group.

Consider this: What if I weren't the team lead? In that case, you might have been promptly escorted out of the lab. It underscores the importance of revisiting this article so that you can avoid such mishaps.