Introduction to Computers

Computer

A computer is an electronic device that manipulates information, or data. It has the ability to store, retrieve, and process data. You may already know that you can use a computer to type documents, send email, play games, and browse the Web. You can also use it to edit or create spreadsheets, presentations, and even videos.

1. History and Generations of Computers

The evolution of computers is generally categorized into five generations, each characterized by a major technological development that fundamentally changed the way computers operate.

The Five Generations of Computers

  • 1st Generation (1940-1956) - Vacuum Tubes: Used vacuum tubes for circuitry and magnetic drums for memory. They were massive, expensive, generated a lot of heat, and relied on machine language. Example: ENIAC, UNIVAC.
  • 2nd Generation (1956-1963) - Transistors: Replaced vacuum tubes with transistors, making computers smaller, faster, cheaper, and more reliable. Assembly languages were introduced.
  • 3rd Generation (1964-1971) - Integrated Circuits (ICs): Transistors were miniaturized and placed on silicon chips (semiconductors), drastically increasing speed and efficiency. Keyboards and monitors emerged as input/output devices.
  • 4th Generation (1971-Present) - Microprocessors: Thousands of integrated circuits were built onto a single silicon chip (the CPU). This era saw the development of personal computers (PCs), the internet, and graphical user interfaces (GUIs).
  • 5th Generation (Present and Beyond) - Artificial Intelligence: Based on AI and machine learning, utilizing parallel processing and quantum computation to simulate human intelligence.

1.1 Types of Computers

Computers can also be classified based on their size, capabilities, and data handling techniques.

Classification by Size and Power

  • Supercomputers: The most powerful and fastest computers, used for complex computations like weather forecasting and quantum mechanics.
  • Mainframe Computers: Large, powerful systems used primarily by large organizations for bulk data processing, such as enterprise resource planning and transaction processing.
  • Minicomputers: Mid-sized computers that fall between mainframes and microcomputers in terms of size and power, often used as departmental servers.
  • Microcomputers: Small, inexpensive computers with a microprocessor as their central processing unit (CPU). Examples include personal computers (PCs), laptops, and smartphones.
Key Takeaways
  • The evolution of computers is marked by a shift from bulky vacuum tubes to microscopic integrated circuits and AI.
  • Each generation brought significant improvements in size, speed, cost, and reliability.
  • Computers are classified by size and power into Supercomputers, Mainframes, Minicomputers, and Microcomputers.

2. Hardware vs. Software

A computer system consists of two major elements: hardware and software.

2.1 Computer Hardware

Hardware is any physical part of the computer, which includes the internal components and the external parts like the monitor and keyboard.

Key Hardware Components

  • Central Processing Unit (CPU): The 'brain' of the computer that performs instructions and calculations. Physically, it's a small silicon chip filled with billions of microscopic transistors.
  • Memory (RAM): Random Access Memory stores data currently being used by the CPU for quick access. This memory is volatile, meaning data is lost when the power goes out.
  • Storage (HDD/SSD): Hard Disk Drives (magnetic spinning disks) or Solid State Drives (flash memory) store data permanently, holding the OS, files, and applications.
  • Motherboard: The main printed circuit board (PCB) that holds the CPU, RAM, and other components, providing the electronic connections for them to communicate.
  • Input Devices: Devices used to provide data and control signals (e.g., Keyboard, Mouse, Scanner).
  • Output Devices: Devices used to display or output data (e.g., Monitor, Printer, Speakers).

2.2 Computer Software

Software is any set of instructions that tells the hardware what to do and how to do it.

Types of Software

  • System Software: Software designed to run the computer's hardware and application programs (e.g., Operating Systems like Windows, macOS, Linux).
  • Application Software: Software designed to perform specific tasks for the user (e.g., Word Processors, Web Browsers, Games).
  • Utility Software: Programs that manage, maintain, and control computer resources (e.g., antivirus programs, disk defragmenters).
Key Takeaways
  • Hardware consists of the physical, tangible components of a computer (e.g., CPU, RAM, HDD).
  • Software represents the intangible instructions and programs that tell the hardware what to do.
  • System software runs the hardware (like the OS), while application software performs specific tasks for the user.

3. Detailed CPU Architecture

The Central Processing Unit (CPU) is a complex piece of hardware responsible for executing the instructions of a computer program. At a university level, we understand CPU architecture through the foundational Von Neumann model.

3.1 Von Neumann Architecture

Proposed by John von Neumann in 1945, this describes a design architecture for an electronic digital computer. The core concept is the stored-program concept, where both program instruction data and computation data are stored in the same memory.

