What is a computer?

Reading time30 min

In brief

Article summary

In this lecture, we give the definitions of some key computer science concepts around computers starting with their very definition, their architectures and the various hardware components of a modern computer.

Main takeaways

  • A computer is an electronic device that can be programmed to automatically carry out sequences of arithmetic or logical operations (computation).
  • Real world computer relies on a description of a computer system called architecture and the most commons ones are: the von Neumann and Harvard architectures.
  • Computer consists in multiple hardware components such as the CPU, RAM modules, Storage devices connected through a Motherboard.
  • The user can interact with a computer using a variety of peripherals
  • To use a computer the user needs an Operating system

Article contents

Even if you have likely all used a computer, written or installed programs, or even built your own machine, it is sometimes important to go back to the basics to build a solid engineering foundation.

1 — The computer

A computer is an electronic device that can be programmed to automatically carry out sequences of arithmetic or logical operations (computation). While machines have been used for arithmetic tasks as early as 2700 BCE (Abacus, Pascaline, Charles Babbage’s Analytical Engine, etc. ), the term computer acquired its modern definition in the mid-20th century.

The principle of the modern computer was coined by Alan Turing in 1936 when he proposed what is now known as a universal Turing machine capable of computing anything that is computable by executing instructions (program) stored on a tape. To oversimplify, a Turing machine operates by reading and writing symbols on an infinite tape according to a set of rules defined by its transition function. It moves its read/write head left or right and changes its state based on the current symbol and state, allowing it to perform complex computations.

Animation of a 4-state, 2-symbol busy beaver (source).
Information

Ada Lovelace, born in 1815, is often considered the world’s first computer programmer. She wrote the first algorithm intended for Charles Babbage’s Analytical Engine, a mechanical general-purpose computer. Lovelace’s visionary work foresaw the potential of computers to go beyond mere calculations, envisioning their ability to manipulate symbols and create art and music. Her contributions laid the groundwork for the field of computer science long before the modern computer era began.

2 — Architectures

Transitioning from the theoretical framework of the Turing machine to a real world computer relies on a description of a computer system. Such computer system is what is called a computer architecture.

2.1 — von Neumann architecture

The von Neumann architecture (or Princeton architecture), named after mathematician John von Neumann, was proposed in 1945 in the First Draft of a Report on the EDVAC. It is inspired by the ENIAC, designed by J. Presper Eckert and John Mauchly, which is the first “programmable, electronic, general-purpose” digital computer.

This architecture consists of:

  • A Central Processing Unit with both an Arithmetic Logic Unit (ALU) and processor registers.
  • A Control Unit that includes an instruction register and a program counter.
  • Memory that stores data and instructions.
  • External mass storage.
  • Input and output mechanisms.

A von Neumann architecture scheme (source).

The particularity of this architecture is that both instructions and data are stored in the same memory. By treating instructions the same way as data, a computer with a stored program can easily modify the instructions. One significant reason for this capability was the need for a program to increment or modify the address field of instructions (for example, to create loops). This reason has become less important with the advent of index registers and indirect addressing as standard features of processors.

The von Neumann architecture has a main drawback called the “von Neumann bottleneck,” which refers to the limited throughput between the CPU and memory. Since both instructions and data share the same bus, this can create a performance bottleneck, especially as CPU speeds increase but memory speeds do not keep pace. Due to the shared bus, accessing memory for both instructions and data can also lead to increased latency.

Also, since instructions and data are stored in the same memory space, it is easier for malicious programs to exploit vulnerabilities and modify instructions, leading to security risks like buffer overflow attacks.

2.2 — Harvard architecture

In contrast with the von Neumann architecture, the Harvard architecture uses separate memory and separate pathways for the instructions and data. This means that the CPU has distinct memory spaces and pathways for instructions and data, allowing simultaneous access to both. This separation allows for faster and more efficient data processing, as the CPU can fetch instructions and read/write data concurrently.

Harvard architecture (source).

However, this design comes at a higher cost, can reduce flexibility and programming for such an architecture is usually more challenging. This is why it is often used in specific hardware mainly Digital Signal Processing (DSP) and microcontrollers such as the Atmel AVR and not general purpose computers.

Information

DSP were popularized by their inclusion in many of the Arduino line of open hardware development boards.

Finally, modern computers and processors appear to the user to be systems with von Neumann architectures, with the program code stored in the same main memory as the data. For performance reasons, internally and largely invisible to the user, most designs have separate processor caches for the instructions and data, with separate pathways into the processor for each. This is one form of what is known as the modified Harvard architecture.

3 — Hardware components

The architectures described in the previous sections are still a bit theoretical, here we intend to present the actual hardware components of a computer system.

3.1 — The Central Processing Unit (CPU)

In the von Neumann architecture, the CPU is responsible for executing instructions fetched from memory.

