Unit 2: Memory and I/O Devices

DCAP101 12 min read

I. Orientation — Computer Memory and Input/Output

A computer receives data through input devices, processes it using the central processing unit (CPU), stores data and instructions in memory, and communicates results through output devices. Memory and input/output (I/O) devices therefore connect users, processors, and stored information.

  • Basic data cycle: Input → processing → storage → output; for example, a keyboard enters text, the CPU processes it, memory stores it, and a monitor displays it.
  • Memory hierarchy: Faster storage is generally smaller and more expensive per byte; CPU registers and cache are faster than RAM, while secondary storage offers greater capacity.
  • Volatility: Volatile memory loses its contents when power is removed; non-volatile memory retains data without continuous power.
  • I/O convention: An input device sends data to the computer, while an output device presents processed data to the user.
  • Performance measures: Memory and devices are compared using capacity, access time, transfer rate, reliability, compatibility, and cost.
  • Interfaces: Devices communicate through connections such as USB, HDMI, DisplayPort, Bluetooth, Wi-Fi, SATA, PCI Express, and Thunderbolt.

II. Computer Memory — Storage Used During and After Processing

Computer memory consists of electronic or physical locations in which data, program instructions, and results are stored. Its role depends on its position in the memory hierarchy and whether it preserves data when power is removed.

A. Types of memory

Computer memory is classified mainly as primary memory and secondary memory.

  • Primary memory: Memory directly accessible by the CPU for current processing.
    • Registers: Tiny, extremely fast locations inside the CPU, such as the program counter.
    • Cache: High-speed SRAM placed on or near the CPU; common levels are L1, L2, and L3.
    • Main memory: Primarily RAM, which holds active programs and data.
    • ROM: Non-volatile memory containing firmware or startup instructions.
  • Secondary memory: Non-volatile storage used for long-term retention, including SSDs, HDDs, flash drives, and optical disks.
  • Volatile memory: Requires power to preserve information; RAM and most cache memory are volatile.
  • Non-volatile memory: Retains information without power; examples include ROM, flash memory, HDDs, and DVDs.
  • Access methods:
    • Random access: Any location can be reached directly, as in RAM.
    • Sequential access: Data is read in order, as with magnetic tape.

B. Units of memory

Memory capacity is measured in bits and bytes, with prefixes indicating larger quantities.

  • Bit (b): The smallest data unit, represented by binary 0 or 1.
  • Byte (B): A group of 8 bits; one byte can represent 256 patterns, from 00000000 to 11111111.
  • Common binary units:
TEXT
1 byte (B) = 8 bits
1 kibibyte (KiB) = 1,024 B
1 mebibyte (MiB) = 1,024 KiB
1 gibibyte (GiB) = 1,024 MiB
1 tebibyte (TiB) = 1,024 GiB
  • Decimal units: Storage manufacturers commonly use 1 kB = 1,000 B, 1 MB = 1,000,000 B, and 1 GB = 1,000,000,000 B.
  • Transfer rate: Measured in units such as MB/s or Gb/s; uppercase B means bytes, while lowercase b means bits.
  • Concrete example: A 16 GiB memory module contains 16 × 1,024³ = 17,179,869,184 bytes.

C. RAM

Random Access Memory (RAM) is volatile primary memory that temporarily holds programs and data currently needed by the CPU.

  • Function: Loading a program from storage into RAM allows the CPU to access it much faster; an open browser and its active tabs occupy RAM.
  • Random access: Each addressed location can be reached directly with broadly similar access time.
  • DRAM: Dynamic RAM stores bits in capacitors and must be refreshed repeatedly; DDR4 and DDR5 are common generations of synchronous DRAM.
  • SRAM: Static RAM uses flip-flop circuits, requires no refresh while powered, and is faster and more expensive; it is commonly used for CPU cache.
  • Capacity: More RAM permits more programs and larger datasets to remain active without using slower virtual memory.
  • Performance: Data rate, latency, channel arrangement, and compatibility with the motherboard affect effective speed.
  • Limitation: Unsaved work in RAM is lost during shutdown or power failure.

D. ROM

Read-Only Memory (ROM) is non-volatile primary memory designed to retain essential instructions when power is absent.

  • Purpose: ROM or related non-volatile firmware storage holds startup code, such as BIOS or UEFI firmware.
  • Persistence: Stored instructions remain available when the computer is switched off.
  • PROM: Programmable ROM can be written once using specialized equipment.
  • EPROM: Erasable Programmable ROM can be erased using ultraviolet light and programmed again.
  • EEPROM: Electrically Erasable Programmable ROM can be erased and rewritten electronically.
  • Flash-based firmware: Modern systems commonly store firmware in flash memory, allowing controlled updates.
  • Contrast with RAM: ROM is non-volatile and mainly stores stable instructions; RAM is volatile and supports frequent reading and writing during normal operation.

