1.2 Memory and storage Flashcards
What are the 3 number systems?
- Denary (base 10)
- Binary (base 2)
- Hexadecimal (base 16)
Denary
- 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9
- Place values are powers of 10 (100s, 10s, 1s)
Binary
- 2 Digits: 0 and 1
- Place values are powers of 2 (8s, 4s, 2s, 1s)
Hexadecimal
- 16 Digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F
- Place values powers of 16 (256s, 16s, 1s)
Converting binary to denary
- Put the number in a binary place value table
- Add up the place values in columns where there’s a 1
Converting denary to binary
- Draw a binary place value table
- Keep subtracting the biggest place values you can until you’re left with 0
- If you subtracted a place value, put a 1 in that column, otherwise put a 0
Converting Hex to Denary
- Put the number in a hex place value table
- Convert each value to hex
- Add up the results
Converting Denary to Hex
- Dividing by 16 to get a quotient and a remainder
- Convert each to hex
- The quotient is the 1st digit and the remainder is the 2nd
Converting Binary to Hex
- Put the numbers in a table that repeats 8, 4, 2, 1
- If the binary isn’t 8 bits, add 0s to the front so that it can split into nibbles
- For each nibble, add up the place values in columns where there’s a 1, and convert into hex
Converting Hex to Binary
- Convert each hex digits into a 4-bit binary number
- Put the nibbles together
Binary addition
- Use column addition
- Follow the 4 rules:
1) 0 + 0 = 0
2) 1 + 0 = 1
3) 1 + 1 = 10 (carry a 1)
4) 1 + 1 + 1 = 11 (carry a 1)
Binary shifts
- Move every bit left or right a certain number of places
- Gaps at the beginning or end of the number are filled in with 0s
- Left shifts -> Multiplying -> For every place, number is doubled
- Right shifts -> Dividing -> For every place, number is halved
Overflow error
- When binary arithmetic gives a result that requires more bits than the CPU is expecting
- Can lead to a loss of data or precision
- In binary addition, two 8-bit numbers might add to give a 9-bit number. If the CPU expects an 8-bit answer then bits will be lost
- Left shifts can cause the most significant bits to be lost
- Right shifts can cause the least significant bits to be lost
Eight units of data size
- Bits (b) -> a single binary digit (1 or 0)
- Nibble -> 4 bits
- Byte (B) -> 8 bits
- Kilobytes (kB) -> 1000 bytes
- Megabyte (MB) -> 1000 Kilobytes
- Gigabyte (GB) -> 1000 Megabytes
- Terabyte (TB) -> 1000 Gigabytes
- Petabyte (PB) -> 1000 Terabytes
How does computer store and process data?
- Binary
- Use 0s and 1s to represent flow of electricity -> 1 shows electricity is flowing, 0 shows that it isn’t flowing
- Each 1 or 0 in binary data is a bit. The size of the file is the numbers of 0s and 1s that make up its data
Data compression
Making file sizes smaller, while trying to stay as true to the original as possible
Benefits of data compression
- Compressed files use less storage space
- Streaming/downloading takes less bandwidth
- Some services like email have file size limits -> compression can get a file below the limit
Two types of compression
- Lossy compression -> permanently removes data from the file
- Lossless compression -> Temporarily removes data to store the file, and restores it to its original state when opened
Advantages of lossy compression
- Big reduction in file size -> easier to store, faster to download
- Commonly used -> lots of software can read lossy files
Disadvantages of lossy compression
- Loses data -> can’t be turned back into the original
- Can’t be used on text/software
- Reduction in quality
Disadvantages of lossless compression
- Comparatively small reduction in file size -> lossless files take up more storage space than lossy files
Characters
Uppercase and lowercase letters, the digits 0-9, and symbols like ?, + and £. Used to make words and strings
Character sets
Collections of characters that a computer recognises from their binary representation, used to convert characters to binary code and vice versa
ASCII
- Each character is given a 7-bit binary code -> can represent 128 different characters
- Extra 0 is added to the start of each binary code so each character uses 1 byte
Unicode
- Covers all major languages, including ones that use different alphabets
- Uses multiple bytes for each character
- First 128 characters in Unicode are the same as ASCII
Text file sizes
File size (in bits) = number of bits per character x number of characters
Bitmap
A type of image made up of lots of tiny dots, called pixels. Colour of each pixel is stored using a binary code
Image resolution
Number of pixels in a bitmap image -> width x height
Colour depth
The number of bits used to represent each pixel -> total number of colours = 2 to the power of n (where n = colour depth)
Image file sizes
- File size (in bits) = image resolution x colour depth = width x height x colour depth
- Increasing the image resolution or colour depth will usually give a higher quality image, but a larger file size
Metadata
Data stored in a file which contains information about the file. Helps the computer to recreate the image on the screen from the binary data
Sampling
Converting an analogue sound wave into digital data that can be read and stored by a computer
Sample rate
The number of samples taken per second. It is usually measured in hertz (Hz).
Bit depth
The number of bits available for each sample
Sound sampling process
- The amplitude of the sound wave is measured at fixed intervals -> sample rate
- Recreated digitally based on the measurements taken -> bit depth
- Will have lost some accuracy
Sound file sizes
File size (in bits) = Sample rate (Hz) x bit depth x length (seconds)