Intel Core i9 (source) and AMD Ryzen 9 (source) CPU.

Here are the components of a CPU:

  • Control Unit (CU) – The Control Unit directs the operation of the processor. It interprets instructions from memory and converts them into signals that control other parts of the computer. It fetches the instruction, decodes it, and then sends the necessary signals to execute it. Its role is to act as a traffic manager directing the flow of data within the CPU.

  • Arithmetic Logic Unit (ALU) – The ALU performs all arithmetic and logical operations. This includes addition, subtraction, multiplication, division, and logical operations like AND, OR, NOT, and XOR. Its role is to execute mathematical computations and logical comparisons.

  • Registers – Registers are small, fast storage locations within the CPU. They hold data, instructions, and addresses that are being used immediately by the CPU.

    There are several types of registers:

    • Data registers hold intermediate values of arithmetic and logical operations.
    • Address registers store memory addresses used by instructions.
    • Special purpose registers include the Instruction Register (IR), Program Counter (PC), and Status Register (SR).
  • Cache – The cache is a smaller, faster memory that stores copies of the data from frequently used main memory locations. It speeds up the retrieval of data by reducing the time needed to access memory.

    There are several levels of caches.

    • L1 caches are small and extremely fast, located on the CPU chip.
    • L2 caches are larger than L1, slightly slower, and may be located on or near the CPU chip.
    • L3 caches are even larger and slower, shared among multiple CPU cores.
  • Bus Interface Unit – The Bus Interface Unit connects the CPU to the system’s bus, allowing communication with memory and other peripherals. Its role is to manage data transfer between the CPU and other components.

A multi-core processor is a type of central processing unit (CPU) that has two or more independent cores (also known as execution units) integrated into a single silicon chip. Each core can read and execute instructions independently, which allows for parallel processing and improved performance in both multitasking and complex computational tasks.

Multi-core processors offer improved performance and energy efficiency through parallel processing and enhanced multitasking capabilities. However, they require software optimization to fully utilize their potential and can add complexity to programming, with diminishing returns as more cores are added.

Multithreading is a programming and execution model that allows multiple threads to run concurrently within a single process. Each thread represents a separate path of execution, enabling tasks to be performed simultaneously. This is particularly beneficial in applications that require a high level of parallelism, such as web servers, data processing, and real-time systems. By dividing a program into smaller threads, multithreading can significantly enhance the performance and responsiveness of an application. Operating systems and modern CPUs provide built-in support for multithreading, allowing threads to be scheduled and executed efficiently across multiple cores.

The primary advantage of multithreading is the improvement in application performance, particularly in multi-core processors. By enabling parallel execution of tasks, multithreading can reduce the time required to complete complex operations, leading to faster and more efficient programs. This is especially important for applications that perform I/O operations, as threads can handle multiple I/O requests simultaneously, reducing latency and increasing throughput. Additionally, multithreading enhances the responsiveness of applications, as user interface tasks can run in separate threads, allowing the application to remain interactive while performing background operations. However, multithreading also introduces several challenges and potential drawbacks. One major issue is the complexity of writing thread-safe code. Developers must carefully manage shared resources and ensure proper synchronization to avoid race conditions, deadlocks, and other concurrency-related bugs.

AMD Ryzen 7040 Series Mobile Processor (source).

In practice, modern general purpose CPU are defined by other specifications that are listed below:

  • Architecture – CISC (Complex Instruction Set Computing), RISC (Reduced Instruction Set Computing), etc. (e.g., x86, x86-64, ARM, RISC-V).

  • Instruction set – The set of instructions the CPU can execute, often including extensions for specific performance enhancements (e.g., x86-64, AVX, SSE).

  • Base clock speed – The frequency at which the CPU operates under standard conditions, measured in GHz (gigahertz) (e.g., 3.5 GHz, 3.8 GHz).

  • Core count – The number of physical cores in the CPU (e.g., Dual-core, Quad-core, Octa-core).

  • Thread count – The number of concurrent threads the CPU can handle, often influenced by technologies like Hyper-Threading (Intel) or Simultaneous Multithreading (SMT) (AMD) (e.g., 8 threads, 16 threads).

  • Process technology – The fabrication process used to manufacture the CPU, typically measured in nanometers (nm) (e.g., 14nm, 7nm, 5nm, 3nm).

  • TDP (Thermal Design Power) – The amount of heat the CPU is expected to dissipate under maximum load, measured in watts (W) (e.g., 65W, 95W, 125W)

  • Features and technologies – Additional capabilities and technologies supported by the CPU (e.g., Hyper-Threading, Turbo Boost, Virtualization (VT-x/AMD-V), AES-NI).

3.2 — The Memory (RAM)

The von Neumann architecture stipulates a single memory space that holds both data and program instructions. RAM (Random Access Memory) is a crucial component in modern computers and electronic devices. It serves as the primary volatile memory where data and instructions are temporarily stored while a computer is powered on and in operation.

