Bits and Bytes

 -> Bit -> is the smallest unit of information in computing in digital communications. -> "bit" stands for binary digit. -> a bit can take two values: -> 1 -> 0      -> in networking, speeds are measured using bits per second (bps -> Kbps, Mbps, Gbps), NOT bytes per second. -> measurements -> 1Kbit (kilobit) -> 1,000 bits (10^3 bits) -> 1Mbit (megabit) -> 1,000,000 bits (10^6 bits) -> 1Gbit (gigabit) -> 1,000,000,000 bits (10^9 bits) -> 1Tbit (terabit) -> 1,000,000,000,000 bits (10^12 bits)

-> Byte -> is a grouping of 8 bits -> Bytes, and not bits, are used to measure the size of data on a storage device. -> measurements -> 1KB (kilobyte) -> 1,000 bytes (10^3 bytes) -> 1MB (megabyte) -> 1,000,000 bytes (10^6 bytes) -> 1GB (gigabyte) -> 1,000,000,000 bytes (10^9 bytes) -> 1TB (terabyte) -> 1,000,000,000,000 bytes (10^12 bytes)

-> Converting from/to b to B: -> since a byte contains 8 bits, any number of bits can be converted to bytes by diving by 8. -> same way, any number of bytes can be converted to bits by multiplying by 8. -> Example: -> 1Gb = 1,000,000,000 bits = 1,000,000,000/8 bytes = 125,000,000 bytes = 125,000 KB = 125 MB = 0.125 GB -> 1Gb = 0.125 GB				         -> 0.125 GB x 8 = 1 Gb

-> INFO -> the examples above use base 10 for calculations since the networking field uses base 10 when referencing network speeds -> However, different IT branches may use base 10 or base 2. -> For example, computer memory and storage are calculated using base 2. -> the industry uses the base 10 names and symbols interchangeably when refering to both base 10 and base 2 measurements.

-> the measurements in base 2 are as follows: -> bits -> 1Kibit (kibibit) -> 1,024 bits (2^10 bits) -> 1Mibit (mebibit) -> 1,048,576 bits (2^20 bits) -> 1Gibit (gibibit) -> 1,073,741,824 bits (2^30 bits) -> 1Tibit (tebibit) -> 1,099,511,627,776 bits (2^40 bits)

-> byte -> 1KiB (kibibyte) -> 1,024 bytes (2^10 bytes) -> 1MiB (mebibyte) -> 1,048,576 bytes (2^20 bytes) -> 1GiB (gibibyte) -> 1,073,741,824 bytes (2^30 bytes) -> 1TiB (tebibyte) -> 1,099,511,627,776 bytes (2^40 bytes)

-> Converting from/to b to B in base 2: -> the same rule of multiplication/division by 8 aplies to bit/byte conversions in base 2 as well. -> Example: 1Gibit = 1,073,741,824 bits = 1,073,741,824/8 bytes = 134,217,728 bytes = 131,072 Kib = 128 Mib = 0.125 GiB