1.3 Data Storage & File Compression


Data Storage

Memory size is actually measured in terms of powers of 2, it's a system which is more accurate has been adopted by the IEC (International Electrotechnical Commission). Internal memories such as RAM & ROM use this.

Name
Value

Nibble

4 bits

Byte

8 bits

1 KB (kilobyte)

1000 bytes

1 MB (megabyte)

1000 KB

1 GB (gigabyte)

1000 MB

1 TB (terabyte)

1000 GB

1 PB (petabyte)

1000 TB

1 KiB (kibibyte)

1024 bytes (2¹º)

1 MiB (mebibyte)

1048576 bytes (2²º)

1 GiB (gibibyte)

1073741824 bytes (2³⁰)


Data Compression

Compressing data is useful as it saves storage space, reduces costs by using less bandwidth, and reduces the time taken to stream or transfer the file. There are two types of data compression:

  1. Lossy

  2. Lossless

Lossy

  • Upon compression, the unnecessary data is deleted

  • Original file cannot be reconstructed

  • Some loss of detail (lower quality in images & sound files)

  • Smaller file size

Sample answer:

Compression algorithm is used Original file cannot be restored Deletes unnecessary data from the file Removes sounds that cannot be heard by the human ear Reduces the sample rate & resolution

Lossless

  • Compresses a file by reducing the size of repeated areas (via RLE & Huffman)

  • RLE (run-length encoding) is used to replace sequences of repeated characters with a code

  • Huffman encoding replaces frequently used characters with shorter codes and the opposite

  • All the data from the original file can be reconstructed

  • No detail is lost

  • Larger file size

Sample answer:

Compression algorithm is used Original file can be restored RLE & Huffman encoding is used Repeated patterns are identified & indexed


Exam Questions


Last updated