Kinnu

Hardware

CPU: The computer's brain

The Central Processing Unit (CPU) acts as the brain of the computer, responsible for performing calculations, executing instructions, and managing data flow. Software applications are composed of instructions that guide the CPU on tasks to perform. When a CPU has multiple cores, which are individual processing units within a processor, it enables parallel execution of tasks. In the diagram below, the CPU is the components in the ‘Processor’ box.

Block diagram of a basic computer

The primary components of the CPU include the Arithmetic and Logic Unit (ALU) and the Control Unit. The ALU which conducts mathematical computations and logical operations, and various registers. These registers are small, fast storage areas within the CPU, with general-purpose registers (R1, R2, R3…) temporarily holding data and results, the Instruction Register storing the current instruction being executed, and the Instruction Address Register (IAR or Program Counter) tracking the address of the next instruction. The Control Unit manages the operations of the CPU, decoding instructions and directing their execution.

The CPU operates via the fetch-decode-execute cycle: fetching an instruction from memory, decoding it, and executing the specified action.

Block diagram of a basic computer

Random Access Memory (RAM) provides fast, temporary storage used by the CPU for quick data access. The cache is a smaller, faster type of volatile memory located within the CPU, used to store frequently accessed data for quick retrieval, thus reducing the time needed to access data from the main RAM. Data buses serve as pathways that transfer data between the CPU and other components, facilitating essential communication.

The Control Unit directs the execution of instructions and the movement of data within the CPU. Interaction with memory is paramount as the CPU communicates with RAM and other components using buses that transfer address, data, and control signals, crucial for fetching instructions and data required for execution.

The CPU clock generates regular, precise signals that synchronize the operations of the CPU, ensuring that all components work in harmony. Clock speed, measured in Hertz (Hz), impacts performance, with higher clock speeds allowing more instructions to be processed per second. Modern CPUs typically operate in the gigahertz range (billions of cycles per second).

Overclocking, the process of increasing the clock speed beyond the manufacturer's specifications, can boost performance but may lead to overheating and instability if not properly managed. Conversely, underclocking, or reducing the clock speed, saves power and reduces heat, beneficial for battery-powered devices like laptops and smartphones.

The CPU operates via the fetch-decode-execute cycle: fetching an instruction from memory, decoding it, and executing the specified action.

Consider a simple program where the CPU needs to add two numbers. It loads a value from memory into a register, and then adds a register value to another register value, storing the result in a further register. Remember that registers are the storage units within the ALU and are represented by R1, R2, etc.

Let's break down what each step is doing:

1 – Fetch: The CPU fetches "LOAD R1, 1000" (0001 0001 1000) from memory. The first 4 bits are the opcode, specifying the operation (Load). The second 4 bits represent R1 as the destination register, and the last 4 bits are the memory address where the data is stored.

2 – Decode: The Control Unit identifies the instruction as a Load operation and signals memory to load the value at address 1000 into R1.

3 – Execute: The CPU executes the Load instruction by storing the fetched value into R1.

4 – Fetch: The CPU fetches "ADD R3, R1, R2" from memory. (Let’s assume R2 was previously loaded with a value, to avoid repetition)

5 – Decode: The Control Unit interprets it as an Add operation and prepares for addition using ALU.

6 – Execute: The ALU adds the value in R1 to the one in R2, storing the result in R3.

At every Fetch step the IAR is incremented to point to the next instruction.

Random Access Memory and storage types

When you use a computer, you interact with two main types of memory: Random Access Memory (RAM) and stored memory. RAM is the short-term memory of your computer, and the memory that’s being accessed for most of the processes you do. You can think of RAM as the data that’s stored at the “top of your head”.

Stored memory lives in storage devices. This would be the Hard Disk Drive (HDD), or hard drive, or a Solid State Drive (SSD). These drives serve as long-term memory, like a library or the storage unit you’re renting out.

Let’s look further into RAM. RAM is a type of volatile memory, meaning it loses its data when the computer is turned off. It is used to store data that your computer needs to access quickly. For example, when you open a program, its information and data is loaded from your long-term memory (your hard drive) into the short-term memory holder, your RAM. This allows the CPU to access the program's data much faster than if it had to read it directly from the storage device.

The more RAM your computer has, the more data it can handle at once, which generally translates to better performance, especially when multitasking. Most standard laptops will have 4-8 gigabytes, or GBs of RAM, but laptops used for gaming, 3D modeling, or heavy programs might have 16GBs or more.

Expandable RAM cards. Image: Geni, CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons

Storage, conversely, is non-volatile, meaning it retains data even when the computer is turned off (aren’t you glad your storage unit keeps its contents when you close it?)

Traditional hard drives use spinning magnetic disks to store data. They are relatively inexpensive and offer large storage capacities, but they are slower compared to a solid state drive.

SSDs use flash memory to store data, which allows for much faster read and write speeds. This speed difference is noticeable in everyday tasks like booting up your computer, opening applications, and transferring files. SSDs are more expensive per gigabyte than HDDs, but their performance benefits often justify the cost.

