Subtopic Notes
3.3 Data storage
3. Hardware
Primary Memory
The CPU directly accesses primary storage. Some examples include RAM, ROM, Cache Memory
| RAM | ROM |
|---|---|
| Stands for Random Access Memory. | Stands for Read Only Memory |
| Temporary memory | Permanent Memory |
| Volatile1 Memory/Non Persistent | Non Volatile/Persistent2 |
| It is the main internal storage area that a computer uses to run programs and to store data. It is also called read/write memory | It is a built-in computer memory that can be read by a computer but cannot be modified. It is a memory unit that can be only read from |
| Usually bigger in size than ROM | Usually smaller in size than RAM. |
| All programs including the OS needs to be loaded onto RAM before they can run | Holds information for BIOS and boot up the computer system |
Secondary Memory
The CPU does not directly access secondary storage. Examples: HDD, SSD, DVD, Bluray disk. The secondary memories are all non-volatile or persistent. These are necessary for more permanent storage of data
Hard Disk Drive (HDD)
- Have platters whose surfaces are covered with a magnetisable material.
- Platters are mounted on a central spindle and rotated at high speed
- The surface of platters is divided into concentric tracks & sectors, where data is encoded as magnetic patterns
- Each surface is accessed by read/write heads
- Reads/Writes data using electromagnets
- When writing, current variation in the head causes magnetic field variation on the disk
- When reading, magnetic field variation from the disk produces current variation in the read head
- Very slow data access compared to RAM
Solid State Drive (SSD)
- Most use NAND/NOR-based flash memory
- Uses EEPROM technology
- Non Volatile Secondary Storage
- Has no moving parts
- Consist of a grid of columns & rows that has 2 transistors at each intersection
- Stores data by flashing it onto the chips
- Data stored by controlling the flow of electrons through transistors
- The electric current reaches the control gate and flows through to the floating gate to be stored
- When data is stored the transistor is converted from 1 to 0
- Two transistors:
- Floating Gate: stores electrons, and the presence or absence of charge (electrons) represents either 1 or 0
- Control Gate: controls charge (electrons) flow for read/write
- Benefits:
- More reliable
- Lighter
- Low power consumption
- Run much cooler than HDDs
- Very thin
- Data access is faster than HDD
- Quiter
- Drawback:
- Limited longevity
- Expensive
- Storage lower than HDD
Optical disk Reader/Writer
- The disk surface has a reflective metal layer and is spun
- The tracking mechanism moves the laser assembly
- The lens focuses laser onto the disk
- A laser beam shone onto a disk to read/write
- Tracks have sequences of pits and land states on the metallic layer
- When reading, the reflected light from the different states on the track is encoded as bit patterns
- When writing, the laser changes surface to pits and land along the track, corresponding to 1s or 0s
CD/DVD Disks
- Laser (red) light is used to read and write data on the surface of the disk
- A thin layer of metal alloy is used to store data.
- Both systems use a single spiral track that runs from the center of the disk to the edge
- DVD uses Dual-Layering, which increases the storage capacity (two individual recording layers)
Blu-ray Disks
- Uses a blue/violet laser to carry out read-and-write operations
- The wavelength of laser light is less than CD and DVD
- Automatically come with secure encryption (prevent piracy and copyright infringement)
- Used as backup systems
- Faster transfer rate than CD/DVD
- Has single layer of polycarbonate
- Larger Storage capacity compared to CD/DVD
USB (Universal Serial Bus) Flash Memories/ SD (Secure Digital) Card
- Uses NAND or NOR technology
- Transistor are used as control gates and floating gates
- Very small, lightweight, and suitable for transferring files
- Small back-up devices for photo, music
- Solid state, so needs to be treated with care
Cloud Storage:
- A collection of servers storing data in a remote location
| Advantages | Disadvantages |
|---|---|
| File stored in cloud can be accessed anytime anywhere | Depends on internet connection |
| External storage device not required | Expensive if file size is high |
| Back-up system is better | May be less secure |
| If client disk fails, cloud will allow recovery | Reliant on 3rd party for hardware |
| Almost unlimited storage capacity |
Virtual Memory
- Memory that appears to exist as main storage although most of it is supported by data held in secondary storage. It is a paging mechanism that allows a program to use more memory addresses than are available in main memory
- Process split into pages, memory split into frames of same size
- Not all pages of the program need to be initially loaded.
- Pages swapped in/out of memory as required
- No need for all pages to be in memory
- CPU address space is thus larger than physical space
- Addresses resolved by the memory management unit
- Benefits
- Not all of the program has to be in memory at once
- Large programs can be run with or without large physical memory
- Process
- Load all pages on the disk initially
- One/more loaded into memory when process ‘ready’
- Pages replaced from disk when needed
- This can be done with a FIFO queue or usage-statistics-based algorithm
- Disadvantage
- Expensive
- Disk thrashing: Perpetual loading/unloading of pages due to a page from disk immediately requiring the page it replaced.
