CIE Computer Science Notes, Cheat Sheet of Computer science

Chapters from 1-18 from Hodder A level computer science. From an A* student. These comprehensive A-Level Computer Science notes cover the full specification in a clear, structured, and exam-focused way. Designed for quick revision and deep understanding, they include detailed explanations, worked examples, and key definitions presented in concise bullet points. Topics include: ✅ Programming & Algorithms – pseudocode, recursion, Big-O complexity, searching & sorting ✅ Data Structures – arrays, stacks, queues, linked lists, trees, graphs ✅ Computer Systems & Architecture – CPU, registers, fetch-decode-execute cycle, memory, storage ✅ Software Development – compilers, interpreters, OOP, procedural and functional paradigms ✅ Networking & Security – protocols, IP addressing, encryption, firewalls, cyber threats ✅ Databases – relational databases, SQL queries, normalisation (1NF–3NF), DBMS ✅ Logic & Mathematics – Boolean algebra, binary, hexadecimal, floating-point representation

Typology: Cheat Sheet

2023/2024

Available from 08/25/2025

diya-sodha
diya-sodha 🇬🇧

1 document

1 / 47

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1: Information Representation
Kibi is binary prefix and kilo is denary prefix
BCD is used to represent values in a clock or calculator
- Straightforward to convert BCD to Denary vice versa
- So less complex to encode and decode for programmers
- Easier for digital equipment use BCD to display output information
- Can represent monetary values exactly
Character set:
- All of the characters that computer can use
- Each character has a unique number
ASCII – 128/ 27
Extended ASCII – 256/ 28
- Each character has its own unique code
- Each character in the word is replaced by its code
- The codes are stored in the order in the word
Unicode:
Has characters from other languages
16 or 32 bits
Pixel:
- Single square of colour
- Smallest addressable element in an image
File Header:
- Colour depth
- Image resolution
- File type – bitmap or vector
- Compression type
- Location/ offset within data
- dimensions
Bitmap:
- Made of pixels
- Large files
- Pixelated when enlarged
- Can be compressed
- Suitable for photos
- Use little processing power
- Individual elements cannot be grouped
Vector Graphic:
- Set of instructions on how to draw shape
- Small files
- Can enlarge without pixelation
- Cannot compress
- More suitable for geometric shapes
- Use more processing power
- Individual elements can be grouped
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f

Partial preview of the text

Download CIE Computer Science Notes and more Cheat Sheet Computer science in PDF only on Docsity!

1: Information Representation