Key Components of Von Neumann Architecture

  • Central Processing Unit (CPU): Contains the ALU and Control Unit.
  • Main Memory unit: Stores both data and instructions.
  • Input/Output devices: Interfaces for communication with the outside world.
  • Buses: Communication systems that transfer data between components (Data Bus, Address Bus, Control Bus).

Internal Components of a CPU

  • Arithmetic Logic Unit (ALU): Performs all arithmetic calculations (addition, subtraction) and logical operations (AND, OR, NOT).
  • Control Unit (CU): Directs the operation of the processor. It tells the memory, ALU, and input/output devices how to respond to program instructions.
  • Registers: Small, high-speed storage locations within the CPU used to temporarily hold data and instructions being processed. Examples include the Program Counter (PC) and Instruction Register (IR).
  • Cache Memory: A smaller, faster memory located closer to a processor core, which stores copies of the data from frequently used main memory locations.

3.2 The Machine Cycle

The CPU processes instructions through a continuous loop known as the Machine Cycle (or Fetch-Decode-Execute cycle).

Procedure

  1. Fetch: The Control Unit retrieves the next instruction from the main memory (RAM). The Program Counter (PC) holds the address of this instruction.
  2. Decode: The Control Unit translates the instruction into a format that the ALU can understand, breaking it into an opcode and operands.
  3. Execute: The ALU performs the required calculation or logical operation.
  4. Store: The result of the execution is written back to a CPU register or main memory.
Key Takeaways
  • The Von Neumann architecture established the stored-program concept, where data and instructions share the same memory space.
  • The CPU comprises the ALU (for calculations), CU (for control flow), and Registers (for temporary fast storage).
  • The Machine Cycle constantly repeats four steps: Fetch, Decode, Execute, and Store.

4. The Memory Hierarchy

Computer systems use a hierarchy of memory types to balance speed, cost, and capacity. As you move down the hierarchy, access time increases (slower), but cost per bit decreases and capacity increases.

Memory Hierarchy Levels (Fastest to Slowest)

  • 1. CPU Registers: Located directly inside the CPU; extremely fast, extremely low capacity.
  • 2. Cache Memory (L1, L2, L3): High-speed SRAM located on or very close to the CPU chip. Acts as a buffer between the CPU and main memory.
  • 3. Primary Memory (RAM): Main volatile memory. Slower than cache but larger capacity. Holds data for active programs. Uses DRAM technology.
  • 4. Secondary Storage (SSD, HDD): Non-volatile, permanent storage. Much slower but offers massive capacity for long-term data retention.
  • 5. Tertiary/Offline Storage: Archival storage like magnetic tape or optical disks; very slow, very cheap, used for backups.
Key Takeaways
  • The memory hierarchy is a trade-off between speed and capacity/cost.
  • Registers and Cache are the fastest but smallest, while SSDs/HDDs are slower but provide massive permanent storage.

5. Number Systems

Computers communicate and store data using number systems. While humans typically use the Decimal (Base 10) system, computers primarily use Binary (Base 2).

Number System

A Number System is a way to represent numbers. The most common systems in computing are Binary, Octal, Decimal, and Hexadecimal.

5.1 Common Number Systems

Common Number Systems

  • Binary (Base 2): Uses only two digits: 0 and 1. This is the fundamental language of computers.
  • Octal (Base 8): Uses digits from 0 to 7. It serves as a shorthand for binary, grouping bits into sets of 3.
  • Decimal (Base 10): The standard system used by humans, using digits 0 to 9.
  • Hexadecimal (Base 16): Uses digits 0-9 and letters A-F. It is widely used in programming and memory addressing because it is much more compact than binary, grouping bits into sets of 4.

Hexadecimal Notation

In Hexadecimal, A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15.

Why do computers use Binary?

Computers are made of billions of tiny switches (transistors) that can only be in one of two physical states: ON (represented as logic 1) or OFF (represented as logic 0). Binary is the most efficient and reliable way to map to these physical states.

5.2 Interactive Converter

Use the tool below to see how numbers are represented across different systems.

Number System Converter

Key Takeaways
  • Computers fundamentally operate using the Binary (Base 2) system, relying on the physical ON (1) and OFF (0) states of transistors.
  • Other common number systems include Decimal (Base 10) for human interaction and Hexadecimal (Base 16) for compact memory representation.
  • Converting between number systems is essential for understanding how computers process and store human-readable data.

6. Logic Gates and Boolean Algebra

Logic gates are the basic building blocks of any digital system. They are electronic circuits having one or more than one input and only one output. The relationship between the input and the output is based on a certain logic, which can be described algebraically using Boolean algebra.

