Data Storage
3.1 Computer Architecture
3.1.1 The Central Processing Unit (CPU)
Definition: The CPU, also known as a microprocessor or processor, is central to all modern computer systems, including tablets and smartphones. It is typically installed as an integrated circuit on a microchip.
Function: Responsible for executing and processing all instructions and data in a computer application.
Components:
Control Unit (CU)
Arithmetic and Logic Unit (ALU)
Registers and Buses
3.1.2 Von Neumann Architecture
Background: Developed in the mid-1940s by John von Neumann. This concept was significant because:
Introduced the idea of a stored-program computer.
Enabled computers to store programs and data directly in memory.
Allowed the CPU to access memory directly.
Key Features:
CPU is central to operation
Memory can store programs and data
Instructions executed in sequential order
Components:
Memory Address Register (MAR)
Program Counter (PC)
Current Instruction Register (CIR)
Memory Data Register (MDR)
Accumulator (ACC)
Buses (Address, Data, Control)
3.1.3 Components of the CPU
Arithmetic & Logic Unit (ALU): Performs arithmetic and logic operations. Possible operations include:
Arithmetic: Addition (+), Subtraction (-), Multiplication (*), Division (/)
Logic: AND, OR, NOT
Control Unit (CU):
Reads instructions from memory.
Stores the address of the instruction in Program Counter (PC).
Utilizes the Fetch–Decode–Execute cycle for instruction interpretation.
Generates control signals via the control bus.
Registers:
Temporary storage locations within the CPU.
Types of registers include:
Current Instruction Register (CIR): Stores the current instruction.
Accumulator (ACC): Temporarily holds data for calculations.
Memory Address Register (MAR): Stores the address of memory being read from or written to.
Memory Data Register (MDR): Holds data being read from memory or to be written.
Program Counter (PC): Points to the next instruction in memory.
3.1.4 System Buses
Types of Buses:
Address Bus: Carries addresses from the CPU to memory, unidirectional. Bus width determines how many memory locations can be accessed.
Example: A 16-bit bus can address locations.
Data Bus: Bidirectional, carries data between the CPU, memory, and input/output devices.
Control Bus: Carries commands from the CU to other components and is usually 8 bits wide.
3.1.5 Fetch–Decode–Execute Cycle
Overview: Sequence of actions performed by the CPU to execute an instruction.
Steps:
Fetch: Retrieve the instruction address from MAR, load instruction into MDR, increment PC.
Decode: Interpret the instruction stored in the CIR.
Execute: Send control signals via the control bus to execute the instruction.
3.1.6 Cores, Cache, and Internal Clock
System Clock: Produces timing signals to synchronize operations. Current clock speed is around 3.5GHz.
Cache Memory: Faster than RAM, stores frequently used data. Larger cache size leads to better performance.
Multi-core CPUs: CPUs with multiple ALUs and control units to handle multiple instructions simultaneously.
3.1.7 Instruction Set
Definition: Set of operations the CPU can perform, consisting of opcodes (operation codes) and operands (data to work with).
Examples: Common instruction sets include X86 used by Intel processors and AMD CPUs.
3.1.8 Embedded Systems
Definition: Hardware and software designed for dedicated functions within larger systems, such as microcontrollers or system-on-chips (SoC).
3.2 Input and Output Devices
3.2.1 Input Devices
Barcode and QR Code Scanners: Convert patterns to digital data. Sensors convert light reflection into binary signals.
Digital Cameras: Capture images through light-sensitive sensors, converting light to digital signals.
Keyboards: Use an ASCII system to convert key presses to digital signals.
3.2.2 Output Devices
Actuators: Perform physical tasks based on computer instructions (e.g., opening a valve).
Printers: Generate hard copies via inkjet (ink spray) or laser (toner) mechanisms.
LED and LCD Screens: Display visual output; LED provides better contrast, while LCD requires a backlight.
3.3 Data Storage
3.3.1 Primary Memory
RAM (Random Access Memory): Volatile, used for active processes.
DRAM: Needs constant refreshing; used for main memory.
SRAM: Faster, no refresh needed; used for CPU cache.
ROM (Read Only Memory): Non-volatile, stores start-up instructions (BIOS).
3.3.2 Secondary Storage
HDD: Magnetic storage with moving parts; high capacity but slower.
SSD: Uses NAND flash memory; no moving parts, faster, and more durable.
Optical: CDs, DVDs, and Blu-ray disks using laser technology.
3.4 Network Hardware
NIC: Allows devices to connect to a network.
MAC Address: Unique hardware identifier (48-bit).
IP Address: Logical address for network identification, can be static or dynamic.
Routers: Direct data packets between different networks.
3.3.4 Virtual Storage (Virtual Memory)
Definition: A feature where the computer uses a part of the hard drive as "extra" RAM. This helps the computer keep working even when its physical RAM is completely full.
The Mechanism (Paging):
When the RAM is full, the operating system looks for data that isn't being used right now (called "pages").
It moves those pages to a temporary spot on the hard drive called a Swap File or Page File.
If you click back into the program that was moved, the computer swaps it back into the RAM and moves something else out.
Benefits:
You can open more programs at the same time than your physical RAM normally allows.
It keeps the computer from crashing or showing "out of memory" errors when you are doing heavy work.
Drawbacks:
Speed: Hard drives and SSDs are much slower than RAM. Using virtual memory makes the computer feel slow or "laggy."
Thrashing: This happens when the computer is so busy moving data back and forth between the RAM and the disk that it stops actually processing your work, causing the system to freeze.
3.3.3 Cloud Storage
Definition: Storing your files on the internet instead of only on your own computer. Your data is kept on many different servers (huge computers) owned and managed by companies like Google, Microsoft, or Amazon.
Operation: You access your files through the internet using an app or website. The storage company handles all the physical hardware and keeps extra copies of your data to keep it safe.
Benefits:
Scalability: You can instantly add more storage space if you run out, or reduce it if you don't need it anymore.
Accessibility: You can get your files from any device (phone, laptop, tablet), anywhere in the world, as long as you have internet.
Reliability: Because your data is saved in multiple places at once, it won't be lost if one server fails.
Drawbacks:
Security: Your data is on someone else’s equipment, which increases the risk of hackers or unauthorized people getting to it.
Connectivity: You must have a working internet connection to see or change your files.
Latency: Opening files from the cloud is usually slower than opening them from your own hard drive because the data has to travel across the internet.