Kibi is binary prefix and kilo is denary prefix BCD is used to represent values in a clock or calculator

  • Straightforward to convert BCD to Denary vice versa
  • So less complex to encode and decode for programmers
  • Easier for digital equipment use BCD to display output information
  • Can represent monetary values exactly Character set:
  • All of the characters that computer can use
  • Each character has a unique number ASCII – 128/ 2^7 Extended ASCII – 256/ 2^8
  • Each character has its own unique code
  • Each character in the word is replaced by its code
  • The codes are stored in the order in the word Unicode: Has characters from other languages 16 or 32 bits Pixel:
  • Single square of colour
  • Smallest addressable element in an image File Header :
  • Colour depth
  • Image resolution
  • File type – bitmap or vector
  • Compression type
  • Location/ offset within data
  • dimensions Bitmap :
  • Made of pixels
  • Large files
  • Pixelated when enlarged
  • Can be compressed
  • Suitable for photos
  • Use little processing power
  • Individual elements cannot be grouped Vector Graphic :
  • Set of instructions on how to draw shape
  • Small files
  • Can enlarge without pixelation
  • Cannot compress
  • More suitable for geometric shapes
  • Use more processing power
  • Individual elements can be grouped
  • Need to be rasterised to display or print Property: data about shapes Drawing list: the list of shapes involved in an image Sampling:
  • Amplitude of wave is determined
  • At set time intervals
  • To get approximation of sound wave
  • And encoded as a sequence of binary number
  • Increasing sampling rate will improve accuracy of recording
  • Allow for larger dynamic range
  • Less sound distortion
  • Sounds closer to OG o Smaller time gaps between samples o Makes digital sound wave more accurate o Smaller quantisation errors
  • Produces larger file size
  • Longer to transmit/download sound files
  • Greater processing power Important to estimate file size of image so its possible to estimate how many images can be stored and to decide if it can be sent as an email attachment. Image Resolution: the number of pixels in the bitmap file defined as the product of the width and the height values Lossy Compression: Reduce bit depth : reduces number of bits per colour Reduce colour palette: fewer colours mean fewer bits needed to store each colour Reduce image resolution: fewer pixels per unit means less binary to store
  • human ear will notice decompressed stream will not be identical to original file
  • Reduces file size more than lossless o smaller files takes less time to transit
  • Flac (free lossless audio codec) Cannot Lossy compression on text as:
  • No og data can be lost
  • Text file would be corrupted Perceptual music shaping: method where sounds outside the normal range of hearing of humans, for example, are eliminated from the music file during compression. Analogue data = data values that are continuously changing Lossless Compression:
  • File needs to be high precision/accuracy
  • None of the original data is lost
  • Users can share files and data
  • Access to reliable data that comes from a central source – file server
  • Data and files can be backed up centrally
  • Users can communicate using email and instant messaging
  • Network manager can oversee the network and apply access rights
  • Cabling and servers can be expensive initially
  • Managing a large network is complex and difficult
  • Breakdown of servers can affect whole network
  • Malware and hacking affect whole network Network infrastructure: Hardware:
  • LAN cards
  • Hubs o can only broadcast to all connected. o Directionless transmission. o All drop packet except one intended to receive. o Waste of bandwidth
  • Switches o essentially an intelligent hub. o Sends only to intended recipient.
  • Repeater o Used to boost signals in the wifi zone. o Sometimes hubs contain repeaters – repeating hubs  One collision domain – ignore this  Referred to as unmanaged since they are unable to manage delivery paths and security
  • Routers same as hub and switch but also has a modem so can connect to outside of network as well.
  • In built firewall o receive packets o forward packets to destination o find destination o allocate private IP address o routing table o find most efficient path to destination o maintain table of IP addresses
  • Bridge o Connects two similar networks o Occurs at link layer in TCP/IP o Main function of bridge is to keep the traffic separated on both sides of the bridge o Format of packet is not changed
  • Gateway o Connects two dissimilar networks o Packet switches that operate at multiple layers of the OS model o Translate the protocols so that PCs on the two networks can communicate o Format of packet is changed o Do not support dynamic routing
  • Modem (modulator demodulator)

o Converts digital to analogue and vice versa o Allow several simultaneous wireless communication to take place without interfering with each other. o Router for creating network at home, modem for connecting to external network o Can also have softmodems (software modem) runs on host computer. Computers hardware used instead

  • Wireless router
  • NIC – contains MAC address generated at manufacturing stage, usually part of device hardware
  • WNIC – use antenna to communicate with network via microwaves, usually plug into usb port/integrated circuit plug in. o Can be infrastructure mode – through WAP o Or ad hoc mode – straight to each other o Provides interface to wireless network – as an antenna o Receives analogue radio waves – converts to dig o Checks incoming transmissions for correct MAC/IP address o Ignores unintended o Encrypts and decrypts data o Dig to ana and sends radio via antenna
  • Repeater
  • Cabling Software:
  • Operation of firewalls
  • Security applications/utilities Services:
  • Satellite communication channels
  • Wireless protocols
  • IP addressing Private networks: owned by single organisation or company often lans or intranets. Company is responsible for purchase of own equip and software, maintenance of network and hiring and training of staff. Public networks: owned by communications carrier company - non passwords, only sub networks may be under security management Client Server Model:
  • Uses separate dedicated servers; client computers connected to server computer
  • Users are able to access most of the files which are stored on dedicated servers
  • Server dictates which users are able to access which files
  • Client server model allows installation of software onto a client’s computer
  • Model uses central security databases which control access to the shared resources
  • Can be as large as wish
  • Central server looks after storing delivery and sending of emails
  • Can be bottlenecked (a component that limits the potential of other hardware due to differences in the maximum capabilities of the two components) if several client requests at the same time
  • E.g. amazon Choose because:
  • Company has large user base