III. Secondary Storage — Long-Term Retention of Data

Secondary storage provides high-capacity, non-volatile space for operating systems, applications, documents, media, backups, and archives.

A. Secondary storage devices

Secondary storage devices retain information permanently or until the user deletes or overwrites it.

  • Examples: HDDs, solid-state drives, USB flash drives, memory cards, CDs, DVDs, Blu-ray disks, and magnetic tape.
  • Advantages: Capacities commonly range from gigabytes to terabytes, with lower cost per byte than primary memory.
  • Access: The CPU normally uses data after it has been transferred from secondary storage into RAM.
  • Selection factors: Capacity, transfer speed, portability, durability, expected lifespan, security, and cost.
  • Backup role: External drives and network storage can hold duplicate copies, but one device alone does not constitute a reliable backup strategy.

B. Hard disk drives

A hard disk drive (HDD) stores data magnetically on rotating platters inside a sealed enclosure.

  • Components: Platters, spindle motor, actuator arm, read/write heads, controller board, and cache.
  • Operation: The head reads or changes magnetic patterns while the platter rotates, commonly at 5,400 or 7,200 revolutions per minute.
  • Organization: Data is arranged into tracks and sectors and managed by a file system such as NTFS or ext4.
  • Advantages: HDDs provide high capacities and low cost per gigabyte, making them suitable for bulk storage and backups.
  • Limitations: Mechanical movement creates noise, heat, higher latency, and vulnerability to shock.
  • Comparison with SSDs: HDDs are generally cheaper per gigabyte, whereas SSDs offer faster access and have no moving parts.

C. Flash drives

A flash drive is a portable, non-volatile storage device that uses NAND flash memory and usually connects through USB.

  • Operation: Data is stored as electrical charge in memory cells rather than on moving mechanical parts.
  • Portability: Compact size and plug-and-play operation make flash drives useful for transferring documents and installation files.
  • Interfaces: Common connectors include USB-A and USB-C, with performance influenced by the supported USB generation.
  • Advantages: Flash drives are silent, reusable, shock-resistant, and require no separate power supply.
  • Limitations: Memory cells tolerate a finite number of write/erase cycles, and small drives are easily lost.
  • Security: Sensitive files should be encrypted because ordinary deletion may not prevent data recovery.

D. Optical disks

Optical disks store data as microscopic physical or optical changes that are read by a laser.

  • Examples: Compact Disc (CD), DVD, and Blu-ray Disc.
  • Recording forms: Read-only disks are factory-produced; recordable disks permit one write; rewritable disks permit repeated erasure and recording.
  • Typical capacities: A standard CD stores about 700 MB, while Blu-ray commonly stores 25 GB on one layer.
  • Advantages: Disks are inexpensive to distribute, immune to magnetic fields, and useful for offline media or archives.
  • Limitations: Optical drives are slower than modern flash storage, and scratches or deterioration can cause read errors.

E. DVD

A Digital Versatile Disc (DVD) is an optical disk with greater capacity than a CD, commonly used for video, software, and data.

  • Capacity: A single-layer, single-sided DVD commonly stores 4.7 GB; a dual-layer version commonly stores 8.5 GB.
  • Formats: DVD-ROM is read-only, DVD±R is recordable once, and DVD±RW is rewritable.
  • Reading method: A red laser reads closely spaced marks along a spiral track.
  • Video use: DVD-Video can contain compressed video, multiple audio tracks, subtitles, chapters, and menus.
  • Limitation: Streaming, cloud delivery, and high-capacity flash storage have reduced DVD use, and modern computers may lack optical drives.

IV. Input Devices — Entering Data and Commands

Input devices convert user actions, images, sound, or physical conditions into signals that a computer can process.

A. Keyboard

A keyboard enters text, numbers, shortcuts, and commands through an arrangement of keys.

  • Key groups: Alphanumeric keys, function keys, modifier keys, navigation keys, and a numeric keypad.
  • Operation: Pressing a key closes or changes a switch circuit, and the keyboard controller sends a scan code.
  • Layouts: QWERTY is widely used, while regional layouts modify characters and key positions.
  • Connections: Keyboards may use USB, Bluetooth, or proprietary wireless receivers.
  • Special features: Backlighting, programmable keys, multimedia controls, and mechanical switches support specialized uses.
  • Accessibility: Sticky Keys, on-screen keyboards, and alternative layouts assist users with different physical needs.

B. Mouse

