bit (b)
(short for binary digit) is the smallest unit of data in a computer. A bit has a single binary value, either 0 or 1.
byte (B)
8 bits
nibble
4 bits / half a byte
bit rate
number of bits transmitted (usually per second)
kibibyte
2^10 bytes (1024)
the hierarchy of bytes
kibi, mebi, gibi, tebi
(kennard, miss jones, gib, truck)
A typical book has about 459 000 characters. Your eReader has half a mebibyte of space left on it. Will a typical book fit in the remaining space? Assume 1 character = 1 byte
459 000 chars = 459 000 bytes
1 MiB =1024 ×1024 bytes
459 000 chars = (459 000)/(1024 × 1024) mebibytes
This is approx. 0.438 MiB, so the book will fit.
compression
reducing large file sizes by repackaging/removing some data
lossy compression (what, how effective, examples)
permanently deletes data
- can reduce up to 90%
- but can never be reconstructed to its original state
for audio files this is removing frequencies outside out of human hearing range
eg JPEG (images), MP3 (sound)
lossless compression (what, how effective, examples)
retains the exact meaning of the original data
done by identifying and removing redundant data (eg if words are used more than once, a lookup table is created and they are converted to tokens pointing to their place in the table)
- can reduce by around 50%
- means file can be reconstructed to original state when decompressed
eg PNG (images), FLAC (audio). ZIP (archiving)