binary is the system used by computers to store and process data, it utilises billions of switches turned either 'on' or 'off' to represent 1's and 0's
each individual digit is referred to as a bit and 8 bits make up a byte
the combination of available values is determined by 2^n where
n = the number of bits being used.
(the highest number available is 2^n-1 )
eg 8 bit = 256 combinations, 255 numbers
prefixes
Tera (TB) -> x10^12 bytes
Giga (GB) -> x10^9
Mega (MB) -> x10^6
Kilo (KB) -> x10^3 eg 7000 B = 7 TB
kibi (KiB) -> 2^10bytes
mebi (MiB) -> 2^20 eg 50000000 B = 47.68371582 (50000000/2^20)
gibi (GiB) -> 2^30
tebi (TiB) -> 2^40
character sets
ASCII
-> a 7 bit (as the 8th was often used as a parity bit) character set that stores 2^7 possible codes for encoding symbols in the english language
->An ASCII digit is not the same as its direct binary translation
UNICODE
-> 16 or 32 bit character set that standardises the encoding of characters across different languages (the first 128 match with ASCII)
->represents a wide range of characters including different languages, mathematical symbols and emojis.
->occupies more space and is more demanding on memory than ASCII.
errors in transmission
errors can corrupt the order and state of bits that have been transmitted this can be due to:
electrical interference, power surges, synchronisation issues, or cable wear and tear
to stop this we use various error checking methods such as:
parity bits
check digits
check sums
majority voting
(they don't allow for errors to be corrected, only identified. A request for the data to be resent must be carried out)
Parity bits
An extra bit is added to the data, this is either a 1 or 0 .
The parity can be odd or even and refers to whether the total number of 1's or 0's in the byte is odd or even
eg 01001101
the initial 0 is the parity bit and makes the total number of 0's 4
(even parity)
it is set at the transmitting computer and checked by the recieving device. It is not always correct two bits may be corrupted (eg 01001101 -> 01101001) their is still 4 0's so the parity looks correct.
majority voting
in majority voting each piece of information is sent multiple times. The idea being that majority wont be corrupted. The receiver can therefore compare them and accept the most common bit pattern as correct
->identifies AND corrects the errors
->can detect multiple errors
->more efficeint at detecting
check digits
an additional digit at the end of a string of numbers (eg on a barcode)
it is designed to check for mistakes in input or transmission
printed items such as books have unique barcodes.
The first 12 digits are unique to the item with the 13th being the check digit calculated from the other 12 using an algorithm such as modulo 10
check sums
the total sum of all bytes in a transmission is calculated using an algorithm (this is often sent alongside the data)
the same calculation is run by the receiving computer and it is compared with the sent checksum (or a known value)
if they do not match that data may have been corrupted and it is resent