A mouse is a pointing device used to control the graphical pointer and select or manipulate screen objects.

  • Controls: Movement, left-click, right-click, double-click, drag-and-drop, and scroll-wheel actions.
  • Sensing: Optical and laser sensors detect movement across a surface.
  • Resolution: Sensitivity is commonly expressed in dots or counts per inch, such as 800 or 1,600 DPI.
  • Connections: Wired mice commonly use USB; wireless models use Bluetooth or radio-frequency receivers.
  • Alternatives: Trackpads, trackballs, touchscreens, and styluses perform similar pointing functions.
  • Limitation: Prolonged poor wrist posture may cause discomfort, so device placement and ergonomic design matter.

C. Scanner

A scanner captures printed text, photographs, or objects and converts them into digital data.

  • Process: A light source illuminates the original, and CCD or CIS sensors measure reflected light to construct an image.
  • Types: Flatbed, sheet-fed, handheld, film, barcode, and three-dimensional scanners serve different purposes.
  • Resolution: Optical resolution is measured in dots per inch; 300 DPI is often adequate for ordinary documents.
  • Colour depth: Bit depth controls how many colour or brightness values can be represented.
  • OCR: Optical character recognition converts scanned text images into searchable, editable characters.
  • Limitation: Poor alignment, low contrast, stains, or complex layouts can reduce scan and OCR accuracy.

V. Output Devices — Presenting Processed Information

Output devices convert digital results into visible, printed, audible, or physical forms that users can interpret.

A. LCDs

Liquid Crystal Displays (LCDs) create images by controlling light passing through liquid-crystal cells.

  • Structure: An LCD contains a backlight, polarizing filters, liquid-crystal layers, colour filters, and a matrix of pixels.
  • Pixels: Each pixel usually contains red, green, and blue subpixels whose intensities combine to produce colours.
  • Specifications: Resolution, screen size, refresh rate, response time, brightness, and contrast affect display quality.
  • Panel types: IPS panels emphasize colour and viewing angles; TN panels emphasize speed; VA panels provide strong contrast.
  • Advantages: LCDs are thin, lightweight, energy-efficient, and free from the geometric distortion associated with older CRT displays.
  • Limitation: Backlight bleed, restricted contrast, motion blur, or defective pixels may occur.

B. Plotter

A plotter produces large, precise graphics, especially technical drawings, maps, plans, and engineering designs.

  • Traditional operation: Pen plotters moved a physical pen across paper to draw vector lines.
  • Modern operation: Large-format inkjet plotters print computer-aided design drawings, posters, and geographic maps.
  • Precision: Plotters reproduce exact dimensions and continuous lines required in architecture and engineering.
  • Media size: They support paper much larger than ordinary office formats, including A1 and A0 sheets.
  • Limitation: Plotters require substantial space and are more expensive and slower than standard printers for ordinary documents.

C. Printer

A printer produces hard-copy output by placing ink, toner, or another material onto paper or specialized media.

  1. Impact printers:

    • Method: A print head physically strikes an inked ribbon; dot-matrix printers form characters from pin patterns.
    • Use: Their mechanical impact can produce multipart forms.
    • Limitation: They are noisy and generally provide lower print quality.
  2. Non-impact printers:

    • Inkjet: Sprays microscopic ink droplets; suitable for colour images and home use.
    • Laser: Uses a laser, electrostatic drum, toner, and heat-fusing unit; suited to fast, high-volume text printing.
    • Thermal: Uses heat-sensitive paper or transfers pigment from a ribbon, as in receipt and label printers.
  • Measurements: Resolution is measured in DPI, while speed is commonly stated in pages per minute.
  • Running cost: Ink or toner yield, paper use, duplex printing, and maintenance determine cost per page.

VI. Emerging Interfaces — Developments in Human–Computer Interaction

A. Latest I/O devices in the market

Modern I/O devices increasingly use artificial intelligence, spatial sensing, wireless communication, biometrics, and immersive displays.

  • Mixed-reality headsets: Head-mounted systems combine cameras, depth sensors, microphones, speakers, eye tracking, and high-resolution displays for spatial computing.
  • Eye-tracking devices: Infrared sensors estimate gaze direction, enabling hands-free pointer control and accessibility support.
  • Haptic devices: Gloves, controllers, and vests use vibration or force feedback to simulate touch in games, training, and virtual environments.
  • Foldable and flexible displays: OLED-based screens bend or fold, allowing devices to change between compact and expanded layouts.
  • Biometric input: Fingerprint, facial-recognition, iris, and palm-vein sensors authenticate users through physical characteristics.
  • AI-enabled peripherals: Cameras and microphones can perform background removal, noise suppression, subject tracking, and voice processing.
  • 3D printers: These output physical objects layer by layer from digital models using materials such as plastic resin or filament.
  • Wireless trends: Bluetooth Low Energy, Wi-Fi, and low-latency proprietary links reduce cables while supporting keyboards, styluses, earbuds, and controllers.
  • Evaluation factors: Privacy, accessibility, battery life, latency, software compatibility, repairability, and security should be considered alongside novelty.