1.6 Computer system architecture
Computer system architecture refers to the design and organization of a computer system’s components and how they interact with each other. It encompasses the structure and functionality of the system, including the CPU, memory, storage, and input/output devices. Here’s an overview of key concepts in computer system architecture:
1. Basic Components
- Central Processing Unit (CPU)
- Control Unit (CU): Directs operations of the CPU by fetching instructions from memory, decoding them, and executing them.
- Arithmetic Logic Unit (ALU): Performs arithmetic and logical operations.
- Registers: Small, fast storage locations within the CPU used to hold data and instructions temporarily.
- Memory
- Primary Memory (RAM): Temporary storage that holds data and instructions currently being used by the CPU.
- Cache Memory: High-speed memory located inside or very close to the CPU to speed up access to frequently used data and instructions.
- Secondary Memory: Non-volatile storage such as hard drives (HDDs) or solid-state drives (SSDs) used for long-term data storage.
- Storage
- Hard Disk Drives (HDDs): Magnetic storage devices used for long-term data storage.
- Solid-State Drives (SSDs): Faster storage devices using flash memory.
- Input/Output (I/O) Devices
- Input Devices: Hardware used to input data into the computer (e.g., keyboard, mouse).
- Output Devices: Hardware used to output data from the computer (e.g., monitor, printer).
- Bus System
- Data Bus: Transfers data between components.
- Address Bus: Carries the addresses of data to and from memory.
- Control Bus: Carries control signals to manage the operations of the CPU and memory.
2. Computer System Models
- Von Neumann Architecture
- Concept: Uses a single memory space to store both data and instructions. Instructions and data are fetched sequentially.
- Components: Includes a CPU, memory, and I/O devices connected through a common bus system.
- Advantages: Simplifies design and programming.
- Disadvantages: Can suffer from the “Von Neumann bottleneck,” where the CPU is slowed down by the time it takes to fetch instructions and data from memory.
- Harvard Architecture
- Concept: Uses separate memory spaces for instructions and data, allowing simultaneous access to both.
- Components: Includes separate memory and buses for instructions and data.
- Advantages: Can improve performance by allowing simultaneous instruction and data access.
- Disadvantages: More complex design and programming.
- Modified Harvard Architecture
- Concept: Combines features of both Von Neumann and Harvard architectures, allowing for some flexibility in memory usage while maintaining separate data and instruction caches.
- Components: Includes separate caches for data and instructions but uses a unified main memory.
- Advantages: Balances performance and complexity, often used in modern processors.
3. System Architecture Models
- Single Processor Systems
- Description: Systems with one CPU handling all tasks.
- Use Cases: Suitable for personal computers and some servers where single-threaded performance is sufficient.
- Multiprocessor Systems
- Description: Systems with multiple CPUs working together to handle tasks.
- Types:
- Symmetric Multiprocessing (SMP): All processors have equal access to memory and I/O.
- Asymmetric Multiprocessing (AMP): One processor (master) controls the system, while others (slaves) perform specific tasks.
- Multicore Systems
- Description: A single CPU chip contains multiple processing cores, allowing for parallel processing.
- Advantages: Improves performance and efficiency by executing multiple tasks simultaneously.
- Clustered Systems
- Description: Multiple independent computers (nodes) connected via a network, working together as a single system.
- Use Cases: High-performance computing (HPC), large-scale data processing, and server farms.
- Distributed Systems
- Description: A network of computers that communicate and coordinate their actions to achieve a common goal.
- Use Cases: Cloud computing, distributed databases, and web services.
4. Performance Metrics
- Clock Speed
- Description: The speed at which a CPU executes instructions, measured in GHz.
- Throughput
- Description: The amount of work a system can perform in a given period, often measured in instructions per second (IPS) or operations per second.
- Latency
- Description: The time it takes for a system to respond to a request or complete an operation.
- Bandwidth
- Description: The amount of data that can be transferred over a bus or network in a given period.
5. Key Architectural Concepts
- Pipelining
- Description: A technique where multiple instruction stages are overlapped to improve processing efficiency.
- Cache Memory
- Description: A small, fast memory located close to the CPU to reduce access time to frequently used data.
- Virtual Memory
- Description: A memory management technique that uses disk space to extend the apparent amount of RAM.
- Instruction Set Architecture (ISA)
- Description: The set of instructions a CPU can execute, defining the CPU’s capabilities and programming model.
1.7 Basic components of a computer system
The basic components of a computer system work together to perform computing tasks.
- Input devices
- Output devices
- CPU and its components
- Memory: RAM, ROM, EPROM, PROM
- Secondary storage device
1.7.1 Input devices
Input devices are hardware components used to enter data and commands into a computer system. They allow users to interact with the computer and provide information for processing. Here’s an overview of common input devices:
1. Keyboard
Function: Allows users to input text, numbers, and commands by pressing keys.
Types:
- Standard Keyboard: Traditional layout with keys for letters, numbers, and functions.
- Ergonomic Keyboard: Designed to reduce strain and improve typing posture.
- Mechanical Keyboard: Features individual mechanical switches for each key, providing tactile feedback and durability.
- Virtual Keyboard: On-screen keyboard used with touchscreens or for accessibility purposes.
2. Mouse
Function: Provides point-and-click navigation and control of the computer interface.
Types:
- Optical Mouse: Uses an optical sensor to detect movement on a surface.
- Laser Mouse: Uses laser technology for more precise tracking and can work on a wider range of surfaces.
- Wireless Mouse: Connects to the computer via Bluetooth or a wireless USB receiver.
- Gaming Mouse: Features additional buttons, adjustable sensitivity, and other enhancements for gaming.
3. Touchpad
Function: A touch-sensitive surface used for navigation and gesture control, often found on laptops.
Features:
- Multi-Touch Support: Allows for gestures such as pinch-to-zoom and swipe.
- Precision Touchpad: Provides enhanced accuracy and customizable gestures.
4. Trackball
Function: Allows users to control the cursor by rotating a ball embedded in the device.
Types:
- Traditional Trackball: Requires users to rotate the ball to move the cursor.
- Ergonomic Trackball: Designed to reduce hand and wrist strain by allowing the hand to remain stationary.
5. Joystick
Function: Provides directional control and is commonly used for gaming and simulation applications.
Types:
- Analog Joystick: Detects the direction and magnitude of movement.
- Digital Joystick: Provides directional inputs with discrete positions.
6. Game Controller
Function: Used for playing video games, providing buttons, joysticks, and triggers for various inputs.
Types:
- Console Controllers: Designed for specific gaming consoles (e.g., Xbox controller, PlayStation controller).
- PC Gamepads: Similar to console controllers but designed for use with PCs.
7. Scanner
Function: Digitizes physical documents and images by converting them into digital formats.
Types:
- Flatbed Scanner: Places documents on a glass surface for scanning.
- Sheet-fed Scanner: Feeds documents through a slot for scanning.
- Handheld Scanner: Allows users to manually scan documents by moving the device over the surface.
8. Digital Camera
Function: Captures images and video that can be transferred to a computer for editing or storage.
Types:
- Webcam: Integrated or external camera used for video conferencing and live streaming.
- DSLR/Mirrorless Camera: High-resolution cameras with advanced features for professional photography.
9. Microphone
Function: Captures audio input, such as voice or sound, and converts it into digital data.
Types:
- Built-in Microphone: Integrated into laptops, tablets, or smartphones.
- External Microphone: Can be USB or analog, used for higher quality audio recording.
10. Touchscreen
Function: Allows users to interact directly with the display by touching the screen.
Types:
- Resistive Touchscreen: Uses pressure to register touch.
- Capacitive Touchscreen: Uses electrical properties to detect touch and supports multi-touch gestures.
1.7.2 Output devices
Output devices are hardware components that communicate information from the computer to the user, translating processed data into a form that can be easily understood, whether visually, audibly, or physically. Here are some key output devices:
1. Monitor
Function: Displays visual output from the computer, including text, images, videos, and graphical interfaces.
Types:
- LCD (Liquid Crystal Display): Common in modern displays, known for energy efficiency and thin profiles.
- LED (Light Emitting Diode): A type of LCD screen that uses LED backlighting for better contrast and brightness.
- OLED (Organic LED): Provides better image quality with deeper blacks and more vibrant colors.
- Touchscreen Monitor: Functions both as an input and output device, allowing users to interact directly with the display.
Resolution: Higher resolution monitors (e.g., 1080p, 4K) provide clearer, sharper images, essential for tasks like graphic design, which might be of particular interest to you.
2. Printer
Function: Produces physical copies (hard copies) of digital documents, images, or graphics.
Types:
- Inkjet Printer: Sprays tiny droplets of ink onto paper. Suitable for home and small offices due to its affordability and versatility.
- Laser Printer: Uses laser technology to produce high-quality text and graphics. Ideal for fast, high-volume printing, often used in office environments.
- 3D Printer: Creates three-dimensional objects by layering material based on a digital model. Useful for design, prototyping, and creative projects.
3. Speakers
Function: Convert digital audio signals into sound, allowing users to hear music, voice, or other audio content.
Types:
- External Speakers: Provide high-quality sound, often used in home offices or entertainment systems.
- Built-in Speakers: Found in laptops, monitors, and all-in-one PCs. While convenient, they typically offer lower sound quality compared to external speakers.
- Wireless Speakers: Bluetooth or Wi-Fi enabled, offering convenience and flexibility for users who prefer a cable-free setup.
4. Headphones
Function: Provide personal audio output, allowing users to hear sound without disturbing others.
Types:
- Wired Headphones: Connect to a computer or device via a standard 3.5mm jack or USB port.
- Wireless Headphones: Use Bluetooth to connect, offering mobility and convenience.
- Noise-Cancelling Headphones: Ideal for reducing ambient noise, improving focus during work or study sessions.
5. Projector
Function: Projects visual content from a computer onto a larger screen or surface, making it ideal for presentations, meetings, or entertainment.
Types:
- DLP (Digital Light Processing): Provides high-quality, sharp images, often used in offices or educational settings.
- LCD Projector: Uses liquid crystal display technology for bright, vibrant images.
- LED Projector: A smaller, energy-efficient projector that uses LED lights for illumination.
6. Plotter
Function: A specialized output device used to produce large-scale graphics, drawings, and maps, commonly used in engineering, architecture, and design.
Types:
- Drum Plotter: Paper moves on a drum while pens draw the image.
- Flatbed Plotter: The paper remains stationary, and the pens move over the surface to create the drawing.
7. Head-Mounted Display (HMD)
Function: A wearable device that provides immersive visual and auditory output, often used in virtual reality (VR) applications.
Use Cases: HMDs are becoming more prevalent in gaming, design simulations, and educational training, offering a unique way to experience virtual environments.
8. Braille Display
Function: A tactile display that converts text into Braille, allowing visually impaired users to read digital text through touch.
Use Case: Essential for accessibility, enabling users to interact with computers without relying on visual output.
9. Virtual Reality (VR) Headset
Function: Immerses users in a virtual environment by providing 360-degree video output and interactive audio.
Use Case: VR headsets are widely used in gaming, simulation training, and even design applications where immersive visual experiences are required.
1.7.3 CPU and its components
The Central Processing Unit (CPU) is the heart of a computer system, responsible for executing instructions and processing data. It performs the basic operations necessary for running software and managing hardware. Here’s a detailed look at the CPU and its key components:
1. Central Processing Unit (CPU)
Function: The CPU executes instructions from programs by performing basic arithmetic, logical, control, and input/output operations.
2. Components of the CPU
2.1. Control Unit (CU)
- Function: Directs the operations of the CPU by fetching instructions from memory, decoding them, and executing them. It controls the flow of data between the CPU and other components.
- Tasks:
- Instruction Fetch: Retrieves instructions from memory.
- Instruction Decode: Interprets the fetched instruction to determine the required operation.
- Instruction Execution: Directs the ALU or other components to perform the required operations.
2.2. Arithmetic Logic Unit (ALU)
- Function: Performs arithmetic (addition, subtraction, multiplication, division) and logical operations (AND, OR, NOT) on data.
- Tasks:
- Arithmetic Operations: Executes basic mathematical operations.
- Logical Operations: Performs logical comparisons and bitwise operations.
2.3. Registers
- Function: Small, fast storage locations within the CPU that hold data, instructions, and addresses temporarily during processing.
- Types:
- Accumulator (ACC): Stores intermediate results of arithmetic and logic operations.
- Program Counter (PC): Keeps track of the address of the next instruction to be executed.
- Instruction Register (IR): Holds the current instruction being executed.
- Status Register (SR): Contains flags or status bits that indicate the result of operations (e.g., zero, carry, overflow).
2.4. Cache Memory
- Function: High-speed memory located inside or close to the CPU to store frequently accessed data and instructions, reducing the time needed to fetch them from main memory.
- Levels:
- L1 Cache: Closest to the CPU cores, fastest, and smallest.
- L2 Cache: Larger and slightly slower than L1, but still close to the CPU cores.
- L3 Cache: Shared among multiple CPU cores, larger and slower compared to L1 and L2, but still faster than main memory.
2.5. Bus Interface Unit (BIU)
- Function: Manages the communication between the CPU and other system components (e.g., memory, I/O devices) through the system bus.
- Tasks:
- Address Bus: Carries the address of the data to be read or written.
- Data Bus: Transfers the actual data being read or written.
- Control Bus: Sends control signals to manage operations (e.g., read/write commands).
2.6. Execution Unit (EU)
- Function: Executes the instructions fetched by the Control Unit and performs operations using the ALU and other components.
- Tasks:
- Instruction Execution: Carries out the operations as specified by the instructions.
- Data Handling: Manages data transfer between registers and memory.
3. CPU Performance Factors
- Clock Speed: Measured in GHz, it indicates how many cycles per second the CPU can perform. Higher clock speeds generally mean faster processing.
- Number of Cores: Modern CPUs have multiple cores, allowing them to perform multiple tasks simultaneously. More cores can improve multitasking and performance in multi-threaded applications.
- Hyper-Threading / Simultaneous Multi-Threading (SMT): Technologies that allow a single core to handle multiple threads of execution, improving efficiency and performance.
- Cache Size: Larger cache sizes can improve performance by reducing the time needed to access frequently used data.
4. CPU Architecture
- Instruction Set Architecture (ISA): Defines the set of instructions the CPU can execute, such as x86, x86-64, ARM.
- Pipelining: Technique where multiple instruction stages are overlapped to improve processing efficiency.
- Out-of-Order Execution: Allows the CPU to execute instructions in an order different from the original sequence to improve performance and efficiency.
1.7.4 Memory: RAM, ROM, EPROM, PROM
Memory in a computer system plays a crucial role in storing data and instructions required for processing tasks. Here’s an overview of the various types of memory:
1. Random Access Memory (RAM)
Function: Temporary, volatile memory used to store data and instructions that the CPU is currently processing.
Characteristics:
- Volatile: Loses its data when the power is turned off.
- Speed: Fast access times compared to most other storage types.
- Types:
- DRAM (Dynamic RAM): Requires regular refresh cycles to maintain data. Used for main memory in computers.
- SRAM (Static RAM): Faster and more expensive than DRAM. Used for cache memory due to its speed and lack of need for refresh cycles.
Usage:
- System RAM: Used by the operating system and applications to store data that is actively being used or processed.
- Graphics RAM (VRAM): Specialized RAM used in graphics cards to store image data and textures.
2. Read-Only Memory (ROM)
Function: Non-volatile memory used to store firmware or software that is not intended to be modified frequently.
Characteristics:
- Non-Volatile: Retains data even when the power is off.
- Speed: Typically slower than RAM but faster than some forms of secondary storage.
Types:
- PROM (Programmable ROM): Can be programmed once by the user or manufacturer. After programming, the data cannot be modified.
- EPROM (Erasable Programmable ROM): Can be erased and reprogrammed multiple times using ultraviolet (UV) light. Used for applications where updates are occasionally needed.
- EEPROM (Electrically Erasable Programmable ROM): Can be erased and reprogrammed electrically, allowing for updates without removing the chip from the circuit. Often used for storing configuration settings and firmware.
3. Programmable Read-Only Memory (PROM)
Function: A type of ROM that can be programmed once by the user or manufacturer.
Characteristics:
- Non-Volatile: Retains its data without power.
- One-Time Programmable: Once programmed, the data cannot be changed.
- Usage: Often used for firmware or applications where the data needs to be fixed and secure.
4. Erasable Programmable Read-Only Memory (EPROM)
Function: A type of ROM that can be erased and reprogrammed multiple times using UV light.
Characteristics:
- Non-Volatile: Retains data without power.
- Erasable: Data can be erased by exposing the chip to UV light, allowing it to be reprogrammed.
- Reprogramming: Requires removal from the circuit for erasure and reprogramming.
- Usage: Suitable for applications where updates are needed occasionally.
5. Electrically Erasable Programmable Read-Only Memory (EEPROM)
Function: A type of ROM that can be erased and reprogrammed electrically, allowing for updates without removing the chip.
Characteristics:
- Non-Volatile: Retains data without power.
- Electrically Erasable: Can be erased and reprogrammed in-circuit, making it more convenient than EPROM.
- Usage: Often used for storing system configurations, calibration data, and firmware in devices.
1.7.5 Secondary storage device
Secondary storage devices are used to store data and programs persistently, allowing for long-term storage and retrieval even when the computer is turned off. Unlike primary storage (RAM), secondary storage is non-volatile and is used for holding data permanently or for extended periods. Here’s an overview of common secondary storage devices:
1. Hard Disk Drive (HDD)
Function: Magnetic storage device used for large-scale data storage.
Characteristics:
- Technology: Uses spinning disks (platters) coated with a magnetic material and read/write heads to store and retrieve data.
- Capacity: Generally offers large storage capacities at relatively lower costs compared to SSDs.
- Speed: Slower than SSDs due to mechanical movement.
- Usage: Common in desktop PCs, laptops, and servers for storing operating systems, applications, and user data.
2. Solid-State Drive (SSD)
Function: Flash-based storage device offering faster data access and improved performance.
Characteristics:
- Technology: Uses NAND flash memory to store data electronically, without moving parts.
- Speed: Much faster read and write speeds compared to HDDs, resulting in quicker boot times and file transfers.
- Capacity: Available in various capacities, often with higher costs per gigabyte compared to HDDs.
- Usage: Commonly used in modern laptops, desktops, and servers for improved performance and reliability.
3. Optical Disc
Function: Storage medium that uses laser technology to read and write data.
Types:
- CD (Compact Disc): Used for storing music, software, and data up to 700 MB.
- DVD (Digital Versatile Disc): Higher capacity than CD, used for storing movies and data up to 4.7 GB (single-layer) or 8.5 GB (dual-layer).
- Blu-ray Disc: Higher capacity than DVD, used for high-definition video and data storage up to 25 GB (single-layer) or 50 GB (dual-layer).
Characteristics:
- Technology: Data is read by a laser and written to the disc using laser technology.
- Usage: Commonly used for media distribution and data backup.
4. USB Flash Drive
Function: Portable storage device that connects to computers via a USB port.
Characteristics:
- Technology: Uses NAND flash memory for storage, making it small, durable, and easy to use.
- Capacity: Available in various sizes, typically ranging from a few gigabytes to several terabytes.
- Speed: Generally fast read and write speeds, with performance depending on the USB standard (e.g., USB 2.0, USB 3.0, USB 3.1).
- Usage: Used for transferring files, data backup, and portable storage.
5. External Hard Drive
Function: Similar to internal HDDs or SSDs but housed in an external enclosure for portability and ease of connection.
Characteristics:
- Technology: Can be either HDD or SSD, connected via USB, Thunderbolt, or eSATA.
- Capacity: Available in large capacities, suitable for backups and large data storage.
- Usage: Commonly used for data backup, transferring large files, and expanding storage capacity.
6. Network Attached Storage (NAS)
Function: A dedicated storage device connected to a network, allowing multiple users to access and share data.
Characteristics:
- Technology: Contains one or more hard drives and connects to a network via Ethernet.
- Capacity: Can be configured with multiple drives, often with RAID support for redundancy.
- Usage: Used for centralized data storage, backup, and file sharing within a network.
7. Tape Drive
Function: Uses magnetic tape for long-term data storage and backup.
Characteristics:
- Technology: Data is stored sequentially on magnetic tape cartridges.
- Capacity: Can store large amounts of data, often used for archival purposes.
- Speed: Slower access times compared to disk-based storage, but cost-effective for large volumes of data.
- Usage: Commonly used for enterprise backups and data archiving.
8. Memory Card
Function: Portable storage medium used primarily in cameras, smartphones, and other portable devices.
Types:
- SD (Secure Digital): Commonly used in cameras and other devices, available in standard, high-capacity (SDHC), and extended-capacity (SDXC) formats.
- microSD: Smaller version of SD cards, used in smartphones and tablets.
- CF (CompactFlash): Used in professional cameras and other devices.
Characteristics:
- Technology: Uses NAND flash memory for storage.
- Capacity: Available in various sizes, typically ranging from a few gigabytes to several terabytes.
- Usage: Provides portable storage for media files and data.
9. Cloud Storage
Function: Online storage service that allows data to be stored and accessed over the internet.
Characteristics:
- Technology: Data is stored on remote servers managed by cloud storage providers.
- Capacity: Scalable, with various pricing tiers based on storage needs.
- Usage: Provides backup, file sharing, and remote access to data from any internet-connected device.