https://ibaguette.com/cheatsheets/gcse/ComputerScience https://www.csnewbs.com/ocr-gcse copied all from this + a bit of smart revise terms work smarter not harder
Primary storage or 'main memory'
Low-capacity internal storage
Includes RAM and ROM, registers and cache
holds data and instructions CPU needs to access while computer is running
CPU accesses data faster here than from secondary
RAM - Random Access Memory
Temporary store of currently executing instructions and their data = volatile
read and write
stores parts of OS to be accessed by the CPU
stores all currently running data and instructions
slower than cache, much faster than secondary storage as it doesn’t have moving parts or have to retain that info
more RAM = more programs and instructions computer can store simultaneously
ROM - Read Only Memory
Non-volatile - stores long-term even if powered off
read only - Instructions and data cannot be changed
stores the first instruction, boot program/basic input/output system for when computer is switched on. BIOS then loads up OS to take over managing the computer
smaller than RAM
Virtual memory
Programs must be stored in RAM to be processed by CPU
held on the hard disk
insufficient space in RAM = hard disk drive (HDD) is an extension of RAM (virtual memory)
new data to be stored in RAM = unused data in RAM is moved to hard drive so new data can be transferred into RAM
data can be moved back from VM into RAM
VM allows users to run more programs simultaneously with less system slow down
VM is much slower than even the fastest SSDs, due to data constantly moving between it and the RAM to keep programs running
Secondary storage
needed as ROM is read only, RAM is volatile
for storing programs and data when power off, semi-permanent storage of data that can change, back up and archive of data files
Slower as not directly accessed by CPU
larger in storage size, non-volatile
magnetic, optical and solid state storage
not embedded on motherboard = further from CPU so slower to access then primary
Magnetic storage
Storage medium - surfaces coated with magnetic material, flipping magnetic polarity to store bits (N/S is 1/0)
hard disk drive
not used - floppy disk, replaced by solid state devices; USB sticks, faster, higher storage capacity
tape - data is accessed in order so only companies use to back up/archive large amounts of data
Magnetic Storage Characteristics
high storage capacity and cheaper cost per GB than solid state
Not DURABLE and not very PORTABLE when powered on because moving it can damage the device
moving parts which eventually fail = not reliable
Hard disks perform better if defragmented
quick access to data
Optical storage
Storage medium - laser scans tracks, and when light reflects, from ‘lands’ - 1
, or not reflect in ‘pits’ - 0
, allowing it to read data from CD, DVD or Blu-Ray
slowest access to data
Disc drives are traditionally internal but external disc drives can be bought for laptops
Optical Storage Characteristics
Low storage capacity
Not durable, discs are fragile/break or scratch easily
Discs are thin, light and portable.
very cheap to buy in bulk
slowest access speed
Solid state
no moving parts
trapping electrons to store bits
SSDs (Solid State Drives) are replacing magnetic HDDs in computers and video game consoles
USB flash drive - used to transport files easily because of its small size
Memory cards - SD card in digital camera or Micro SD card in smartphone
Solid State Characteristics
no moving parts = reliable, fastest access speed
medium storage capacity
durable but cheap USB sticks can snap or break
small size of USB sticks/memory cards = portable in bag or pocket
no need to defragment
most expensive
quiet, low power
limited number of red/write cycles
Why do computers use binary?
PC’s consist of billions of tiny transistors - switches with two values - on (1) or off (0)
2 states = electrical components are easier to manufacture, cheaper, more reliable
so all data must be represented/ processed this way
Binary is a base 2 number system consisting of 0s and 1s
Units of data storage
bit = 0/1
nibble = 4 bits
8 bits = byte (stores 1 character, e.g “A”)
kilobyte = 1000 bytes
megabyte = 1000 kilobytes
gigabyte = 1000 megabytes
terabyte = 1000 gigabytes
petabyte = 1000 terabytes
kill my grandma tomorrow please
Denary
Denary is a base 10 number system
This means it has 10 possible values - 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9
Denary to Binary
128, 64, 32, 16, 8, 4, 2, 1
subtract denary number from the star of this list
is it can be subtracted without being negative = write 1
continue till you reach 0
Adding binary digits
0 + 0 = 0
0 + 1 = 1
1 + 1 = 0, carry 1
1 + 1 + 1 = 1, carry 1
Hex
Hexadecimal is a base 16 system
hex digit: 0 1 2 3 4 5 6 7 8 9 A B C D E F
Each hex digit represents a 4-digit binary sequence
shorthand for binary - fewer characters to write same value
so less prone to errors when reading or writing it, compared to binary
Denary to hex or hex to denary
Convert 103 into binary = 01100111
Split into nibbles = 0110 0111
Work out hex of nibble 1 = 6
Work out hex of nibble 2 = 7
Put together = 67
OR
divide denary number by 16 until you can’t (here, 6 times). Then get the remainder (here, 7). Then put it together
do the opposite for hex to denary = turn into binary and then denary
Size equation of sound, image, text
Sound file size = sample rate x duration (s) x bit depth
Image file size - size of image on disk in bytes = colour depth x image height (px) x image width (px)
Text file size = bits per character x number of characters
craig’n’dave vid 14
Overflow error
occurs when binary value is too large to be stored in bits available
With a byte the largest number that can be held is 255
Therefore any sum of two binary numbers greater than 255 = overflow error as it is too large to be held in 8 bits
Binary shifts
A shift of 1 to the left means multiply by 2.
A shift of 3 to the left means multiply by 2^3 = 8
A shift of 1 to the right means divide by 2
A shift of 3 to the right means divide by 2^3 = 8
left = multiply, right = divide
11001100 to the left by two positions = 00110000
11 shifted from the start is lost, and 00 replace them at the end
no matter what side a 1/0 is shifted off, it’s replaced by a 0 on the opposite side
What is a Character Set?
list of character recognised by a computer/table that matches together character and binary value
Each character is represented by a unique binary number
Character sets are necessary as they allow computers to exchange data and humans to input characters
logically ordered - ABC, code increases by 1 with each letter
A in binary is 0100 0001, B in binary is 0100 0010.
ASCII (extended but just call it ASCII)
common character set which doesn’t take up much memory space
number of characters that can be stored is limited by bits available
ASCII uses 1 byte (8 bits) = maximum number of characters is 2^8 = 256, the highest possible character code is 255 (0-255)
enough for English not other languages or all punctuation symbols
Unicode
more popular character set because it uses 2 bytes (16 bits) = 65,536 possible characters
can be also 24 bits (16mill charac) or up to 32 bits
many different languages represented, thousands of symbols and emojis
requires more memory to store each character than ASCII as it uses extra byte
Bitmap images
made of pixels, single-colour squares arranged on a grid
Each is assigned a binary value which represents colour of that pixel
quality of a bitmap image depends on total amount of pixels = image resolution (height in px * width in px)
scaling bitmap image up = visible loss of quality
Most images are bitmaps, like photos and screenshots.
File Size = Resolution x Colour Depth
black&white image - bit depth 1 - only represents, 21 = 2 colours
photos are 2^ 24 = 16mil colours
Colour/bit depth = number of bits for each px
Vector images
drawn by the computer following precise mathematical instructions to create lines and objects
usually smaller in file size compared to bitmaps because each pixel in a bitmap is stored as an individual binary value
can be scaled up without loss of quality and are typically used for logos and animations
Metadata
additional data about a file
e.g: Height/Width in pixels, Colour depth, Resolution, Geolocation, Date created, Last edited, File type, Author details
important - dimensions must be known so image can be displayed correctly
Converting Analogue sound to binary
Analogue sound waves must be digitally recorded and stored in binary
To record the sound, amplitude (height) of analogue sound wave is measured and recorded in binary at specific intervals
Sampling an Analogue Sound Wave
Digital sampling is discrete (separate) and not continuous like analogue waves
To get highest quality sound, many samples are taken to recreate analogue wave as closely as possible
Sample rate
number of times per second amplitude of the sound wave is measured - number of samples recorded in a second
measured kilohertz (kHz), e.g CD quality is 44.1 kHz
higher sample rate, better audio quality as the digital data more closely resembles an analogue wave
but, higher sample rates = larger file sizes because more data is stored for each individual sample
Bit Depth
number of bits available to represent each sample
sample with bit depth 4 could be 0101 or 0111
common bit depth is 16 bits
higher bit depth = more bits available for each sample = quality higher as wave more closely resembles analogue wave
file size larger if bit depth higher, as each sample stores additional bits
Bit rate
amount of data processed per second
sample rate x bit depth = in bits per second
Higher bit rate = higher quality sound, higher file size
sound file size equation
sound file size = sample rate x bit depth x duration
shows the total number of bits in a sound
record an audio file/sound steps
input device e.g. microphone picks up sound, converts into electrical signal
signal used by ADC (analogue-digital converter) and sampled at regular intervals - directly represent sound wave’s traits, like amplitude.
represented as binary sequence and saved to file. raw data of converted signal is uncompressed
What is compression?
To compress a file means to make its size smaller, less bits, lower storage capacity
Benefits:
Files take up less storage space (more files can be stored on a storage device)
Files can be transferred quicker (as they are smaller)
Files can be read from or written to quicker
Lossy compression
permanently removing data from file - limits number of bits the file needs = reduces size and quality = sometimes seen by humans but may be unnoticeable
commonly used - many software can read it
less bandwidth so downloaded and transmitted faster
great reduction in file size = more files can be stored on storage device
can’t be used on text files as they become corrupted, or executable files
good for JPEG (image), AAC and MP3 (audio)
Lossless compression
Files need to be reduced in size temporarily - without loss of data, just encoded differently
bigger than lossy, even when compressed
can be put back to original (decompressed)
can be used on all types of data
best for texts and executable files
FLAC (audio), TIFF, PNG (image)