Fundamental Logic Gates

  • AND Gate: Output is TRUE (1) only if ALL inputs are TRUE (1). Boolean expression: Y=ABY = A \cdot B
  • OR Gate: Output is TRUE (1) if AT LEAST ONE input is TRUE (1). Boolean expression: Y=A+BY = A + B
  • NOT Gate (Inverter): Output is the INVERSE of the input. If input is 1, output is 0, and vice versa. Boolean expression: Y=AY = \overline{A}
  • XOR Gate (Exclusive OR): Output is TRUE (1) if inputs are DIFFERENT. Boolean expression: Y=ABY = A \oplus B
  • NAND and NOR Gates: Universal gates, created by adding a NOT to AND/OR, from which any other logic gate can be constructed.

6.1 Interactive Logic Simulator

Experiment with different gates and inputs to understand their truth tables.

Logic Gate Simulator

Input A
Input B
AND
Output
0 (False)
Key Takeaways
  • Logic gates are the fundamental building blocks of digital circuits, performing basic logical functions.
  • Common gates include AND (true if all inputs are true), OR (true if any input is true), and NOT (inverts the input).
  • Complex logic and computation are built by combining these basic electronic gates, which implement operations defined in Boolean algebra.

7. Operating Systems (OS) Basics & The Boot Process

An Operating System (OS) is the most important system software that runs on a computer. It acts as an intermediary between the user of a computer and the computer hardware. It manages the computer's memory and processes, as well as all of its software and hardware.

The Necessity of an OS

Without an operating system, a computer is useless. It bridges the gap between the user/applications and the hardware, providing a convenient and efficient environment.

7.1 Types of Operating Systems

Common OS Categories

  • Batch Operating System: Jobs with similar needs are batched together and executed sequentially. User does not interact with the computer directly.
  • Time-Sharing/Multitasking OS: Allows multiple users or programs to share computer resources simultaneously by allocating short time slices to each process.
  • Distributed Operating System: Manages a group of independent computers and makes them appear to be a single computer.
  • Real-Time Operating System (RTOS): Used in environments where a large number of events must be accepted and processed in a very short time or within certain deadlines (e.g., medical imaging systems, industrial control systems).

7.2 The Boot Process

Before the OS can run, the computer must initialize its hardware. This is the boot process:

Procedure

  1. Power On: Power is supplied to the motherboard and components.
  2. POST (Power-On Self-Test): The BIOS/UEFI checks if crucial hardware (RAM, CPU, Keyboard) is present and functioning.
  3. Locate Boot Device: The BIOS searches for a bootable device (like the primary SSD or HDD) based on the configured boot order.
  4. Load Bootloader: The bootloader program located on the Master Boot Record (MBR) or EFI System Partition is executed.
  5. Load OS Kernel: The bootloader loads the core of the Operating System (the kernel) into RAM.
  6. OS Takes Control: The OS kernel starts background services (daemons), initializes drivers, and presents the user interface.

7.3 Key Functions of an OS

Core Functions

  • Process Management: Creating, scheduling, and terminating processes, allocating CPU time via scheduling algorithms.
  • Memory Management: Managing RAM usage, keeping track of which parts of memory are currently being used and by whom, allocating and deallocating memory space as needed.
  • File Management: Organizing data into logical files and directories on storage drives, managing free space, and handling access controls.
  • Device Management: Controlling peripherals (printers, keyboards, disk drives) via device drivers, handling I/O requests.
  • Security & Protection: Protecting data from unauthorized access, managing user permissions, and ensuring processes do not interfere with each other.
Key Takeaways
  • An Operating System is critical system software that manages computer hardware, software resources, and provides common services for programs.
  • Different types of OS exist for different needs, including Time-Sharing and Real-Time systems.
  • The boot process (POST, Bootloader, Kernel Load) is necessary to initialize hardware and load the OS into memory.
  • Key OS functions include process scheduling, memory allocation, file organization, device control, and system security.

Summary

Key Takeaways
  • A computer system comprises Hardware (physical parts) and Software (instructions). They are categorized by size into Supercomputers, Mainframes, Minicomputers, and Microcomputers.
  • Computer evolution progressed from vacuum tubes to modern microprocessors and AI.
  • Modern computers are based on the Von Neumann Architecture, utilizing a stored-program concept.
  • The CPU processes data via the Fetch-Decode-Execute cycle using the ALU, CU, and Registers.
  • The Memory Hierarchy optimizes speed and storage capacity, ranging from fast CPU registers to large secondary storage.
  • Binary (Base 2) is the native language of computers, physically represented by transistor states and manipulated by Logic Gates (AND, OR, NOT).
  • The Operating System manages all hardware and software resources, loaded into memory via a sequential boot process.