Hardware (2)

BUFFER

A buffer is a temporary storage area in memory (RAM) used to hold data while it is being transferred between two devices or processes that operate at different speeds.
Analogy: A buffer is like a queue at a supermarket checkout. Customers (data) arrive faster than the cashier (slow device) can serve them. The queue (buffer) holds customers until the cashier is ready.

Printer Buffer

Aspect

Description

Problem

Printer is slow; CPU is fast

Solution

Print job is sent to a printer buffer

Operation

CPU sends entire document to buffer quickly; printer reads from buffer slowly

Benefit

CPU can continue other work while printer prints


Video Streaming Buffer

Aspect

Description

Problem

Network speed varies; video must play smoothly

Solution

Video data is pre-loaded into a buffer

Operation

Buffer stores several seconds of video before playback begins

Benefit

Prevents buffering/stuttering if network speed drops


Benefits of a buffer

Speed matching

Allows fast and slow devices to work together efficiently

No data loss

Prevents data loss when fast device outpaces slow device

CPU efficiency

CPU can continue working while I/O device catches up

Smooth playback

Prevents buffering/stuttering in streaming media

Batch processing

Allows data to be collected and processed in batches


Drawbacks of a buffer

Drawback

Explanation

Memory usage

Requires additional RAM for temporary storage

Latency

Adds slight delay (data must be stored before processing)

Buffer overflow

If buffer fills up, data may be lost

Buffer underrun

If buffer empties, slow device may stall


ROM AND RAM

Feature

RAM

ROM

Volatility

Volatile — data lost when power is removed

Non-volatile — data retained when power is removed

Read/Write

Read and Write — data can be read from and written to

Read Only — data cannot normally be modified

Purpose

Stores active programs and data currently in use

Stores boot-up instructions (BIOS/UEFI)

Speed

Faster than ROM

Slower than RAM

Capacity

Larger (GBs: 4GB – 128GB)

Smaller (MBs: 2MB – 64MB)

Cost

More expensive per GB

Cheaper per GB

Contents

Changes constantly as programs run

Fixed at time of manufacture

Location

Main memory (system memory)

Main memory (usually on motherboard)

Usage

OS, applications, user data

System startup, firmware, bootstrap loader

Type

Dynamic (DRAM) or Static (SRAM)

Mask ROM, PROM, EPROM, EEPROM


Types of RAM:

Type

Description

DRAM (Dynamic RAM)

  • Needs to be refreshed thousands of times per second; slower but cheaper; used for main memory

  • Consists of transistors and capacitors

  • Higher memory

  • Consumes more power than SRAM

SRAM (Static RAM)

  • Does not need refreshing; faster but more expensive; used for cache memory

  • make use of flip-flops.

  • Can use more power than DRAM when used frequently


Types of ROM:

Type

Description

Mask ROM

Permanently programmed during manufacture; cannot be changed at all

PROM (Programmable ROM)

Can be programmed once by the user (with special hardware)

EPROM (Erasable PROM)

Can be erased with UV light and reprogrammed

EEPROM (Electrically Erasable PROM)

Can be erased and reprogrammed electronically (used for BIOS updates)


Monitoring VS Control System.

System

Definition

Monitoring System

A system that measures and records data from the environment without taking any automatic action to change it

Control System

A system that measures data from the environment and automatically takes action to change or maintain it based on the readings


Aspect

Monitoring System

Control System

Purpose

Observes and records data

Observes AND acts based on data

Action

No automatic action taken

Automatic action taken to maintain/change conditions

Output

Data displayed or logged (e.g., screen, file)

Physical action (e.g., motor, heater, valve)

Feedback loop

No feedback loop

Has a feedback loop

Human involvement

Human must interpret data and decide action

System acts automatically without human intervention