Each node looks at each packet and determines whether or not the address of the recipient in the package matches the node address. If so the node accepts the packet, if not, packet ignored. Suitable for situations w small no of devices with light traffic e.g. small company or office

  • Uses single central cable to which all computers and devices are connected.
  • Typically peer to peer
  • Data only travels in one direction
  • If data is being sent other devices cannot transmit
  • Terminators are needed at each end to prevent signal reflection (bounce)
  • If main cable fails, whole network goes down
  • Performance of network deteriorates under heavy loading
  • Every packet passes through every node so not very secure
  • Even if one node fails, remainder of network continues to function (bc p2p)
  • Its easy to increase size of network by adding additional nodes Star Network Used for evolving networks where devices frequently added or removed. Well suited to heavy traffic
  • Uses central hub/switch which each computer is connected to
  • Data going from host to host is directed through central switch/hub
  • Each computer/device has its own dedicated connection to central node
  • Usually client server
  • Hub: o Packets sent to every node o If address matches node, its accepted otherwise not
  • Switch: o Packets only sent to node with address o This is more secure
  • High initial installation costs
  • If central hub/switch fails, whole network goes down
  • Data collisions reduced
  • Secure bc: o Security on central Hub/switch o Packets only sent to receiving node
  • Easy to upgrade by j changing hub/switch
  • If one connection breaks, only that node is affected Mesh Network
  • Routing o Giving nodes routing logic so data is directed by shortest route and can be re- routed if one of the nodes in the routes have failed
  • Flooding o Simply sends the data via all the nodes and uses no routing logic. Can lead to unnecessary loading on the network
  • Peer to peer
  • Used in interent, WANs, MANs
  • Industrial monitoring and control systems
  • Large amount of cabling – expensive and time consuming
  • Set up and maintenance is difficult and complex
  • Easy to identify where faults on network in network have occurred
  • Any broken links in network do not affect other nodes
  • Good privacy and security since packets travel along dedicated routes
  • No collisions
  • Network is relatively easy to expand Hybrid Network Mixtures of two or more different topologies
  • Can handle large volumes of traffic
  • Easy to identify where a network fault has occurred
  • Very well suited to the creation of larger networks Cloud:
  • Cloud computing: accessing a service, files, software on a remote server
  • Public cloud: where client and cloud provider are diff companies
  • Private cloud: provided by dedicated environment behind company firewall. Client and cloud provider operate as single entity
  • Hybrid cloud: combination. Some data in private and less sensitive data in public
  • don’t need separate storage devices
  • can access from any computer w internet connection
  • cloud services often have backups
  • data is easily shared
  • can easily increase capacity
  • need internet to access
  • time needed to upload/download data
  • expensive in long term
  • limit to amount of storage paid for Wifi and Bluetooth When a device wants to communicate it picks one of the 79 channels at random, if this is being used, it randomly picks another – spread spectrum freq. hopping. To minimise interference, constantly switch frequencies. Bluetooth create secure WPAN (wireless personal area network). Useful when:
  • transferring data between 2 or more devices which are less than 30 metres apart
  • speed of data transmission is not critical
  • low bandwidth applications Bandwidth: radio  micro  infrared Penetration: infrared  micro  infrared Attenuation: infrared  micro  radio
  • easier to expand networks not necessary
  • devices have increased mobility
  • less cabling/expertise needed
  • increased chance of interference
  • data is less secure than with wired systems
  • signals can be stopped by thick walls Satellite