3.2.1 — Characteristics
  • Volatile nature – RAM is volatile, meaning it loses its stored data when the computer is powered off. This characteristic contrasts with non-volatile storage devices like hard drives and SSDs, which retain data even when the power is turned off.

  • Fast access speed – RAM is designed for high-speed data access. It operates at speeds that are orders of magnitude faster than typical storage devices like hard drives or SSDs. This fast access speed is crucial for the smooth and efficient operation of applications and the overall responsiveness of the computer.

  • Temporary storage – RAM serves as temporary storage for data and program instructions that the CPU (Central Processing Unit) needs to access quickly. When you open a program or file, the operating system loads it into RAM so that the CPU can quickly access the necessary data without waiting for slower storage devices.

3.2.2 — Components and architecture

RAM modules are typically integrated into the motherboard of a computer and come in various forms, such as DIMMs (Dual Inline Memory Modules) or SO-DIMMs (Small Outline DIMMs) for laptops and smaller devices.

The architecture of RAM modules includes:

  • Memory cells – These are the smallest units of storage in RAM, usually organized in a grid. Each cell stores a binary digit (bit), and groups of cells store bytes (8 bits) of data.

  • Addressing – RAM is addressed using a memory address, which specifies the location of each byte of data. Modern computers use a system of binary addressing to locate specific memory locations rapidly.

  • Capacity – RAM capacity is measured in gigabytes (GB) or terabytes (TB). The amount of RAM in a computer determines how much data it can store and access simultaneously.

16 GB DDR5-4800 1.1 V UDIMM (source).

3.3 — Storage devices (HDD/SSD)

Storage devices are hardware components used to store and retrieve digital data. In contrast with the RAM, they provide a persistent storage, meaning data remains stored even when the computer is turned off. This is crucial for saving programs, documents, system states, and other important data. They come in various forms and capacities, designed to meet different needs in terms of speed, capacity, and durability.

Here are the primary types of storage devices:

  • Hard Disk Drives (HDDs) – HDDs are traditional storage devices that use spinning magnetic disks to read and write data. They are known for their large storage capacities and relatively low cost per gigabyte. They have the advantages to have high capacity, cost-effective and long lifespan. However, they have drawbacks such as slower read/write speeds compared to solid-state drives, or mechanical parts are prone to failure.

  • Solid-State Drives (SSDs) – SSDs use flash memory to store data, providing faster read/write speeds than HDDs. They have no moving parts, making them more durable and less prone to mechanical failure. They have the advantages to have faster performance, more durable and be energy-efficient. However, they have drawbacks such as higher cost per gigabyte, or limited write cycles.

Three types of storage devices from left to right: a 2.5'' hard drive (source), a 2.5'' SSD drive (source) and a NVMe SSD (source).

3.4 — Motherboard

The motherboard, also known as the mainboard or system board, is the primary circuit board in a computer. It serves as the central hub that houses the CPU, memory, and other essential components. The motherboard also provides connectors for other peripherals and expansion cards.

Here are the key components and features of a motherboard:

  • CPU socket – The slot where the Central Processing Unit (CPU) is installed. Different CPUs require different sockets, which are specific to certain motherboard models.

  • Chipset – A set of integrated circuits that manage data flow between the processor, memory, and peripherals. The chipset is divided into two main components: the Northbridge (handles high-speed communication between the CPU, RAM, and graphics card) and the Southbridge (manages lower-speed peripheral buses such as USB, audio, and hard drives).

    Schematic view of a chipset.
    Information

    Modern CPUs typically integrate functionalities that were traditionally part of the Northbridge directly onto the CPU die itself. This integration is known as a “System-on-Chip” (SoC) design. Overall, the integration of these functionalities onto the CPU die has led to more efficient and compact system design which simplifies motherboard designs and reduces power consumption while improving overall system performance.

  • RAM slots (DIMM slots) – Slots where the computer’s memory (RAM) modules are installed. The number and type of RAM slots can vary depending on the motherboard’s design.

  • Storage connectors – Interfaces for connecting storage devices like hard drives (HDDs) and solid-state drives (SSDs). Common types include SATA ports and M.2 slots for newer SSDs.

  • Expansion slots – Slots for additional cards such as graphics cards, sound cards, network cards, and other expansion cards. The most common type is the PCIe (Peripheral Component Interconnect Express) slot.

  • Power connectors – Connectors that provide power from the power supply to the motherboard and other components. This includes the main 24-pin ATX power connector and additional 4 or 8-pin connectors for the CPU.

  • I/O ports – The back panel of the motherboard contains input/output ports for connecting peripherals like the keyboard, mouse, monitor, USB devices, audio devices, and network cables.

  • BIOS/UEFI chip – A firmware interface that initializes hardware during the boot process and provides runtime services for operating systems and programs. The BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) is stored on a non-volatile memory chip on the motherboard.

  • Heat sinks and cooling solutions – Components that help dissipate heat from critical parts of the motherboard, such as the chipset and VRMs (Voltage Regulator Modules).

  • Connectors and headers – Various connectors for additional case fans, front panel buttons (power, reset), LEDs, and USB ports.

