Chap 6 - Rev
Chap 6 - Rev
Chapter 6
File Format
1. MIDI – (Musical Instrument Digital Interface)
A standard adopted by the electronic music industry for controlling devices that produce music, such as synthesisers and
sound cards.
Note: MIDI doesn’t contain any actual music.
Definition:
- Musical Instrument Digital Interface file
- Stores a set of commands / instructions for how the sound should be played
- Does not store the actual sounds
- Data in the file has been recorded using digital instruments
- Specifies when each note plays and stops playing // Specifies key on/off
- Specifies duration of the note
- Specifies volume of the note
- Specifies the type of instrument
Features of MIDI file
- Stores the notes played and not the sound
- Contains instructions/commands for digital instruments
- Played on a digital instrument e.g. synthesiser
- Stores data about notes e.g. pitch byte
- Can be a compressed format
- Can edit individual notes
1
Chapter 6: File Format & Storage
Q: How MP3 retained music quality (3)
- Uses perceptual music shaping
- Removes sounds human ear can’t hear properly
- If two sounds played at same time, softer sound is removed
Q: MP3 file compression reduces the size of a music file by 90%.
(a) A music track is 80 MB in size. Calculate the file size after compression. (1)
100% - 90% = 10%
10/100 × 80 = 8mb
(b) How many MP3 files of the size calculated above could be stored on an 800 MB CD? (1)
800/8 = 100
Note: Both MP3 & MP4 are examples of lossy compression.
2
Chapter 6: File Format & Storage
Q:
Lossy/Lossless Compression
Q: Describe benefits of compressing the file to send it.
- File size is reduced
- so it uses less storage space
- so faster transmission
- so quicker to download
- so uses less bandwidth
1. Lossy Compression
- When decompressed, some detail is lost and file is not exactly like the original.
E.g.
- JPEG: Used to store pictures
- MP3: Used to store sound files
- MP4
Reason: It would make the file smaller than lossless compression / the file would stream faster than lossless
compression. The quality of the video can be reduced but it can still be viewed
Lossy compression on an image file
Benefit: Smaller file size reduces download
3
Chapter 6: File Format & Storage
Lossy compression on an image
- A compression algorithm is used.
- Permanently deleting some data
- Colour depth can be reduced
- Resolution can be reduced
- Less bits will be required for each pixel
4
Chapter 6: File Format & Storage
2. Lossless Compression
- When decompressed the original file is restored with no loss of data
E.g.
- Text File
- Database file
- Program code
Why program code needs to use lossless rather than lossy
- Lossy would remove data
- Lossless does not remove data
- Can be restored to original state otherwise code will not run correctly
Lossless Compression on a text:
- A compression algorithm is used
- The file is restored back to original after decompression // No data loss in the process
- Repeated words are identified and are indexed into a table
- Repeated words are identified and are replaced with their index
- Repeated words are identified and their positions are stored in the table
- Repeated words are identified and the number of times the word appears is stored
Q: Describe how the size of the text file can be reduced (3)
- The file can be compressed
- The compression that is used is lossless
- Use of a compression algorithm
- Repeated words can be indexed
- Repeated word sections (e.g. “OU”) can be replaced by a numerical value
- Convert file to pdf
Describe how lossless compression reduces the file size of the photos.
- A compression algorithm is used
- No data is removed in the compression process
- Repeated pixels are identified and are indexed
- Use RLE
5
Chapter 6: File Format & Storage
Reason to compress sound using lossless
- To provide the highest quality of music file
- The user is able to listen to the original sound file
- No loss of quality for the sound file provided
Drawback of using lossless
Streaming speed may be slower and may affect listening experience
- User may need more bandwidth to stream that could be more expensive
- It would be a larger file size so may take longer to upload
- … so will take up more storage space on webserver
Memory Storage
Q: Difference between Primary and Secondary
– Primary RAM and ROM
– Secondary HDD and SSD
– Primary stores boot up instructions and can hold data whilst being processed
– Secondary stores files/software
6
Chapter 6: File Format & Storage
Primary Storage (RAM/ROM)
Definition:
Primary Storage: Main memory inside a computer directly accessed by the CPU.
1. ROM (Read Only Memory)
- ROM is a non-volatile memory.
- Data in ROM cannot be changed.
- ROM is read only
- ROM is permanent
Application:
- ROM is used to store BIOS
- To store bootstrap
- To store factory settings.
2. RAM (Random Access Memory)
- RAM is a volatile memory.
- RAM is temporary
- Data in RAM can be changed.
- RAM can have read/write operations
Application:
- Store operating system currently in use.
- Store files currently in use.
The role of RAM
- Allows data to be stored so it is directly accessible by the CPU
- Stores data temporarily
- Stores OS currently in use
- Stores data/programs that are currently in use
- Allows multitasking
Secondary Storage (HDD/SSD)
Definition:
SecondaryStorage: Non-volatile memory that is accessed by a device that is part of a computer system/ not directly
accessed by the CPU.
1. HDD (Hard Disk Drive) (Magnetic)
- Storage device has platters
- Platters divided into tracks
- Platter is rotated
- Has a read/write arm that moves across storage media
- Read/writes data using electromagnets
- Uses magnetic fields to control magnetic dots of data
- Magnetic field determines binary value
7
Chapter 6: File Format & Storage
2. SSD (Solid State Drive)
What is meant by SSD
- Solid state drive
- Non-volatile
- Secondary storage
- Flash memory
- Has no moving parts
- Uses transistors and cells that are laid out in a grid
- Uses control gates and floating gates
- Can be NAND/NOR (technology)
- Use EEPROM technology
Operation of SSD
- Data is flashed onto (silicon) chips
- Can use flip-flops
- Uses transistors/control gates/floating gates to control the flow of electrons
- 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
- Writes (and reads) sequentially
Benefit of SSD:
- Less power consumption
- Run cooler
- Data access is faster
- Occupies less physical space/more compact
- More reliable
8
Chapter 6: File Format & Storage
Similarity between HDD and SSD
- They are both non-volatile
- They are both secondary storage // Both not directly accessed by the CPU
- They both have a high capacity of storage
- Both have read and write abilities
Off-line Storage
Definition:
Off-line Storage: Non-volatile memory that can be removed from a computer system.
1. Optical (use laser to read)
(i) CD/DVD
- Red Laser
- Single spiral track
- DVD use dual layer technology
Q: Describe how data is read from a CD/DVD
- Red laser is used.
- Laser shines onto surface of the disk.
- It is rotated to be read.
- Data is represented on the surface using pits and lands.
- Pits and lands represent binary values.
- Pits reflect light back differently.
(ii) DVD-RAM
- Red laser
- Concentric tracks
(iii) Blu-Ray
- Blue laser
- Single Spiral track (1.1 mm)
9
Chapter 6: File Format & Storage
Q: Differences between Blu-ray discs and DVDs
- Blu-ray discs use blue lasers & DVDs use red lasers
- Storage capacity of Blu-ray discs is much higher than standard DVDs
- Blu-ray discs use one polycarbonate layer; DVDs use two layers
– Blu-ray discs have a built-in secure encryption system
10
Chapter 6: File Format & Storage
2. Flash memory (USB Flash memory drive)
- Use solid-state technology e.g. SD card: Use in mobile phone
- Flash memory
Q: A remote-controlled model car contains RAM, ROM and a solid state drive. The car receives radio signals from its
remote control. It can only receive radio signals of a certain frequency. The manufacturer sets this frequency and the
owner cannot change it. The owner of the model car can input their own sequence of movements from an interface
underneath the car.
Describe the purpose of each of the three types of memory supplied with the car. (3)
RAM: - Contains instructions/program/data currently in use
ROM:
- Contains the start-up/bootstrap program
- Contains/stores the setting for frequency
Solid State drive:
- Stores the instructions/program/data (to operate the car)
11