Comparison of RAM vs HDD memory

It’s possible to have even bigger storage devices, meant for handling large amounts of data and multiple simultaneous requests. These live outside your computer and are referred to as servers. We’ve already spoken about servers as a separate type of computer, but they often function as large-scale storage devices. Servers often use a combination of HDDs and SSDs to balance cost and performance. For example, frequently accessed data might be stored on SSDs, while less critical data is stored on HDDs.

Server storage solutions also include technologies like RAID (Redundant Array of Independent Disks), which combines multiple drives into a single unit to improve performance and provide data redundancy. This ensures that if one drive fails, the data can still be recovered from another drive in the array.

A final type of memory holder is cold storage. This refers to data that is not accessed frequently and can be stored on slower, less expensive media. This might include backups, archival data, or any information that doesn't need to be accessed regularly. Cold storage is most commonly seen in large companies or institutions.

For example, if you were to ask your university for a copy of your transcript ten years after you graduated, they would likely be accessing their cold storage to retrieve it. Cold storage solutions can include tape drives, optical discs, or even cloud storage services designed for archival purposes. While these options are slower to access, they are cost-effective for long-term storage.

Graphics Processing Unit (GPU)

The Graphics Processing Unit (GPU) is a specialized electronic circuit designed to accelerate the processing of images and videos. While the Central Processing Unit (CPU) is often referred to as the brain of the computer, the GPU can be thought of as the paintbrush, rendering the visual elements that make up the user interface and graphical content.

Originally developed to handle the many calculations required for rendering images in video games, GPUs have evolved to become powerful processors capable of handling a wide range of computational tasks. GPUs are composed of thousands of smaller, more efficient cores designed to handle multiple tasks simultaneously. This architecture makes them particularly well-suited for parallel processing, where many calculations are performed at the same time.

The difference between CPUs and GPUs is that CPUs can perform more complex calculations, but only a handful of them at once. With thousands of smaller cores, GPUs can perform thousands of simple calculations at the same time. This means both CPUs and GPUs excel at different tasks.

When it comes to the GPU in a computer system, there are two main options: integrated and dedicated.

Integrated GPUs are built into the same chip as the CPU and share system memory. They are generally less powerful but more energy-efficient, making them suitable for everyday tasks like web browsing and office applications.

Dedicated GPUs, on the other hand, are separate cards that come with their own VRAM (Video Random Access Memory) and are designed for more demanding tasks. These are the GPUs found in gaming PCs, workstations, and servers.

A dedicated GPU. Image: Verte95, CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons

The performance of a GPU is influenced by several factors, including its architecture, clock speed, and the number of cores. Manufacturers like NVIDIA and AMD release new GPU architectures every few years, each offering improvements in performance, efficiency, and features.

Some users use overclocking, which is running the GPU at a higher clock speed than its default setting. This is to boost performance, but may lead to increased heat output and power consumption.

GPU memory, often referred to as VRAM (Video Random Access Memory), is used to store image data and textures that the GPU needs to access quickly, just like the RAM we talked about in the previous orb, except for graphical data specifically. The amount and speed of VRAM can significantly impact the performance of a GPU, especially in high-resolution gaming or professional applications like 3D modeling and video editing. Modern GPUs come with several gigabytes of VRAM, allowing them to handle complex scenes and large datasets with ease.

In addition to gaming and professional graphics, GPUs have found a new role in the field of artificial intelligence (AI) and machine learning. The same parallel processing capabilities that make GPUs ideal for rendering graphics also make them perfect for training neural networks.

Companies like NVIDIA and AMD have developed specialized GPUs and software frameworks to accelerate AI research and development. These GPUs can perform the matrix multiplications and other mathematical operations required for machine learning algorithms much faster than traditional CPUs.

Motherboard and I/O devices

The motherboard serves as the central nervous system of a computer, connecting all the critical components and ensuring they communicate effectively. Think of it as the stage where the computer’s performance unfolds. Nestled at the heart of the motherboard is the CPU socket, the designated spot where the processor is installed. The intricate design of the socket ensures that the CPU is securely connected to the motherboard, allowing it to send and receive signals swiftly.

A Dell Precision motherboard. Image: Marcin Wieclaw (pcsite.co.uk), CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons

Adjacent to the CPU socket are the memory slots, which house the RAM modules. When a computer is powered on, data that the CPU needs quick access to is loaded into the RAM. This proximity allows the CPU to fetch and execute instructions rapidly without having to wait for data retrieval from slower storage devices.

Additionally, the motherboard features expansion slots like PCIe, which provide flexibility for users to enhance their systems. When you add a graphics card into a PCIe slot, for example, the motherboard's design facilitates the transfer of data between the card and the CPU, thus boosting the computer’s graphical performance for tasks like gaming or video editing.

Power connectors on the motherboard ensure that all its components receive the necessary electricity to function. The design of these connectors allows the power supply unit (PSU) to distribute power effectively across the motherboard, stabilizing the system’s operation.

