# Quick Reference

### Data Storage: Bits & Bytes

• Computers are binary - they can only store data as a 0 or as 1
• Numbers like 1, 2, 3, 4, 5… are stored as 1, 10, 11, 100, 101 => while these look like decimal numbers, they are binary
• Letters & other characters are also stored in binary by mapping a discrete character to a number
• see Unicode, ASCII, UTF-8, & hexadecimal
• A is mapped to ASCII Code 065 => which in binary form is 0100001
• B is mapped to ASCII Code 066 => which in binary form is 0100010
• ABC in binary is then: 01000001 01000010 01100011
• in binary, text letter always begin with a “0”
• Text to Binary mapper
• Each 0 or 1 is a bit
• 8 bits equals a byte
• Why 8 bits?
• If we had only 4 bits, there would only be 16 (2^4) possible characters, unless we used 2 bytes to represent a single character, which is more inefficient computationally. If we had 16 bits in a byte, we would have a whole lot more ‘dead space’ in our instruction set, we would allow 65,536 (2^16) possible characters, which would make computers run less efficiently when performing byte-level instructions, especially since our character set is much smaller. Additionally, a byte can represent 2 nibbles. Each nibble is 4 bits, which is the smallest number of bits that can encode any numeric digit from 0 to 9 (10 different digits).
• ABC therefore equals 3 bytes

Bits and Bytes

1GB = 1024MB 1MB = 1024KB 1kB - 1024 Bytes 1 Byte = 8 bits

Why 1024?

• 2 to power of 10 = 1024 ….using power of 2 rather than a power of 10