On demand:

  • Digital files stored on server converted to bit streaming format
  • Link to encoded file is put on web server
  • File is downloaded in contiguous bit stream, can rewind and fast forward Real time:
  • Event captured by camera and microphone
  • Video signal encoded to streaming media file
  • Encoded file is uploaded to computer from dedicated video streaming server
  • Server sends encoded live video to user’s device
  • Video footage is live so cant rewind etc Internet Network of networks Uses TCP/IP Need ISP (internet service eprovider) to access it WWW Collection of multimedia webpages Uses https for HTML pages Need web browsers PSTN Alternative to internet (VoIP – Voice over Internet Protocol) to make a phone call Always open until line is terminated by both ends They have their own power source so unaffected by powercut Use circuit switching VoIP Converts sound to digital packages Uses packet switching Carries out file compression More efficient than PSTN – inly necessary data is transmit Can also use satellites – don’t suffer from attenuation IP address Ipv4:
  • Set of 4 numbers
  • Each number is 8 bits
  • Separated by dots Ipv6:
  • Set of 8 numbers
  • Each number is 4 hex digits – 16 bits
  • Separated by colons Public IP: visible to any network on device Private IP: visible to only networks on LAN Static IP:
  • When a computer disconnects and rejoins a network, address doesn’t change
  • Address assigned by Dynamic IP:
  • Each time computer rejoins, IP changes
  • Assigned by network OS

Subnetting: Network ID is first part, then host ID

  • Reduce amount of traffic in network
  • Sata stays in subnet – does not travel far
  • Improves network security- not all devices can access all areas of network
  • Allows for easier maintenance
  • Only one subnetwork breaks, rest can continue MAC address:
  • Hex
  • Doesn’t change
  • Identify on LAN DNS – domain name service User opens web browser and types in URL, web browser askes DNS server for IP address of website DNS server can’t find URL in its database and sends req. to diff DNS server. This server finds URL and maps it to IP address, this is sent back to OG server (stores this info) IP address is sent back to user’s computer Computer sets up communication with website server and req. pages are downloaded. Browser interprets HTML and displays

3: Hardware

Cache Memory

high speed memory external to processor which stores data which the processor will need again. Closer to CPU than primary memory

Primary Memory

RAM:

Random access memory write/read by user and computer stores: data, files, part of an app, part of OS thats currently in use volatile

  • faster than ROM DRAM : (Dynamic RAM) type of RAM that needs to be constantly refreshed as capacitors leak electricity
  • less expensive than SRAM
  • consume less power
  • higher memory capacity SRAM : (Static RAM) uses flip-flops does not need refreshing used in cache
  • faster data access time than DRAM Flipflops:
  • can either store either 0 or 1
  • computers use bits to store data
  • can be used to store bits of data
  • Magnetic Storage
  • Central spindle
  • Platter made of aluminium
  • Spins fast at high speed
  • Head
  • Moves with electric current
  • Has concentric tracks
  • one track in one sector is called one block
  • data is encoded as a magnetic pattern for each block
  • cheap
  • slow data access time. lots of latency
  • can be damaged if dropped Solid State:
  • Non volatile
  • Secondary storage
  • Stores data by flashing it onto chips
  • Stored by controlling flow of electrons using transistors
  • Current reaches control gate and flows through the floating gate to be stored
  • When data is stored the transistor is converted from 1 to 0
  • if flash memory, NAND chips
  • if EEPROM, NOR chips (faster. expensive)
  • robust and more physically durable
  • No moving parts
  • No lag time (don’t have to get up to speed)
  • Cooler
  • thinner
  • faster read/write
  • unknown longevity
  • expensive Optical :
  • Drive motor spins disc
  • Lens focus laser onto disc
  • Laser is shone to read/ write
  • Disc has reflective metal layer
  • Track has sequence of pits n lands
  • Reflected light is encoded as a bit pattern [CDs + DVDs can be R (write once) or RW (read/write multiple times) DVDs are dual layered so higher storage Blu-ray uses blue laser (smaller wavelength) so smaller pits therefore more storage] Dual Layering: Two layers of a standard DVD are joined together with a transparent (polycarbonate) spacer, and a very thin reflector is sandwiched between the two layers. Reading and writing of the second layer is done by a red laser focusing at a fraction of a millimetre difference compared to the first layer. however can cause birefringence (reading problem with DVDs caused by refraction of laser light)

Hardware:

Binder 3D Printing: 3D printing method that uses a two-stage pass; first stage uses dry powder and second stage uses binding agent Direct 3D Printing: 3D printing technique where print head moves in xyz directions. layers of melted material are built up using nozzles like an inkjet printer Laser Printer:

  • The drum is given an electric charge.
  • The drum starts to revolve step by step.
  • At each step a laser beam is directed by the mirror and lens assembly to a sequence of positions across the width of the drum.
  • At each position the laser is either switched off to leave the charge on the drum or switched on to discharge the position.
  • This process repeats until a full-page electrostatic image has been created.
  • The drum is coated with a charged toner that only sticks to positions where the drum has been discharged.
  • The drum rolls over a sheet of paper which is initially given an electric charge.
  • The sheet of paper is discharged and then is passed through heated rollers to fuse the toner particles and seal the image on the paper surface. - The drum is discharged before the process starts again for the next page Inkjet Printer: non-impact printer line printer
  • print head contains large number of very small nozzles
  • ink is fed to each nozzle from a reservoir
  • print head fires droplets of ink onto paper
  • it moves horizontally across paper thermal bubble:
  • tiny resistors create heat inside each nozzle
  • heat vaporises ink to create a bubble
  • when the bubble pops ink is deposited on page
  • collapsing bubble creates partial vacuum in nozzle
  • ink is drawn from reservoir for next page piezoelectric crystal:
  • piezo crystal at back of ink reservoir of each nozzle
  • crystal vibrates when it receives electric charge
  • ink is forced out of nozzle by inward vibration
  • outward vibration creates partial vacuum in nozzle
  • replacement ink is pulled into reservoir
  • stepper motor connected to print head by a belt
  • moves print head across paper
  • parks print head when not in use
  • stepper motor connected to paper feed turns rollers that provide paper Buffer:
  • temp storage
  • before used by receiving device
  • to allow processes to operate a different speeds
  • independently of each other a temporary storage created for data transmitted from one part of the system to another which functions as a queue
  • as mouse moves, sensor detects change in surface detail
  • translated into movement
  • computer updates position of cursor on screen Keyboard:
  • keys are positioned above a key matrix which consists set of rows and wires and another set of columns of wires
  • pressing a key causes contact at one of the points where wires cross
  • microprocessor continuously tests to see if any electrical circuit involving a row wire and a column wire has been closed
  • when microprocessor recognises that a circuit has become closed, it can identify the particular intersection that is causing this
  • processor uses data stored in the ROM to identify the character code relating to the associated key and sends the character to screen Scanner: sheet of paper containing image held in fixed position and light source moves across it. covers width of paper reflected light directed by mirrors and lenses onto CCD (charged couple device)
  • CCD contains array of photosensitive cells
  • produces electrical response proportional to light intensity for each cell
  • needs ADC to transmit values to computer VR headset:
  • two eye pieces
  • fed paired images from the controlling system so that it gives the eyes the sensation of being in a 3D environment.
  • get the images by using specialised photographic techniques or using a 3D graphics package.
  • the wearer of the headset controls which part of the 3D env they see by moving their head.

Systems

Control:

  • sensors send signals to computer/microprocessor
  • signals converted to digital using ADC
  • microprocessor analyses data received by checking against stored values
  • if new data outside range, microprocessor sends signals to control valves, motors etc
  • output from system affects next set of input from sensors. Gives feedback bc:
  • to ensure the system operates within the given criteria
  • by enabling system outputs to affect subsequent system inputs
  • the system automatically adjust conditions Monitoring:
  • sensors send signals to computer/microprocessor
  • signals converted to digital using ADC
  • microprocessor analyses data received by checking against stored values
  • if new data outside range, warning message is sent ot screen/alarm activated
  • microprocessor has no effect on what is being monitored, simply watching Control vs monitoring: Control uses feedback

Control produces an action Sensors:

  • temperature
  • pH
  • motion
  • pressure
  • humidity
  • sound

4: Processor Fundamentals