Moreover, the motherboard houses chipsets that play a pivotal role in managing data flow. These chipsets act as intermediaries, directing data between the CPU, memory, and other peripherals. For instance, when you open a file, the chipset coordinates the transfer of data from the storage device to the RAM and then to the CPU, ensuring that the process is smooth and efficient.

An essential part of the motherboard's functionality is the BIOS/UEFI firmware. This firmware is the first to activate when you power on your computer. It initializes the hardware components, ensuring they are ready to operate. During this booting process, the BIOS/UEFI performs checks and balances, setting the stage for the operating system to take over. This initial setup is crucial for the seamless operation of the computer, providing a stable foundation for all subsequent tasks.

A BIOS chip from 1999. Image: © Raimond Spekking / CC BY-SA 4.0 (via Wikimedia Commons)

Input and output devices, commonly referred to as I/O devices, are vital for interaction with the computer. The keyboard, an input device, sends signals to the motherboard when keys are pressed. These signals travel through the connected interfaces, allowing the CPU to interpret and display the corresponding characters on the monitor. The monitor, an output device, receives graphical data from the graphics card via interfaces like HDMI. This data is then rendered into visual information that users can interact with.

Peripheral interfaces such as USB, HDMI, and Ethernet ports are integrated into the motherboard to facilitate the connection of various external devices. When you plug a USB drive into a USB port, the motherboard’s design allows it to recognize the device, enabling data transfer between the drive and the computer.

A USB port on a motherboard. Image: USB 3.1 GEN2 Key-A front panel connector IMGP3038 smial wp by Smial, talk (FAL) <http://artlibre.org/licence/lal/en>, via Wikimedia Commons

Similarly, connecting a monitor via an HDMI port ensures that high-definition video and audio signals are transmitted from the computer to the display. Ethernet ports enable wired internet connectivity, allowing data packets to travel between your computer and the network, ensuring reliable and fast internet access.

Computer maintenance and troubleshooting

Maintaining and troubleshooting your computer is crucial for ensuring its longevity and optimal performance. Regular maintenance can prevent many common issues, while effective troubleshooting can help you quickly resolve problems when they arise. Let's explore some key practices and strategies for keeping your computer in top shape and addressing issues when they occur.

First, let's talk about the importance of keeping your computer clean. Dust and debris can accumulate inside your computer, leading to overheating and hardware failure. To prevent this, regularly clean the exterior and interior of your computer. Use compressed air to blow out dust from the vents, fans, and other components. Be sure to power down and unplug your computer before cleaning to avoid any electrical hazards. Additionally, keep your computer in a clean, dry environment to minimize dust buildup.

Next, consider the software side of maintenance. Keeping your operating system and software up to date is essential for security and performance. Software updates often include patches for security vulnerabilities, bug fixes, and performance improvements. Enable automatic updates whenever possible to ensure you receive the latest updates promptly. Additionally, regularly scan your computer for malware and viruses using reputable antivirus software. Malware can slow down your computer, steal personal information, and cause other issues, so it's important to keep your system protected.

Another critical aspect of computer maintenance is managing your storage. Over time, your hard drive or solid-state drive (SSD) can become cluttered with unnecessary files, which can slow down your computer. Regularly clean up your storage by deleting temporary files, uninstalling unused programs, and organizing your files. Disk cleanup tools and defragmentation utilities can help optimize your storage and improve performance. For SSDs, defragmentation is not necessary, but you can use tools to optimize their performance.

A hardware maintenance tool. Image: Public domain

Backing up your data is also an essential maintenance task. Regular backups ensure that you don't lose important files in case of hardware failure, malware attacks, or accidental deletion. Use external hard drives, cloud storage services, or network-attached storage (NAS) devices to create backups of your important data. Schedule automatic backups to ensure your data is always protected.

Now, let's discuss troubleshooting common computer issues. One of the most frequent problems users encounter is a slow computer. If your computer is running slowly, start by checking for malware and viruses.

Next, review the programs running on startup and disable any unnecessary ones. Too many startup programs can significantly slow down your computer. Additionally, check your storage usage and free up space if your drive is nearly full.

A startup applications management tool. Image: Public domain

Another common issue is hardware failure. If your computer won't turn on or is experiencing random crashes, it could be due to faulty hardware. Start by checking the power supply and ensuring all cables are securely connected. If the issue persists, test individual components such as the RAM, hard drive, and graphics card. Many motherboards have diagnostic LEDs or beep codes that can help identify the faulty component. If you're unsure how to proceed, consult the manufacturer's documentation or seek professional assistance.

Some examples of beep codes. Image: Public domain

Connectivity issues are also common, particularly with network connections. If you're having trouble connecting to the internet, start by checking your network cables and ensuring your router is functioning correctly. Restarting your router and computer can often resolve connectivity issues. If the problem persists, check your network settings and ensure your drivers are up to date. For wireless connections, interference from other devices or physical obstructions can cause connectivity problems, so try moving your computer closer to the router or using a wired connection.