Here is a picture of a motherboard, showing some of the elements insted above:

X570 AORUS PRO ATX motherboard (adapted from source).

3.5 — Peripherals

As shown above, the motherboard includes various ports, slots and connectors that were briefly described. In this section, we will get a little more into details about some of the most used peripherals and their most common connectors.

3.5.1 — Input/Output

Historically there were a lot of specific I/O connectors for different peripherals. For example PS/2 ports used for connecting keyboards and mice to a PC compatible computer system or Serial ports which have largely been replaced with faster standards, mainly USB (see below). Nevertheless, serial ports remain commonly used in applications that require straightforward, low-speed interfaces, such as industrial automation systems, scientific instruments, point-of-sale systems, and certain industrial and consumer products. Finally, we can mention that most modern computers includes what is known as a sound card (often integrated directly on the motherboard). That means that it provides I/O connectors for analog and/or digital sound related peripherals such as speakers or microphones.

Nowadays, most of the I/O ports, apart from the display (see next section) and network ones are USB. USB, or Universal Serial Bus, is a standardized technology for connecting peripheral devices to a computer. It was designed to simplify the process of connecting hardware to a computer by providing a universal interface and eliminating the need for multiple types of connectors and ports.

Here are the key features of USB:

  • Universal compatibility – USB was created to replace various types of serial and parallel ports, offering a standard connector that works across different devices and platforms.

  • Plug and play – USB devices can be connected and disconnected without the need to restart the computer. The operating system automatically detects and configures the new device.

  • Hot swappable – Devices can be connected or disconnected without shutting down the system.

  • Data transfer and power supply – USB provides both data transfer capabilities and power supply to connected devices, which means peripherals can be powered directly through the USB connection.

  • High data transfer rates – USB standards have evolved to support higher data transfer rates, making them suitable for a wide range of applications from simple keyboards to high-speed external storage devices.

USB standards have evolved with time, as can be seen in the following picture:

Evolution of USB standards (source).
3.5.2 — Display

Display peripherals for a PC include a variety of devices that output visual information to the user. The most common display peripheral is the monitor, which can vary in size, resolution, and technology. Modern monitors often use LCD or LED technology, providing high-definition or even 4K resolution for sharp and clear images. Other display peripherals include projectors, which are used to project images or video onto a larger surface, and VR headsets, which offer immersive 3D experiences. Additionally, some PCs might use secondary displays like digital signage or specialized screens for specific applications, such as medical imaging or professional graphic design. The figure below gives a pretty good overview of all the standards that were used and are still used today to display an image on a monitor from analog devices to digital ones.

Multiple display standards compared (source).

These peripherals are connected to the PC through various interfaces, including but not restricted to, HDMI (High-Definition Multimedia Interface, 2002), DisplayPort (2006), DVI (Digital Visual Interface, 1999), or VGA (Video Graphics Array, 1987).

HIS 6670 iSilence 5 1GB DDR3 PCI-E DVI/HDMI/VGA (source).

4 — Wraping up

In this course, we gave a good overview of what is a modern computer from its fundamentals design, its concrete architectures to the physical components that compose it. We also described some of the most used peripherals that allows the user to interact with such a machine. We did not cover every of them obviously, as they range from the general public devices such as mouses, keyboard, headphones to more specialized ones such as Eye-Tracking Devices, Ultrasonic Transducer or Digital Microscopes for example.

It is also important to point out that we just described the physical components of general purpose computers such as personal computers. But there exists a lot more computer form factors for very specific use ranging from your typical smartphone, video game consoles, IoT (Internet of Things) devices, smart-cards, and even to some peripherals themselves such as gaming mouses or noise-cancelling headphones.

Although it is theoretically possible to use these computers by sending binary instructions directly to the CPU, it would be very difficult to use them. To help us with this task, a primary software called the Operating System (OS) acts as an intermediary between users and the computer hardware, providing a user interface and coordinating the execution of applications.

To go further

Important

The content of this section is optional. It contains additional material for you to consolidate your understanding of the current topic.

Looks like this section is empty!

Anything you would have liked to see here? Let us know on the Discord server! Maybe we can add it quickly. Otherwise, it will help us improve the course for next year!

To go beyond

Important

The content of this section is very optional. We suggest you directions to explore if you wish to go deeper in the current topic.

Looks like this section is empty!

Anything you would have liked to see here? Let us know on the Discord server! Maybe we can add it quickly. Otherwise, it will help us improve the course for next year!