Stored program concept: Instructions and data are stored in the same memory space / in main memory Von Neumann Model:

  • CPU(Central Processing Unit)
  • CPU has direct access to memory
  • memory contains 'stored program' and data required by program
  • stored program consists of individual instructions
  • processor executes instructions sequentially Internal Clock: controls cycles of activity within processor System clock:
  • synchronise operations
  • by creating timing signals
  • to keep track of date and time
  • to process operations in correct order/ sequence controls cycles of activity outside the processor. By increasing clock speed, processing speed of computer is also increased.
  • One instruction per cycle, hence faster clock speed = more instr/ sec This doesn’t necessarily mean increase in performance need to also consider:
  • width of address bus and data bus can affect computer performance
  • overclocking: when speed is changed by accessing BIOS (basic input output system) o execution of instructions outside design limits – leads to unsynchronised operations o overheating of CPU
  • use of cache memory can improve processor performance. Cache is volatile and uses SRAM (unlike main memory) hence faster access time
  • use of a different number of cores ALU: (Arithmetic logic unit) responsible for arithmetic or logic processing requirements of the instruction in a running program Control unit:
  • to coordinate / synchronise the actions of other components in the CPU
  • to send / receive control signals along the control bus
  • to manage the execution of instructions (in sequence)
  • to control the communication between the components of the CPU
  • has internal and system clock
  • CPU has clock speed - defined frequency for clock cycle:
  • the minimum period of time that separates successive activities within the system.
  • Simpler tech
  • Only 1 standard available
  • Easy to split signal and connect a number of devices from one source
  • Old analogue tech
  • Easy to bend pins when connecting
  • Cable must be very high grade to ensure good signal HDMI: (High Definiton Multimedia Interface) provides high-quality video and audio (newer VGA)
  • Current standard for modern TVs and monitors
  • Allows for a very fast transfer rate
  • Improved security
  • Not very robust connection
  • Limited cable length
  • Currently 5 cable standards FDE cycle: PC contains address of memory location of next instruction to be fetched Address then copied from PC to MAR using address bus Instruction at address contained in MAR are copied temporarily into MDR Instruction of MDR placed in CIR PC incremented Instruction is decoded then executed by sending out signals via control bus to various components of system Check for interrupts then repeat. Interrupts:
  • Check for interrupt at end of cycle
  • Priority is checked
  • If lower, leave; if higher, store current process on stack
  • Location of interrupt identified
  • ISR called
  • Check again for more interrupts
  • If higher, repeat; if lower, load data from stack and start FE cycle Software:
  • Division by zero
  • Attempts to access invalid memory location
  • Array index out of bounds
  • Stack overflow Two Pass assembler: There are 2 types , single pass and 2 pass. Single pass puts machine code straight into computer memory to be executed Pass 1: to create a symbol table
  • Read assembly language program line by line
  • Ignore comments
  • Allocate memory address for line of code
  • Check opcode is instruction set
  • Add new labels to symbol table with address if known
  • Place address of labelled instruction in symbol table Pass 2:
  • Read assembly language program line by line
  • Generate object code including opcode and operable from symbol table in pass 1
  • Save /execute Adressing Immediate then direct/absolute then indirect. Indexed is indirect address+ contents of IR. Eg. Current instruction contains 4 and IR contains 6, address is 10. Relative is current memory address plus #n spaces.
  • To allow for re-locatable code
  • Because all target addresses can be specified by the base address + offset Symbolic (only exists in assembly) is when theres a label Instruction groups Data movement Arithmetic operations: perform addition and subtraction Input and output of data: takes input from user// outputs char of binary no. (un)conditional: move to another instruction Compare instructions: compare result to another value Binary Shifts Logical shift: bits shifted out are replaced w 0s Arithmetic shift: sign is preserved. Can be used for multiplication and division by powers of 2.

5: System Software

User Interface:

  • CLI – hardware: keyboard
  • GUI – Hardware: mouse Why does computer need OS? Hardware is unusable without an OS acts as interface between user and hardware Provides software where other programs can be run OS:
  • Memory management o Memory optimisation - Determines where in memory its stored o Memory organisation – determines how much of memory it uses o Memory protection – ensures two apps don’t use the same locations RAM allocation: o RAM is assigned into blocks o dynamic allocation of RAM to programs / processes o reclaims unused blocks of RAM