0% found this document useful (0 votes)
17 views43 pages

Revision Notes - All Subjects

The document outlines key topics in computer science, focusing on systems architecture, programming, and memory/storage. It details the components and functions of the CPU, including the fetch-decode-execute cycle, and distinguishes between primary and secondary storage types. Additionally, it discusses performance factors such as cache memory, clock speed, and core count, as well as the role of embedded systems.

Uploaded by

himygtheoriginal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views43 pages

Revision Notes - All Subjects

The document outlines key topics in computer science, focusing on systems architecture, programming, and memory/storage. It details the components and functions of the CPU, including the fetch-decode-execute cycle, and distinguishes between primary and secondary storage types. Additionally, it discusses performance factors such as cache memory, clock speed, and core count, as well as the role of embedded systems.

Uploaded by

himygtheoriginal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

‭Revision Notes‬‭-‬

‭COMPUTER SCIENCE‬
‭Topic list:‬
‭➔‬‭Topic 1:‬‭Theory‬
‭◆‬ ‭1-1:‬‭Systems Architecture‬
‭◆‬ ‭1-2:‬‭Memory & Storage‬
‭◆‬ ‭1-3:‬‭Networks‬
‭◆‬ ‭1-4:‬‭Network Security‬
‭◆‬ ‭1-5:‬‭Systems Software‬
‭◆‬ ‭1-6:‬‭Impacts‬
‭➔‬‭Topic 2:‬‭Programming‬
‭◆‬ ‭2-1:‬‭Algorithms‬
‭◆‬ ‭2-2:‬‭Programming Fundamentals‬
‭◆‬ ‭2-3:‬‭Producing Robust Programs‬
‭◆‬ ‭2-4:‬‭Boolean Logic‬
‭◆‬ ‭2-5:‬‭Languages & IDEs‬
‭1-1: Systems Architecture‬
‭Topic Contents:‬
1‭ .1a -‬‭The CPU‬
‭1.1b -‬‭Registers & The FDE Cycle‬
‭1.2 -‬‭CPU Performance‬
‭1.3 -‬‭Embedded Systems‬

‭1.1a - The CPU‬


‭ he Central Processing Unit (CPU) is the most important component in any computer system. Like many‬
T
‭components of a computer, it is attached to the motherboard. The purpose of the CPU is to process data and‬
‭instructions by constantly repeating the fetch - execute cycle.‬

‭CPU Components‬
‭The CPU has 4 major components:‬
‭-‬ ‭The‬‭Control Unit‬‭(CU)‬
‭-‬ ‭The‬‭Control Unit‬‭(CU) sends control signals to direct the operation of the CPU.‬‭Control‬‭signals‬
‭and‬‭timing signals‬‭are sent to the‬‭ALU and other components‬‭such as RAM. It also decodes‬
‭instructions as part of the‬‭FDE cycle‬‭.‬
‭-‬ ‭The‬‭Arithmetic Logic Unit‬‭(ALU)‬
‭-‬ ‭ALU stands for‬‭'Arithmetic and Logic Unit‬‭'. It performs‬‭simple calculations‬‭and‬‭logical‬
‭operations‬‭.‬
‭-‬ ‭The‬‭Registers‬
‭-‬ ‭A register is a‬‭temporary storage space‬‭for‬‭one instruction or address‬‭. Different registers are‬
‭used during the‬‭FDE cycle‬‭.‬
‭-‬ ‭The‬‭Cache‬
‭-‬ ‭Cache memory‬‭is used to temporarily store data that is‬‭frequently accessed‬‭. Cache memory is‬
‭split into‬‭different levels‬‭. Cache is‬‭slower to access than the registers‬‭but‬‭much faster than‬
‭RAM‬‭.‬

‭Computer Architecture‬
‭ he way a‬‭computer is designed and structured‬‭is known as its‬‭architecture‬‭. The most common type of‬
T
‭computer architecture is the‬‭Von Neumann Architecture‬‭.‬

‭ his architecture is named after‬‭John Von Neumann‬‭who developed the concept of a stored program‬
T
‭computer in the 1940s. Before being able to store programs in memory, instructions had to be manually input‬
‭by a human. A computer with Von Neumann architecture stores both program instructions and data in the‬
‭same memory (RAM).‬‭Other architectures‬‭like Harvard have two separate memories -‬‭one for program‬
‭instructions and another for data‬‭. Data is transferred‬‭between components‬‭on‬‭pathways‬‭called‬‭buses‬‭.‬
‭Von Neumann Architecture‬

‭1.1b - Registers & The FDE Cycle‬


‭ he‬‭Fetch Decode Execute‬‭(FDE) cycle is performed by the CPU‬‭millions of times‬‭every second.‬
T
‭This cycle is how the CPU‬‭processes data and instructions‬‭for each program or service that requires its‬
‭attention.‬

‭Important Registers‬
‭ register is a‬‭small storage space‬‭for‬‭temporary data‬‭in the CPU. Each register has a‬‭specific role‬‭. There‬
A
‭are‬‭Four essential registers‬‭used in the FDE cycle:‬
‭-‬ ‭The‬‭Program Counter‬‭(PC)‬
‭-‬ ‭A register that tracks the‬‭RAM address‬‭of the‬‭next instruction‬‭to be‬‭fetched‬‭.‬
‭-‬ ‭The‬‭Memory Address Register‬‭(MAR)‬
‭-‬ ‭A register that‬‭tracks the RAM address‬‭of the instruction that is to be‬‭fetched‬‭.‬
‭-‬ ‭The‬‭Memory Data Register‬‭(MDR)‬
‭-‬ ‭The MDR stores the‬‭instruction‬‭that has been‬‭transferred from RAM to the CPU‬‭.‬
‭-‬ ‭The‬‭Accumulator‬‭(ACC)‬
‭-‬ ‭The ACC stores the‬‭result of mathematical or logical calculations‬‭.‬
‭-‬ ‭The Current Instruction Register (CIR)‬
‭-‬ ‭A register that stores the instruction that has been fetched from RAM, and is about to be‬
‭decoded or executed‬

‭FDE Cycle‬
‭ he essential idea of the F-E cycle is that instructions are fetched from RAM, to be decoded (understood) and‬
T
‭executed (processed) by the CPU. The Cycle is as follows:‬
‭1.‬ T ‭ he‬‭Program Counter‬‭(PC) register displays the address in RAM of the‬‭next instruction‬‭to be‬
‭processed. This value is copied into the‬‭Memory Address Register‬‭(MAR)‬
‭2.‬ ‭The PC register is increased‬‭by 1‬‭. This prepares the CPU for the next instruction to be‬‭fetched‬
‭3.‬ ‭The CPU‬‭checks the address‬‭in RAM which‬‭matches‬‭the address held in the MAR‬
‭4.‬ ‭The instruction in‬‭RAM‬‭is‬‭transferred‬‭to the Memory Data Register (MDR)‬
‭5.‬ ‭The instruction in the‬‭MDR‬‭is‬‭copied‬‭into the Current Instruction Register (CIR)‬
‭6.‬ ‭The instruction in the‬‭CIR‬‭is‬‭decoded‬‭(understood) and‬‭executed‬‭(processed). Any result of an execution‬
‭is stored in the‬‭Accumulator‬‭(ACC) register‬
‭7.‬ ‭The cycle‬‭repeats‬‭by‬‭returning to the first step‬‭and‬‭checking‬‭the program counter for the address of‬
‭the‬‭next instruction‬

‭1.2 - CPU Performance‬


‭The performance of a computer system is affected by three main factors:‬

‭Cache Memory‬
‭What is cache memory?‬
‭-‬ ‭Cache memory is temporary storage for frequently accessed data.‬
‭How does cache memory improve performance?‬
‭-‬ ‭Cache memory is closer to the CPU than RAM, meaning that it can provide data and instructions to the‬
‭CPU at a faster rate. A computer with more cache memory (e.g. 8GB instead of 4GB) should have a‬
‭higher performance because repeatedly used instructions can be stored and accessed faster.‬
‭What is the limitation of cache memory?‬
‭-‬ ‭Cache memory is costly, so most computers only have a small amount.‬

‭Clock Speed‬
‭What is clock speed?‬
‭-‬ ‭Clock speed is the measure of how quickly a CPU can process instructions. Clock speed is measured in‬
‭Gigahertz (GHz). A typical desktop computer might have a clock speed of 3.5 GHz. This means it can‬
‭perform 3.5 billion cycles a second.‬

‭ ow does clock speed improve‬


H
‭performance?‬
‭-‬ ‭The faster the clock speed, the‬
‭faster the computer can‬
‭perform the FDE cycle resulting‬
‭in better performance because‬
‭more instructions can be‬
‭processed each second.‬

‭How does overclocking and underclocking affect performance?‬


‭-‬ ‭Say a CPU runs at‬‭3.5 GHz‬‭from factory:‬
‭-‬ O ‭ verclocking‬‭(say, to‬‭3.9 GHz‬‭) is when the computer's clock speed is increased higher than the‬
‭recommended rate. This will make the computer perform faster, but it can lead to overheating‬
‭and could damage the machine.‬
‭-‬ ‭Underclocking‬‭(say to‬‭3.1 GHz‬‭) is when the computer's clock speed is decreased lower than the‬
‭recommended rate. This will make the computer perform slower but will increase the lifespan of‬
‭the machine‬

‭Core Count‬
‭What is a core?‬
‭-‬ ‭A core is a complete set of CPU components (control unit, ALU and registers). Each core is able to‬
‭perform its own FDE cycle. A multi-core CPU has more than one set of components within the same‬
‭CPU.‬
‭How does the number of cores improve performance?‬
‭-‬ ‭In theory, a single-core processor can execute one instruction at a time, a dual-core processor can‬
‭execute two instructions, and a quad-core can execute four instructions simultaneously. Therefore, a‬
‭computer with more cores will have a higher performance because it can process more instructions at‬
‭once.‬
‭What are the limitations of having more cores?‬
‭-‬ ‭If one core is waiting for another core to finish processing, performance may not increase at all. Some‬
‭software is also not written to make use of multiple cores, so it will not run any quicker on a multi-core‬
‭computer.‬

‭1.3 - Embedded Systems‬

‭ n embedded system is a computer system built into a larger machine to provide a means of control.‬
A
‭Embedded systems perform a specific pre-programmed task which is stored in ROM. An embedded system‬
‭uses a combination of hardware and software. They perform only specific tasks and often have a small‬
‭amount of storage and low processing power.‬

‭ xample‬‭:‬‭A washing machine has a‬


E
‭control chip that manages the‬
‭different program cycles.‬

‭ xample‬‭:‬‭A traffic light has a‬


E
‭control chip that determines when‬
‭to change to a green or red light.‬
‭1-2: Memory & Storage‬
‭Topic Contents:‬
‭ .1‬‭- Primary Storage‬
2
‭2.2‬‭- Secondary Storage‬
‭2.3‬‭- Units‬
‭2.4a‬‭- Number Storage‬
‭2.4b‬‭- Character Storage‬
‭2.4c‬‭- Image Storage‬
‭2.4d‬‭- Sound Storage‬
‭2.5‬‭- Compression‬

‭2.1 - Primary Storage‬

‭Primary vs Secondary storage‬


‭Storage in a computer is split into two categories:‬
‭-‬ ‭Primary Storage:‬
‭-‬ ‭Very quick‬‭as it is‬‭directly accessed‬‭by CPU‬
‭-‬ ‭Typically‬‭smaller‬‭in storage side‬
‭-‬ ‭Sometimes called‬‭‘Main Memory’‬
‭-‬ ‭Includes‬‭RAM‬‭and‬‭ROM‬
‭-‬ ‭Secondary Storage:‬
‭-‬ ‭Slower‬‭as it is‬‭not directly accessed‬‭by the CPU‬
‭-‬ ‭Typically‬‭larger‬‭in storage size‬
‭-‬ ‭Used for‬‭long-term storage‬‭of files as it is‬‭non-volatile‬
‭-‬ ‭Includes‬‭Magnetic‬‭,‬‭Optical‬‭, and‬‭Solid State‬‭storage.‬

‭Volatile vs Non-Volatile storage‬


‭Storage in a computer is also split into two other categories:‬
‭-‬ ‭Volatile‬‭storage is temporary: data is‬‭lost‬‭when the power is‬‭turned off‬‭(For Example,‬‭RAM‬‭)‬
‭-‬ ‭Non-volatile‬‭storage‬‭saves‬‭the data even when not being‬‭powered‬‭. Data can be stored‬‭long-term‬‭and‬
‭accessed when the computer is turned on (For Example,‬‭ROM‬‭)‬

‭Why do computers need Primary storage?‬


‭Primary storage is‬‭low-capacity‬‭, internal storage that can be‬‭directly accessed‬‭by the CPU.‬

‭ rogram instructions and data must be‬‭copied‬‭from the hard drive into RAM to be processed by the CPU‬
P
‭because‬‭primary storage‬‭access speeds are much‬‭faster‬‭than secondary storage devices like the hard drive.‬

‭Types of Primary storage (Memory)‬


‭-‬ ‭Random Access Memory‬‭(RAM):‬
‭-‬ R ‭ AM is‬‭volatile‬‭(temporary) storage that stores all programs that are‬‭currently running‬‭. It also‬
‭stores parts of the‬‭operating system‬‭to be accessed by the CPU. It is made up of a large number‬
‭of storage locations, each can be identified by a‬‭unique address‬‭.‬
‭-‬ ‭Read-Only Memory‬‭(ROM):‬
‭-‬ ‭ROM is‬‭non-volatile‬‭storage that cannot be changed. ROM stores the boot program /‬‭BIOS‬‭for‬
‭when the computer is switched on. The BIOS then‬‭loads up the operating‬‭system‬‭to take over‬
‭managing the computer.‬

‭Virtual Memory‬

‭ rograms must be‬‭stored in RAM‬‭to be‬‭processed‬‭by the CPU. Even if there is insufficient space in RAM for all‬
P
‭programs the computer can use the‬‭hard disk drive‬‭(HDD) as an‬‭extension of RAM‬‭- this is called‬‭virtual‬
‭memory‬‭. If new data is needed to be stored in RAM then‬‭unused data‬‭in RAM is moved to the‬‭hard drive‬‭so the‬
‭new data can be transferred into RAM‬‭. If the original data is required again, it can be‬‭moved back‬‭from‬
‭virtual memory into RAM. Using virtual memory is beneficial because it allows‬‭more programs‬‭to be run at the‬
‭same time with‬‭less system slow down‬‭.‬

‭2.2 - Secondary Storage‬

‭ econdary storage is‬‭non-volatile‬‭storage used to‬‭save and store‬‭data that can be‬‭accessed repeatedly‬‭.‬
S
‭Secondary storage is‬‭not directly embedded‬‭on the motherboard (and possibly even external) and therefore‬
‭further away from the CPU so it is‬‭slower to access‬‭the primary storage.‬

‭Magnetic Storage‬
‭ magnetic hard disk drive (‬‭HDD‬‭) is the‬‭most common form of secondary storage‬‭within desktop computers.‬
A
‭A‬‭read/write‬‭head moves‬‭nanometres‬‭above the disk platter and uses the magnetic field of the platter to‬‭read‬
‭or edit‬‭data. An‬‭obsolete‬‭(no longer used) type of magnetic storage is a floppy disk but these have been‬
‭replaced‬‭by‬‭solid state devices‬‭such as USB sticks which are much faster and have a much higher capacity.‬
‭Another type of magnetic storage that is still used is‬‭magnetic tape‬‭. Magnetic tape has a‬‭high storage‬
‭capacity‬‭but data has to be accessed in‬‭order‬‭(serial access) so it is generally only used by‬‭companies‬‭to back‬
‭up or archive‬‭large amounts of data‬‭.‬

‭Magnetic Storage Characteristics (Hard Disk Drive):‬


‭-‬ ‭Large‬‭capacity‬‭and‬‭cheaper cost per gigabyte‬‭than solid state.‬
‭-‬ ‭Modern external HDDs are‬‭small‬‭and‬‭well protected‬‭so they are‬‭durable‬‭and‬‭portable‬‭, however‬
‭because of the moving parts, they should‬‭not be moved‬‭when‬‭powered on‬‭because it can‬‭damage‬‭the‬
‭device.‬
‭-‬ ‭Slower‬‭access speed‬‭than solid state but faster than optical storage.‬

‭Optical Storage‬
‭ ptical storage uses a laser to project beams of light onto a spinning disc, allowing it to read data from a CD,‬
O
‭DVD or Blu-Ray. This makes optical storage the slowest of the four types of secondary storage. Disc drives are‬
‭traditionally internal but external disc drives can be bought for devices like laptops.‬

‭Optical Storage Characteristics:‬


‭-‬ ‭Low capacity‬‭: 700 MB (CD), 4.7 GB (DVD), 25 GB (Blu-ray).‬
‭-‬ ‭Not‬‭durable‬‭because discs are very‬‭fragile‬‭and can‬‭break or scratch‬‭easily.‬
‭-‬ ‭Discs are‬‭Thin‬‭and‬‭Very Portable‬‭. Also very‬‭cheap‬‭to buy in bulk.‬
‭-‬ ‭Optical discs have the‬‭slowest access speed‬‭.‬

‭Solid State Storage‬


‭ here are‬‭no moving parts‬‭in solid state storage. SSDs (Solid State Drives) are replacing magnetic HDDs (Hard‬
T
‭Disk Drives) in modern computers and video game consoles because they are generally‬‭quieter‬‭,‬‭faster‬‭and use‬
‭less power‬‭. A USB flash drive (USB stick) is another type of solid state‬
‭storage that is used to‬‭transport files‬‭easily because of its small size. Memory cards, like the SD card in a‬
‭digital camera or a Micro SD card in a smartphone, are another example of solid state storage.‬

‭Solid State Characteristics:‬


‭-‬ ‭More‬‭expensive cost per gigabyte‬‭than magnetic.‬
‭-‬ ‭Usually‬‭durable‬‭but cheap USB sticks can snap or break.‬
‭-‬ ‭The small size of USB sticks and memory cards and can fit easily in a bag or pocket mean they are‬‭very‬
‭portable‬
‭-‬ ‭Solid State Storage has a‬‭high capacity‬‭and the‬‭fastest access‬‭speed because they contain no moving‬
‭parts.‬

‭2.3 - Units‬
‭ ll computer systems‬‭communicate‬‭,‬‭process‬‭, and‬‭store‬‭data using binary. Binary is a‬‭number system‬
A
‭consisting entirely of‬‭0s‬‭and‬‭1s‬‭. Computers use binary as they consist of‬‭billions‬‭of tiny‬‭transistors‬‭which are‬
‭switches that only have‬‭two values‬‭-‬‭on‬‭(1) or‬‭off‬‭(0). Therefore all data‬‭must be represented‬‭in this way.‬
‭Everything a computer needs to process must be converted into a binary format including text, images, videos,‬
‭and audio.‬

‭Units of Data Storage‬


‭ its (b)‬
B ‭ ifferent exam board but‬‭:‬
D
‭x8 =‬‭Bytes‬‭(B)‬ ‭x1024 = Kibibyte (KiB)‬
‭x1000 =‬‭Kilobytes‬‭(KB)‬ ‭x1024 = Mebibyte (KiB)‬
‭x1000 =‬‭Megabytes‬‭(MB)‬ ‭x1024 = Gibibyte (KiB)‬
‭x1000 =‬‭Gigabytes‬‭(GB)‬ ‭x1024 = Tebibyte (TiB)‬
‭x1000 =‬‭Terabytes‬‭(TB)‬ ‭x1024 = Pebibyte (PiB)‬
‭x1000 =‬‭Petabytes‬‭(PB)‬
‭2.4a - Number Storage‬

‭Binary & Denary‬


‭ inary is a‬‭base 2‬‭number system (Only‬‭two‬‭possible values per character -‬‭0 or 1‬‭) that computers use to‬
B
‭process data and communicate‬‭. Denary, on the other hand, is the‬‭base 10‬‭number (‬‭ten‬‭possible values per‬
‭character -‬‭0 to 9‬‭) system that you have been using your whole life.‬
Binary to Denary [OCR]
Denary to Binary [OCR]

‭Hexadecimal‬
‭ exadecimal is a‬‭base 16‬‭(‬‭sixteen‬‭possible values per character -‬‭0 to 16‬‭) number system. It is used as a‬
H
‭shorthand‬‭for binary because it uses‬‭fewer characters‬‭to write the‬‭same value‬‭. This makes hexadecimal less‬
‭prone to‬‭errors‬‭when reading or writing it, compared to binary.‬
‭Hexadecimal‬‭only‬‭uses‬‭single-character‬‭values. Double digit numbers are converted into numbers (‬‭A‬‭to F‬
‭instead of‬‭10 to 15‬‭).‬
Binary to Hexadecimal [OCR]
Hexadecimal to Binary [OCR]
‭To convert from‬‭Hexadecimal‬‭to‬‭Denary‬‭(or inverse) you need to convert either one to‬‭Binary‬‭first.‬

‭2.4b - Character Storage‬


‭What is a character set?‬
‭ ‬‭character set‬‭is a table that matches together a character and a binary value. Each character in a‬
A
‭character set has a‬‭unique binary number‬‭matched with it. Character sets are necessary as they‬‭allow‬
‭computers to exchange data and humans to input characters‬‭. Two common character sets are ASCII and‬
‭Unicode:‬

‭Ascii‬
‭ SCII (American Standard Code for Information Interchange) is a common character set which does not take‬
A
‭up much memory space. It is important to understand that the number of characters that can be stored is‬
‭limited by the bits available -‬‭ASCII uses 1 byte (8 bits)‬‭which only gives 256 possible characters. This is enough‬
‭for the English language but it can’t be used for other languages or all punctuation symbols.‬

‭Unicode‬
‭ nicode is a more popular character set because it uses‬‭2 bytes (16 bits) that allow for 65,536 possible‬
U
‭characters.‬‭The extra byte allows many different languages to be represented, as well as thousands of‬
‭symbols and emojis. However‬‭Unicode requires more memory‬‭to store each character than ASCII as it uses an‬
‭extra byte.‬
‭—--‬
‭Character sets are logically ordered. For example, the binary code for‬‭A is 01000001, B is 01000010 and C is‬
‭01000011‬‭as the code increases by 1 with each character.‬
‭The file size of a text file is calculated with the equation: bits per‬‭character x number of characters‬
‭2.4c - Image Storage‬
‭Bitmap Images‬
‭ itmap images are made of pixels -‬‭single-colour squares‬‭- arranged on a grid. Each pixel is assigned a‬
B
‭binary value which represents the colour of that pixel. The quality of a bitmap image depends on the total‬
‭amount of pixels, this is known as the‬‭image resolution.‬‭Because it is made up of pixels, scaling up a bitmap‬
‭image will result in a visible loss of quality. Most images on computers are bitmaps, such as photos and‬
‭screenshots.‬

‭Vector Images‬
‭ ector images are drawn by the computer following precise mathematical instructions to create lines and‬
V
‭objects. Vectors are usually‬‭smaller in file size compared to bitmaps‬‭because each pixel in a bitmap is‬‭stored‬
‭as an individual binary value‬‭. Vectors can be scaled up without any loss of quality and are typically used for‬
‭logos and animations.‬

‭How to calculate the file size of a bitmap‬


‭bitmap file size = resolution x colour depth‬
‭ he Resolution of an image is the‬‭width in pixels‬‭multiplied by the height in pixels‬
T
‭The colour depth (also known as bit depth) is the number of bits that are used to represent each pixel's colour. 1‬
‭bit represents 2 colours (0 or 1 / black or white). 2 bits will allow for 4 colours, 3 bits for 8 colours etc. A colour‬
‭depth of 1 byte (8 bits) allows for 256 different colours. Remember you must multiply the colour depth, not the‬
‭number of available colours (eg 8 not 256). The RGB colour model uses 3 bytes (a byte of 256 red shades, a‬
‭byte of 256 green shades and a byte of 256 blue shades). That together can represent 16.7 million different‬
‭colours.‬
‭This also means that, in a typical 1080p (1920x1080 or 2073600 pixel) image, there are 6,220,800 B, or‬
‭6.22MB. In a 1440p (2560x1440 or 3686400 pixel) image, 11,059,200 B or 11MB, etc.‬

‭Metadata for images‬


‭Metadata is additional information about an image. Common metadata includes:‬
‭-‬ ‭Resolution‬
‭-‬ ‭Geolocation‬
‭-‬ ‭Date created‬
‭-‬ ‭Last edited‬
‭-‬ ‭File type‬
‭-‬ ‭Author details‬
‭Metadata is important, For example, the dimensions must be known so the image can be displayed correctly‬

‭2.4d - Sound Storage‬


‭Converting analogue Sound to Binary‬
‭ nalogue Sound waves must be digitally recorded and stored in binary.‬
A
‭To record the sound, the amplitude (height) of the analogue sound wave is measured and recorded in binary at‬
‭specific intervals.‬
‭Sampling an Analogue Sound Wave‬
‭ igital sampling is discrete (separate) and not continuous like analogue waves. To get the highest quality‬
D
‭sound, many samples are taken to recreate the analogue wave as closely as possible.‬

‭Sample Rate‬
‭ he sample rate (sampling frequency) is the number of times per second the amplitude of the sound wave is‬
T
‭measured. It is measured in kilohertz (kHz), for example CD quality is 44.1kHz (44,100 samples per second).‬
‭The higher the sampling rate is, the better the quality is, but also the larger the file size is.‬

‭Bit depth‬
‭ he bit depth is the number of bits available to represent each sample. For example, a sample with a bit depth‬
T
‭of 4 could be 0101 or 0110. A sample with a bit depth of 8 could be 01010111 or 11010100. A common bit depth is‬
‭16 bits.‬
‭The higher the bit depth, the more bits are available to be used for each sample. Therefore the quality is often‬
‭higher as the wave more closely resembles an analog wave.‬
‭The file size will also be larger if the bit depth is higher, as each sample stores additional bits.‬

‭Calculating the file size‬


‭The file size‬‭in bits‬‭can be calculated using the‬‭following equation:‬

‭sound file size = sample rate x bit depth x duration‬

‭2.5 - Compression‬
‭What is compression‬
‭To compress a file is to make the file size smaller. There are many benefits to compression, such as:‬
‭-‬ ‭Files are smaller (naturally)‬
‭-‬ ‭Files can be transferred easier‬
‭-‬ ‭Files can be read from or written to quicker‬
‭There are 2 methods of compression; Lossy and Lossless compression.‬

‭Lossy Compression‬
‭ ossy compression uses an algorithm to analyse a file and remove data that cannot be heard or seen by‬
L
‭humans. For example, a lossy algorithm would analyse the sound waves of an audio file and remove any‬
‭frequencies that humans cannot hear. This process reduces the size of the file.‬
‭Further lossy compression will remove data that humans can see/hear. Lossy compression removes the data‬
‭permanently, so the file can never return to its original form. It is often used with images, audio, and video to‬
‭reduce the file size, for example to send over the internet.‬

‭Lossless Compression‬
‭ ossless compression reduces the file size without removing any data. Because of this, the file is returned to its‬
L
‭original form when decompressed, so no quality is lost. A file that is compressed with a lossless algorithm is‬
‭ sually larger than a file compressed with a lossy algorithm because no data has been permanently removed.‬
u
‭Lossless compression is used with files that would not work if data was removed, for example .exe files or word‬
‭documents.‬

‭1-3: Networks‬
‭Topic Contents:‬
‭ .1a‬‭- Network Types & Performance‬
3
‭3.1b‬‭- Network Hardware & Internet‬
‭3.2a‬‭- Wired & Wireless networks‬
‭3.2b‬‭- Protocols & Layers‬

‭3.1a - Network Types & Performance‬


‭Local Area Network‬
‭ Local Area Network (LAN)‬‭has computer systems situated‬‭geographically close together, usually within the‬
A
‭same‬‭building‬‭or‬‭small site‬‭, like a‬‭school or office‬‭.‬‭The network infrastructure of a LAN (such as servers and‬
‭routers) is usually owned and managed by the‬‭network‬‭owner‬

‭Wide Area Network‬


‭ ‬‭Wide Area Network (WAN)‬‭has computer systems situated‬‭geographically distant‬‭to each other, possibly‬
A
‭across a country or even the world. WANs often use‬‭third party‬‭communication channels, such as connections‬
‭by internet services providers like BT or Virgin Media.‬

‭ ther network types do exist, such as a‬‭Metropolitan‬‭Area Network (MAN)‬‭for computer systems connected‬
O
‭across a town or city‬‭, or a‬‭Personal Area Network‬‭(PAN)‬‭for devices connected and used by an‬‭individual‬‭.‬

‭Client-Server Network‬
‭ lients make requests to a server, the server manages that request, and then responds. For example, if the‬
C
‭user (client) makes a request to access docs.google.com to a web server.‬
‭Large services like Amazon and Google will need very powerful servers to handle millions of requests a second.‬
‭The client is completely dependent on the server to provide and manage the information. The server controls‬
‭network security, backups and can be upgraded to manage higher demand.‬

‭Advantages:‬ ‭Disadvantages:‬
‭-‬ T ‭ he network can be‬‭controlled centrally‬ ‭-‬ L ‭ arge amounts of traffic congestion will cause‬
‭from the server to‬‭easily backup data‬‭and‬ ‭the network to‬‭slow down‬‭.‬
‭update software‬‭.‬ ‭-‬ ‭If a fault occurs with the server then the‬‭whole‬
‭-‬ ‭Hardware, software and resources can be‬ ‭network will fail‬
‭shared across the network‬‭, such as‬ ‭-‬ ‭IT Technicians may be required to‬‭manage‬‭and‬
‭printers, applications and data files.‬ ‭maintain the network‬
‭-‬ ‭The network allows for‬‭improved‬ ‭-‬ ‭Malware, such as viruses, can‬‭spread quickly‬
‭scalability‬‭, meaning more clients can be‬ ‭across the network.‬
‭easily added‬‭to the central server.‬
‭Data Packets‬
‭ hen sending data across a network, files are broken down into smaller parts called‬
W
‭data packets. Whole files are too large to transfer as one unit so data packets allow‬
‭data to be transferred across a network quickly. Each packet of data is redirected‬
‭by routers across networks until it arrives at its destination. Data packets may split‬
‭up and use alternative routes to reach the destination address. When all the packets‬
‭have arrived at the destination address the data is reassembled back into the‬
‭original file.‬

‭Network Topologies‬
‭ etwork topology refers to layout of computer systems on a local network. Devices‬
N
‭in a network topology diagram are often called 'nodes'. Two types of typology are‬
‭star and mesh.‬

‭Star Topology‬
‭ ach computer system is connected to a central device, usually a hub or switch.‬
E
‭How it works:‬
‭-‬ ‭Each computer system is connected to the central hub or switch and transfers its‬
‭data packets there.‬
‭-‬ ‭The hub or switch looks at the destination address and transfers the packets‬
‭directly to the intended computer.‬

‭Advantages:‬ ‭Disadvantages:‬
•‭ A star topology has improved security because‬ •‭ Extra hardware (the hub or switch) is required to be‬
‭data packets are sent directly to and from the hub /‬ ‭purchased, installed and maintained.‬
‭switch in the centre and not necessarily all devices‬ ‭• If the central system (the hub or switch) fails then‬
‭like in a bus or ring topology.‬ ‭the whole network will be unusable until the error is‬
‭• New systems can be attached directly to the central‬ ‭fixed.‬
‭system so the network doesn't need to be shut down.‬
‭System failures of attached computers won't usually‬
‭cause complete network failure.‬
‭• Transfer speeds are generally fast in a star‬
‭topology as there are minimal network collisions.‬

‭Mesh Topology‬

I‭ n a‬‭full mesh network‬‭, each computer system is connected‬‭to every other computer‬
‭system. There is also a‬‭partial‬‭mesh network where‬‭only‬‭some nodes‬‭(e.g. a printer)‬
‭are connected to every other node.‬
‭How it works:‬
‭-‬ ‭Data packets are transferred to the destination address along the quickest‬
‭path, travelling from node to node‬
‭-‬ ‭If a pathway is broken, there are many alternative paths that the packets can take‬

‭Advantages:‬ ‭Disadvantages:‬
•‭ If one cable or system fails then‬‭data packets‬‭can‬ •‭ Because of the‬‭possibly large‬‭amount of cables‬
‭take an‬‭alternative route‬‭and still reach the‬ ‭required (esp in a‬‭full mesh‬‭topology) this network‬
‭destination address.‬ ‭layout can be‬‭expensive‬‭to‬‭install and maintain‬
‭• Because of the large possible number of systems‬ ‭•‬‭Redundant cabling‬‭should be avoided - which is‬
‭and connections, a mesh topology can usually‬ ‭where cables are connected between systems that‬
‭withstand large amounts of data traffic‬ ‭won't‬‭ever‬‭need to communicate‬
‭•‬‭New systems‬‭can be‬‭added‬‭to the network‬‭without‬
‭disrupting the entire topology‬

‭Performance‬
‭There are several factors that can affect the performance of a network, such as:‬
‭1.‬ ‭Bandwidth‬‭- Max amount of data that can be sent across‬‭a network at any point‬
‭2.‬ ‭Number of users at the same time‬‭- The number of users‬‭accessing the network‬
‭3.‬ ‭Number of data collisions‬‭- 2+ data packets trying‬‭to occupy the same channel at the same time‬
‭4.‬ ‭Interference‬‭- Obstacles that may block signal slightly‬‭(eg, thick walls)‬
‭5.‬ ‭Transmission Media‬‭- The method of data transmission‬‭across the network‬
‭6.‬ ‭Distance to travel‬‭- How far the data has to travel‬‭to reach its destination‬
‭7.‬ ‭Signal strength‬‭- How well the signal is transmitted‬‭across a network‬
‭8.‬ ‭Amount of data to transfer‬‭- How much data is being‬‭transferred across the network‬
‭9.‬ ‭Applications being used‬‭- The amount of applications‬‭asking for data across the network‬
‭10.‬‭Server CPU performance‬‭- The performance capability‬‭of the CPU in the server router‬
‭11.‬ ‭Network Latency‬‭- The time that data takes to transfer‬‭across the network‬

‭ o increase performance, you need to increase bandwidth and decrease latency.‬


T
‭Factors which affect‬
‭Bandwidth:‬
‭-‬ ‭Transmission media - fibre optic is fastest‬
‭-‬ ‭Number of users on the network - sharing the bandwidth slows the network‬
‭-‬ ‭Type of traffic - Streaming HD video slows the network as it requires more information to be sent‬
‭Latency:‬
‭-‬ ‭Connection Speed - Higher connection speed = lower latency‬
‭-‬ ‭Transmission Errors - Causes the packet to be resent, increasing latency‬

‭3.1b - Network Types & Performance‬


‭Network devices‬
‭ hen sending data across a network, files are‬‭broken‬‭down‬‭into smaller parts called‬‭data packets.‬‭Whole‬‭files‬
W
‭are too large to transfer as one unit so data packets allow data to be‬‭transferred across a network quickly‬‭.‬
‭Each packet of data is‬‭redirected‬‭by routers across‬‭networks until it arrives at its destination. Data packets‬
‭may split up and‬‭use‬‭alternative‬‭routes‬‭to reach the‬‭destination address.‬
‭ hen all the packets have arrived at the destination address the‬‭data is reassembled‬‭back into the original‬
W
‭file‬

‭ ireless access point‬


W
‭A‬‭Wireless Access Point‬‭provides a‬‭link between wireless‬‭and wired networks‬‭. It creates a‬‭wireless local‬
‭area‬‭network‬‭that allows‬‭WiFi-enabled devices‬‭to connect‬‭to a wired network. Examples of a wireless access‬
‭point in a public space could be a‬‭WiFi or Bluetooth‬‭hotspot‬‭, for example a WiFi hotspot in a coffee shop‬‭or‬
‭airport to provide access to the internet.‬
‭A wireless access point may be a‬‭separate device‬‭or‬‭built into another device‬‭.‬

‭ outer‬
R
‭Routers‬‭are used to‬‭transfer data packets between‬‭networks‬‭.‬‭Routers‬‭receive data packets‬‭and use the‬‭IP‬
‭Address in the‬‭packet header‬‭to determine the‬‭best‬‭route‬‭to transmit the data. Data is transferred from‬
‭router to router‬‭across the internet towards the‬‭destination‬‭.‬‭A router stores the IP address of each computer‬
‭connected to it‬‭on the network and uses a list called‬‭a‬‭routing table‬‭to calculate the quickest and shortest‬
‭route to transfer data.‬

‭ witch‬
S
‭A‬‭switch‬‭is used to‬‭connect devices together‬‭on a‬‭LAN‬‭.‬
‭It‬‭receives data packets‬‭from a connected node,‬‭reads‬‭the destination address in the packet header‬‭and‬
‭forwards the data directly‬‭to its destination.‬
‭A switch will‬‭generate a list of the MAC addresses‬‭of all devices connected‬‭to it‬‭when it receives data‬‭,‬‭and‬
‭muse‬‭scan for a matching destination address‬‭before‬‭sending.‬
‭An alternative to a switch is a‬‭hub‬‭but a‬‭hub is slower‬‭and less secure‬‭as it‬‭forwards a copy of received‬‭data‬
‭to all connected nodes.‬

‭ etwork Interface Card‬


N
‭A‬‭Network Interface Controller (NIC)‬‭commonly also‬‭known as a‬‭Network Interface Card‬‭is an‬‭internal‬‭piece‬
‭of hardware‬‭that is‬‭required‬‭for the computer to connect‬‭to a network.‬
‭The card includes a‬‭MAC address‬‭which is‬‭used when‬‭sending data across a LAN‬‭.‬
‭An‬‭ethernet cable‬‭is plugged into the network card‬‭to‬‭allow data to be exchanged‬‭between the device‬‭and a‬
‭network.‬
‭A NIC used to be a‬‭separate expansion card‬‭but is‬‭now typically‬‭embedded on the motherboard‬‭.‬

‭ ransmission Media‬
T
‭Although not technically a device the‬‭communication‬‭channel‬‭along which data is transferred will‬‭affect‬
‭performance‬‭. Three common types of transmission media‬‭include:‬
‭●‬ ‭Ethernet cables‬‭- used typically on a‬‭LAN‬‭to‬‭transfer‬‭data‬‭between nodes and hardware such as‬
‭switches‬
‭●‬ ‭Fibre Optic cables‬‭-‬‭very fast‬‭but‬‭more expensive‬‭and‬‭fragile‬‭cables typically used to‬‭send data‬
‭quickly along a WAN‬‭. Data is sent as‬‭pulses of light.‬
‭●‬ ‭Coaxial cables‬‭-‬‭older, slower, copper‬‭cables that‬‭are not used as much in modern times as they can be‬
‭affected by electromagnetic interference‬‭.‬
‭The Internet‬
‭ hat is it?‬
W
‭The internet is a‬‭global network‬‭of‬‭interconnected‬‭networks‬‭, The‬‭world wide web‬‭(‭W ‬ WW‬‭) is not the same‬‭as‬
‭the internet. It is a way of‬‭accessing information‬‭,‬‭using protocols such as‬‭HTTPS‬‭to‬‭view web‬‭pages‬‭(such‬‭as‬
‭the tab of‬‭You‬‭tube‬‭open in the background).‬
‭Servers‬‭provide‬‭services on the internet‬‭, such as‬‭a‬‭web server‬‭which‬‭responds to the web browser‬‭(client)‬
‭request‬‭to‬‭display a web page‬‭. The web server‬‭processes‬‭the client request‬‭to prepare the web page and‬
‭return it so the web browser can‬‭display it to the‬‭user‬‭.‬
‭A‬‭website must be hosted‬‭(stored) on a web server‬‭so that it can be accessed by others using the internet.‬
‭A‬‭unique domain name‬‭(eg. google.com) must be registered‬‭with a‬‭domain registrar‬‭- this is a company that‬
‭checks if the name is valid and‬‭not already taken‬

‭DNS Servers‬

‭ ‬‭DNS‬‭(‬‭Domain Name System‬‭)‬‭server‬‭stores a‬‭list of‬‭domain names‬‭and a list of‬‭corresponding IP addresses‬


A
‭where the website is stored.‬
‭The first thing to understand is that every web page has a domain name that is easy for‬‭humans to remember‬
‭and type in‬‭(such as docs.google.com) as well as a‬‭related IP‬‭address‬‭(such as 65.14.202.32) which is‬‭a‬‭unique‬
‭address‬‭for the‬‭device that the web page is stored‬‭on‬‭.‬
‭Steps taken to display a web page:‬
‭1.‬ ‭A domain name is typed into the‬‭address bar of a browser‬
‭2.‬ ‭A query is sent to the‬‭local DNS‬‭server for the‬‭corresponding‬‭IP address of the domain‬‭name‬
‭3.‬ ‭The local DNS server will check if it holds an IP address corresponding to that domain name‬
‭a.‬ ‭If it does‬‭, it passes the‬‭IP address to your browser‬
‭b.‬ ‭If it does not‬‭, the query is passed onto‬‭another DNS‬‭server‬‭at a‬‭higher level‬‭until the IP address‬
‭is resolved‬
‭4.‬ ‭The browser then connect to the‬‭IP address of the‬‭server‬‭and‬‭access the website‬

‭ he Cloud‬
T
‭The‬‭cloud‬‭refers to‬‭networks of servers accessed on‬‭the internet‬‭. Cloud computing is an example of‬‭remote‬
‭service provision‬‭. Cloud servers can have different‬‭purposes such as‬‭running applications,‬‭remote processing‬
‭and‬‭storing data‬‭.‬
‭When you store data in ‘the cloud’, using services such as Google Drive or Dropbox, your data is stored on‬
‭large servers‬‭owned by the‬‭hosting company‬‭. The hosting‬‭company (such as Google) is responsible for‬
‭keeping the servers running and making your data‬‭accessible‬‭on the internet‬‭.‬
‭Cloud storage is‬‭very convenient‬‭as it allows people‬‭to work on a file at the‬‭same time‬‭and it can be‬‭accessed‬
‭from‬‭different devices‬‭. However, if the internet‬‭connection‬‭fails‬‭, or the servers are‬‭attacked‬‭then the data‬
‭could be inaccessible.‬

‭Cloud storage characteristics:‬


‭-‬ ‭Huge CAPACITY‬‭and you can‬‭upgrade‬‭your subscription‬‭if you need more storage.‬
‭-‬ ‭Cloud storage‬‭is typically‬‭free‬‭for a‬‭certain amount‬‭of storage‬‭. Users can then buy a‬‭subscription‬‭to‬
‭cover their needs.‬
‭-‬ C
‭ loud storage is difficult to rank in terms of‬‭PORTABILITY‬‭,‬‭DURABILITY‬‭, and‬‭ACCESS SPEED‬‭because‬
‭it depends on your‬‭internet connection‬‭. A‬‭fast connection‬‭would mean that cloud storage is very‬
‭portable‬‭, but a‬‭poor connection‬‭would make‬‭access‬‭difficult‬

‭ ebsite Creation‬
W
‭To create a website, you need to:‬
‭-‬ ‭Create the webpage‬
‭-‬ ‭Purchase a‬‭hosting agreement‬
‭-‬ ‭Register a‬‭domain name‬
‭-‬ ‭A‬‭domain name‬‭is the unique website name that people‬‭type‬‭in the browser‬‭URL bar‬‭to visit your‬
‭website. The domain name is associated with the‬‭IP‬‭address of the host computer‬‭or webs‬
‭server when it is registered‬

‭3.1c - Network Models‬

‭Client Server‬
‭ ‬‭Central Backup‬‭server backs up all file servers,‬‭where security is controlled by a central server. All users are‬
A
‭reliant on the central server. Using servers enables businesses to grow hundreds or thousands of computers‬
‭and users‬

‭Peer-to-Peer‬
‭ ach computer needs to be backed up, and security is controlled by each individual machine. There is no‬
E
‭central server. If one computer goes down then only its services are lost. Peer-to-Peer networks are difficult to‬
‭maintain beyond a few computers‬

‭Client Server‬ ‭Peer-to-Peer‬

‭Advantages:‬ ‭Advantages:‬
-‭ ‬ E ‭ asier to manage security files‬ -‭ ‬ ‭ ery easy to maintain‬
V
‭-‬ ‭Easier to take backups‬ ‭-‬ ‭Specialist staff are not required‬
‭-‬ ‭Easier to install software updates to all‬ ‭-‬ ‭No dependency on a single computer‬
‭computers‬ ‭-‬ ‭Cheaper to set up‬
‭Disadvantages:‬ ‭-‬ ‭No expensive hardware required‬
-‭ ‬ ‭ an be expensive to set up‬
C ‭Disadvantages:‬
‭-‬ ‭Requires IT specialists to maintain‬ -‭ ‬ T ‭ he network is less secure‬
‭-‬ ‭The server is a single point of failure‬ ‭-‬ ‭Users will need to manage their own backups‬
‭-‬ ‭Users will lose access if the server fails‬ ‭-‬ ‭Can be difficult to maintain a well ordered file‬

‭3.2a - Wired & Wireless Networks‬


‭Wired Networks‬
‭ ired Networks use Physical Cables, such as copper or fibre optic cables, and require a Network Interface‬
W
‭Card (NIC) to connect to a network.‬
‭These wired connections use a wired connection protocol - most commonly Ethernet.‬
‭1.‬ ‭Faster Speed‬
‭2.‬ ‭More Secure‬
‭3.‬ ‭Restricted Movement‬
‭4.‬ ‭Requires NIC‬

‭Wireless Networks‬
‭ ireless Networks, such as WiFi or Bluetooth, use no cables but require a Wireless Network Interface Card‬
W
‭(WNIC).‬
‭The most common type of wireless connection used in LANs is WiFi. Devices communicate using a Wireless‬
‭Access Point‬
‭Wireless connections generally have a slower speed and can be affected by the computer’s distance from the‬
‭router as well as obstacles like walls and bad weather‬
‭1.‬ ‭Slower Speed‬
‭2.‬ ‭Less Secure‬
‭3.‬ ‭Free Movement‬
‭4.‬ ‭Requires WNIC‬

‭3.2b - Protocols & Layers‬


‭A protocol is a set of rules that allow devices on a network to communicate with each other.‬

‭TCP / IP‬
‭(Transmission Control Protocol / Internet Protocol)‬

‭TCP/IP‬‭is actually‬‭two separate protocols‬‭that combine‬‭together:‬

‭-‬ T ‭ CP‬‭is a protocol that‬‭allows packets‬‭to be sent and‬‭received between computer systems. It‬‭breaks the‬
‭data‬‭into packets‬‭and‬‭reorders them back into the‬‭original data‬‭at the destination.‬
‭-‬ ‭IP‬‭is a protocol in charge of‬‭routing and addressing‬‭data packets‬‭. This‬‭ensures data packets are sent‬
‭across networks to the‬‭correct destination‬‭. It is‬‭also an‬‭addressing system‬‭- every device on a network‬
‭is given a‬‭unique IP address‬‭so data packets can be‬‭sent to the‬‭correct computer‬‭system.‬

‭HTTP‬
‭(Hypertext Transfer Protocol)‬

‭ TTP is used to transfer web pages over the Internet so that users can view them in a web browser. All URLs‬
H
‭start with either HTTP or HTTPS‬
‭(e.g.‬‭https://docs.google.com‬‭)‬

‭ TTPS is a more secure version of HTTP that works with another protocol called SSL (Secure Sockets Layer) to‬
H
‭transfer encrypted data. You should see a‬‭padlock‬‭symbol‬‭in the‬‭URL bar‬‭if your connection to that website‬‭is‬
‭secure.‬
‭Transfer Protocols‬

‭ TP‬‭(File Transfer Protocol) is used to transfer files‬‭across a network. It is commonly used to upload or‬
F
‭download files to/from a web server.‬

‭ MTP‬‭(Simple Mail Transfer Protocol) is a protocol‬‭used to send emails to a mail server and between mail‬
S
‭servers.‬

‭ OP‬‭(Post Office Protocol) and‬‭IMAP‬‭(Internet Message‬‭Access Protocol) are both protocols for receiving and‬
P
‭storing emails from a mail server:‬
‭-‬ ‭POP‬‭will delete an email from the email server once‬‭it has been downloaded to a device.‬
‭-‬ ‭IMAP‬‭syncs the message with an email server so it‬‭can be accessed by different devices.‬

‭IP Address & Mac Address‬


‭There are two versions of IP addressing currently used -‬‭IPv4‬‭and‬‭IPv6‬‭:‬
‭-‬ ‭IPv4 is a‬‭32-bit address‬‭, represented in‬‭denary‬‭, that‬‭allows for over‬‭4 billion unique addresses‬‭. It has‬
‭four 8-bit segments‬‭of‬‭denary values‬‭(‭f‬ rom 0 to 255‬‭)‬‭separated by‬‭full stops‬‭.‬
‭IPv4 example: 145.13.218.102‬
‭-‬ ‭IPv6 is a‬‭128-bit address‬‭, represented in‬‭hexadecimal‬‭,‬‭that allows for an‬‭undecillion unique‬‭addresses‬‭.‬
‭It has‬‭eight 16-bit segments‬‭of‬‭four hexadecimal values‬‭(‭0‬ 000 - FFFF‬‭), separated by‬‭colons‬‭.‬
‭IPv6 example‬‭: 736E:1029:A4B3:902D:77B2:72FF:AE62:091‬

‭ MAC address is a‬‭unique hexadecimal number‬‭assigned‬‭to each‬‭network interface card‬‭/controller inside‬‭a‬


A
‭networked device such as a router or laptop. A MAC address is a‬‭48-bit address‬‭made up of six 8-bit‬‭pairs in‬
‭hexadecimal,‬‭separated by dashes‬‭. While an IP address‬‭may change, the‬‭MAC address can’t be changed‬‭.‬
‭MAC stands for‬‭Media Access Control‬‭.‬

‭Networking Standards‬
‭ etworking standards‬‭are‬‭rules‬‭that‬‭allow computer‬‭systems to communicate across networks‬‭. Standards‬
N
‭have been created to‬‭ensure devices can exchange data‬‭and work together by‬‭interpreting signals in the‬
‭same way‬‭, regardless of the manufacturer.‬

‭TCP/IP Stack & Layers‬


‭ hat is TCP/IP?‬
W
‭TCP/IP (Transmission Control Protocol / Internet Protocol) is a set of protocols that operate on different layers.‬
‭These two protocols are used together to allow computers to communicate on a network.‬

‭ hat is a protocol layer?‬


W
‭A layer is a division of network functionality - each layer provides a specific function to assist the transmission‬
‭of the data that is being sent. TCP/IP is split into four layers (named Application, Transport, Internet and Link).‬
​‬‭
‭Important Note: You do not need to know any layer names or the purpose of any specific layers in the OCR‬
‭GCSE J277 specification, just what layers are and why they’re used.‬

​‬‭
‭Why are protocol layers used?‬
‭1.‬ ‭Layers are self-contained, so they allow different developers to concentrate on one aspect of the‬
‭network at a time. A layer can be taken out and edited without affecting other layers.‬
‭2.‬ ‭Protocol layers are used to visualise the different parts of a network, as each of the four layers of‬
‭TCP/IP has a specific role and is associated with different protocols.‬
‭3.‬ ‭Protocols are broken down into well-defined, specific layers to simplify design, making it easier to‬
‭identify errors (known as troubleshooting).‬
‭4.‬ ‭Each layer uses specific protocols, so layering ensures these protocols are applied in a specific order.‬
‭This process uses abstraction and layers only communicate with adjacent layers for easy compatibility.‬

‭1-4: Network Security‬


‭Topic Contents:‬
‭ .1‬‭- Network Threats‬
4
‭4.2‬‭- Preventing vulnerabilities‬

‭4.1 - Network Threats‬


‭Types of malware‬
‭Virus‬
‭-‬ A ‭ virus can replicate itself and spread from system to system by attaching itself to infected files.‬
‭-‬ ‭A virus is only activated when opened by a human.‬
‭-‬ ‭Once activated, a virus can change data or corrupt a system so that it stops working.‬

‭Worm‬
‭-‬ ‭A worm can replicate itself and spread from system to system by finding weaknesses in software.‬
‭-‬ ‭A worm does not need an infected file or human interaction to spread.‬
‭-‬ ‭A worm can spread very quickly across a network once it has infiltrated it.‬

‭Trojan‬
‭-‬ ‭A trojan is a harmful program that looks like legitimate software so users are tricked into installing it.‬
‭-‬ ‭A trojan secretly gives the attacker backdoor access to the system.‬
‭-‬ ‭Trojans do not self replicate or infect other files.‬

‭Spyware‬
‭-‬ ‭Spyware secretly records the activities of a user on a computer.‬
‭-‬ ‭The main aim of spyware is to record usernames, passwords and credit card information.‬
‭-‬ ‭All recorded information is secretly passed back to the attacker to use.‬
‭Keylogger‬
‭-‬ ‭A keylogger secretly records the key presses of a user on a computer. Data is sent back to the attacker.‬
‭-‬ ‭The main aim of a keylogger is to record usernames, passwords and credit card information.‬
‭-‬ ‭Keyloggers can be downloaded or plugged into the USB port.‬

‭Ransomware‬
‭-‬ ‭Ransomware locks files on a computer system using encryption so that a user can no longer access‬
‭them.‬
‭-‬ ‭The attacker demands money from the victim to decrypt (unlock) the data.‬
‭-‬ ‭Attackers usually use digital currencies like bitcoin which makes it hard to trace them.‬

‭SQL Injection‬
‭ QL (Structured Query Language) is a programming language used for manipulating data in databases. A‬
S
‭SQL injection is when a malicious SQL query (command) is entered into a data input box on a website. If the‬
‭website is insecure then the SQL query can trick the website into giving unauthorised access to the website’s‬
‭database. An SQL injection can be used to view and edit the contents of a database or even gain‬
‭administrator privileges.‬

‭DDos Attack‬
‭ DoS (Denial of Service) attack is when a computer repeatedly sends requests to a server to overload the‬
A
‭system. A server overload will slow the system and may take websites offline temporarily.‬
‭A DDoS (Distributed Denial of Service) attack is a coordinated attack using a botnet of infected systems to‬
‭overload a server with requests. A botnet is a large group of devices controlled and used maliciously by an‬
‭attacker.‬

‭Brute Force Attack‬


‭ very possible combination is tested in order from start to finish. This is not a quick method but it should break‬
E
‭the password eventually and can be sped up if multiple computer systems are used at the same time.‬

‭Social Engineering‬
‭ ocial engineering means to trick others into revealing their personal data by posing as a trusted source. For‬
S
‭example, impersonating an IT technician of a school via email and asking for a student's username and‬
‭password.‬

‭Data Interception‬
‭ his is when data packets on a network are intercepted by a third party (e.g. a hacker) and copied to a‬
T
‭different location than the intended destination. Software called packet sniffers are used to intercept and‬
‭analyse data packets.‬
‭4.2 - Preventing Vulnerabilities‬
‭Penetration Tests‬
‭ enetration tests are carried out as part of ethical hacking.‬
P
‭The purpose of a penetration test is to review the system's security to find any risks or weaknesses and to fix‬
‭them, and there are four main types of penetration tests:‬
‭-‬ ‭Internal tests are to see how much damage could be done by somebody within the company with a‬
‭registered account.‬
‭-‬ ‭External tests are for white hat hackers to try and infiltrate a system from outside the company.‬
‭-‬ ‭Blind tests are done with no inside information, to simulate what a real attacker would have to do to‬
‭infiltrate the system.‬
‭-‬ ‭Targeted tests are conducted by the company's IT department and the penetration team cooperating‬
‭together to find faults in the system‬

‭Anti-Malware Software‬
‭ nti-malware software is used to locate and delete malware, like viruses, on a computer system. The software‬
A
‭scans each file on the computer and compares it against a database of known malware. Files with similar‬
‭features to malware in the database are identified and deleted.‬
‭There are thousands of known malware, but new forms are created each day by attackers, so anti-malware‬
‭software must be regularly updated to keep systems secure.‬
‭Other roles of anti-malware software:‬
‭-‬ ‭Checking all incoming and outgoing emails and their attachments.‬
‭-‬ ‭Checking files as they are downloaded.‬
‭-‬ ‭Scanning the hard drive for viruses and deleting them.‬

‭Firewall‬
‭ firewall manages incoming and outgoing network traffic.‬
A
‭Each data packet is processed to check whether it should be given access to the network by examining the‬
‭source and destination address.Unexpected data packets will be filtered out and not accepted to the network.‬
‭Other roles of a firewall include:‬
‭●‬ ‭Blocking access to insecure‬‭/ malicious‬‭web sites‬‭.‬
‭●‬ ‭Blocking‬‭certain‬‭programs‬‭from‬‭accessing the internet‬‭.‬
‭●‬ ‭Blocking‬‭unexpected /‬‭unauthorised downloads‬‭.‬
‭●‬ ‭Preventing‬‭specific‬‭users‬‭on a network‬‭accessing certain‬‭files‬

‭Secure Passwords‬
‭ sernames must be matched with a secure password to minimise the chances of unauthorised users accessing‬
U
‭a system.Passwords should contain a mix of uppercase and lowercase letters, punctuation and numbers.‬
‭Passwords should be of a substantial length (at least 8 characters) and should be regularly changed.‬
‭User Access Levels‬
‭Access levels are used to only allow certain users to access and edit particular files.‬

'‭Read-Only' access is when a user can only view a file and is not allowed to change any data. For example, a‬
‭teacher might set homework instructions as read-only for students to view.‬

'‭Read and Write' access allows a user to read and edit the data in a file. For example, a teacher might set an‬
‭online workbook as read and write access for students to fill in.‬

I‭ t is important to set access levels so that only authorised users can view and change data. The more users who‬
‭have access to a file, the more likely it is to be compromised. Certain users may also have no access to a file -‬
‭when they can't view or edit it.‬

‭Encryption‬
‭ ncryption is the process of scrambling data into an unreadable format so that attackers cannot understand it‬
E
‭if intercepted during transmission.‬
‭The original data (known as plaintext) is converted to scrambled ciphertext using an encryption key. Only at‬
‭the correct destination will the encryption key be used to convert the ciphertext back into plaintext to be‬
‭understood by the receiving computer.‬

‭Physical Security‬
‭ lock can be used to prevent access to server rooms or locations that store confidential data. Only authorised‬
A
‭personnel with a matching key will have access. Biometric devices require the input of a human characteristic‬
‭(such a fingerprint, iris or voice). The biometric data is checked against previously inputted data in a database.‬
‭Only a match will allow access to the user. Other forms of physical security include keycards, security staff,‬
‭CCTV cameras and alarms.‬

‭1-5: Systems software‬


‭Topic Contents:‬
‭ .1‬‭- Operating Systems‬
5
‭5.2‬‭- Utility Software‬

‭5.1 - Operating Software‬


‭What is an operating system?‬
‭ n‬‭operating system‬‭(OS) is software that helps to‬‭manage the‬‭resources of a computer‬‭system and provide‬
A
‭the interface between the user and the computer's hardware.‬
‭There are‬‭five main functions‬‭of an operating system:‬
‭-‬ ‭Memory Management‬
‭-‬ ‭Peripheral Management‬
‭-‬ ‭User Management‬
-‭ ‬ F‭ ile Management‬
‭-‬ ‭User Interface‬
‭Memory Management & multitasking‬
‭ ll programs must be temporarily‬‭stored in‬‭RAM‬‭for‬‭the CPU to be able to process them. The OS transfers‬
A
‭programs‬‭in and out of memory‬‭from the‬‭hard drive‬‭(or‬‭virtual memory‬‭) when‬‭processing is required‬‭-‬
‭programs are removed from RAM when closed to free up space for other tasks. The operating system can only‬
‭perform one process at a time, but through‬‭memory‬‭management‬‭it can appear that more than one the‬
‭process is‬‭being executed - this is called multitasking.‬

‭Peripherals management & drivers‬


‭ peripheral is an external device connected to a computer system to input or output data. Data is transferred‬
A
‭between external devices and the processor and this process needs to be managed by the operating system.‬
‭A device driver is a program that provides an interface for the OS to interact and communicate with an‬
‭external device. Drivers are hardware dependent and OS-specific. The driver translates the OS' instructions‬
‭into a format the specific hardware can understand.‬
‭Because the CPU and the peripheral will process data at different speeds, a buffer is typically used to‬
‭temporarily store data until it can be processed.‬

‭User Management‬
‭ he OS allows users to create, manage and delete individual accounts. User accounts can be granted different‬
T
‭access rights such as an administrator or guest.‬
‭The OS will manage security settings such as allowing passwords to be reset and can also be used to monitor‬
‭login activity.‬

‭File Management‬
‭ he operating system creates and maintains a logical management system to organise files and directories‬
T
‭(folders). File management allows files to be named, renamed, opened, copied, moved, saved, searched for,‬
‭sorted and deleted. It also allows users to set access rights for specific files and to view file properties.‬

‭User Interface‬
‭ he final function of an operating system is to provide a user interface, allowing a human to interact with the‬
T
‭computer system.‬
‭The way in which a user can navigate a computer system is known as human-computer interaction (HCl).‬
‭Graphical User Interface‬
‭The most common type of user interface is a graphical user interface (GUI) which can be presented in the‬
‭following ways:‬
‭-‬ ‭Icons are displayed to represent shortcuts to applications and files.‬
‭-‬ ‭Multiple windows can be opened at the same time and switched between.‬
‭-‬ ‭The interface can be customised, such as changing font sizes and the desktop background.‬
‭-‬ ‭A folder and file system is displayed and manipulated allowing for copying, searching, sorting and‬
‭deleting data.‬
‭-‬ ‭System settings can be accessed such as network and hardware‬
‭-‬ ‭Menus can be opened from the start button to display files and shortcuts.‬
‭-‬ ‭The taskbar allows shortcuts to be pinned for quick access.‬

‭ ommand-Line Interface‬
C
‭Other types of user interface do exist, such as a‬‭command-line interface‬‭(CLI).‬
‭This type of interface is‬‭entirely text-based‬‭and‬‭requires users to interact with the system by‬‭typing‬
‭commands‬‭. This is a‬‭complicated‬‭process and mistakes‬‭could easily accidentally delete data. There are many‬
‭commands to learn so only‬‭experts‬‭who have been‬‭trained‬‭to learn this interface will be able to efficiently‬
‭make use of it.‬

‭ ouch-Sensitive Interface‬
T
‭Another type of user interface is a‬‭touch-sensitive‬‭interface‬‭, used with‬‭smartphones and tablets‬‭.‬
‭A human interacts with the device by‬‭pressing on a‬‭touchscreen‬‭, making it very intuitive and suitable‬‭for most‬
‭users without training. Touch-sensitive interfaces may not work with dirty or wet fingers and it will take longer‬
‭to write text compared to using a keyboard.‬

‭ enu-Driven Interface‬
M
‭A menu-driven interface‬‭displays data‬‭in a series‬‭of linked menus‬‭. Examples include‬‭cash machines‬‭(ATMs)‬
‭and‬‭old iPods‬‭.‬
‭This type of interface is generally‬‭user friendly‬‭and‬‭easy to use‬‭as commands do not need to be memorised.‬
‭However it can be‬‭annoying to find specific data‬‭through‬‭a large number of menus without a search feature.‬

‭ oice-Driven Interface‬
V
‭A voice-driven interface can be‬‭controlled by speaking‬‭commands‬‭aloud to a listening device. Examples‬
‭include Amazon's‬‭Alexa‬‭devices, Apple's‬‭Siri‬‭technology‬‭and‬‭Google Home‬‭.‬
‭This interface is‬‭intuitive‬‭, can be used‬‭hands-free‬‭and helps to‬‭speed up processes‬‭. However commands‬‭may‬
‭be misheard or‬‭limited in what can be performed‬‭.‬

‭5.2 - Utility Software‬


‭What is utility software‬
‭ tility software‬‭are‬‭dedicated programs‬‭used for the‬‭maintenance and organisation‬‭of a computer system‬
U
‭(this is known as ‘‬‭housekeeping‬‭’).‬‭Utilities are required‬‭to run‬‭additional tasks‬‭not performed‬‭by the operating‬
‭system.‬
‭Anti-Malware‬‭(such as an anti-virus or anti-spyware‬‭(WINDOWS DEFENDER IS ENOUGH)‬‭),‬‭firewall‬‭and‬‭encryption‬‭software‬
‭are‬‭examples of‬‭utilities‬‭and have been explained‬‭in‬‭section 4.2‬
‭Data compression is another utility (explained in‬ ‭section 2.5‬‭), along with‬‭backup software‬‭,‬‭disk cleaners‬‭and‬
‭auto-updaters‬

‭Defragmentation‬
‭ hat is fragmentation and how does it happen?‬
W
‭Over time files stored on a hard disk drive may become fragmented - this is when the file is split into parts that‬
‭are saved in different storage locations. Fragmentation occurs when there is limited contiguous space in which‬
‭to store a file. This may happen as data is stored and then later deleted on the hard drive. New files are‬
c‭ reated which may be bigger than the spaces left by the deleted files. The new files are then split up.‬
‭Fragmentation increases access time - files that are fragmented take longer to load and read because of the‬
‭distance between the fragments of the file.‬

‭ ow does defragmentation work?‬


H
‭Empty spaces are collected together on the hard disk drive and file fragments are moved to be stored‬
‭together. This means that fewer disc accesses are needed (requiring less physical movement) as file fragments‬
‭can be read consecutively.‬

‭ hat are the effects of defragmentation?‬


W
‭A defragmented file takes less time to read and access because the data is stored contiguously. The read/write‬
‭head of the hard drive does not need to move as far to read the next piece of data because it is in the adjacent‬
‭memory location , saving time.‬
‭It is also quicker to save new files because there is more free space together so it does not need to split the file‬
‭and can store the data contiguously.‬

‭1-6: Impacts‬
‭Topic Contents:‬
‭ .1a‬‭- Impacts of technology‬
6
‭6.1b‬‭- Legislation‬

‭6.1a - Impacts of technology‬


‭What are the issues created by technology?‬
‭ s the use of computers and technological devices continues to rise every year,‬
A
‭this increase brings with it a range of different types of issues. Categories of‬
‭issues described on this page include:‬
‭●‬ ‭Cultural issues‬
‭●‬ ‭Environmental issues‬
‭●‬ ‭Ethical issues‬
‭●‬ ‭Legal & Privacy issues‬

‭Cultural Issues‬

‭6.1b - Legislation‬
‭Data Protection Act (2018)‬
I‭ n 2018 the EU introduced GDPR (General Data Protection Regulation) to protect the privacy of data for‬
‭people in the EU. The UK matched this by updating the Data Protection Act introduced in 1998 to a newer, 2018‬
‭version.‬

‭This act protects the data of individuals that is stored on computers and processed by organisations.‬

‭Computer Misuse Act (1990)‬

‭Copyright, Designs & Patents act (1988)‬

‭Software Licenses‬
‭Open Source License‬

‭Proprietary License‬
‭2-1: Algorithms‬
‭Topic Contents:‬
1‭ .1‬‭- Computational Thinking‬
‭1.2‬‭- Designing Algorithms‬
‭1.3‬‭- Searching & Sorting Algorithms‬

‭1.1 - Computational Thinking‬


‭There are three key components to computational thinking (smart problem solving):‬

‭Abstraction‬
‭ bstraction is when you ignore unnecessary information and focus only on the important facts. Abstraction is‬
A
‭used because it simplifies a problem to make it less complex. This makes it more straightforward to understand‬
‭the problem and create a solution.‬

‭Decomposition‬
‭ ecomposition is when you break a problem down into smaller tasks so that it is easier to solve. Each individual‬
D
‭problem can be separately tested and solved. Decomposition also enables different people to work on the‬
‭different parts of a larger problem that can later be recombined to produce a full solution.‬

‭Algorithmic Thinking‬
‭ lgorithmic thinking is the final stage as logical steps are followed to solve the problem. The problem is broken‬
A
‭down using decomposition into smaller problems. The required data and relevant data structures are‬
‭considered using abstraction.‬

‭1.2 - Designing Algorithms‬

‭What is an algorithm?‬
‭ n algorithm is a set of instructions, presented in a logical sequence. In an exam you may be asked to read and‬
A
‭understand an algorithm that has been written. To prove your understanding you may be asked to respond by‬
‭actions such as listing the outputs of the algorithm, correcting errors or identifying an error within it.‬
‭Programmers create algorithm designs as a method of planning a program before writing any code. This‬
‭helps them to consider the potential problems of the program and makes it easier to start creating source‬
‭code. There are two main methods of defining algorithms are pseudocode and flowcharts. In exams, OCR will‬
‭display algorithms in their own 'OCR Exam Reference Language'.‬

‭OCR Exam Reference Language‬


‭ he OCR exams require specific questions to be written either in OCR Exam Reference Language (shown‬
T
‭below) or a high-level programming language such as Python.‬

‭Basic Commands‬
‭Annotation: //‬‭Comments are written using two slashes‬
‭ ssignment:‬‭name‬‭=‬‭"Harold", age‬‭=‬‭49‬
A
‭Constants and Global Variables: constant‬‭tax = 15,‬‭global‬‭name = "Admin"‬
‭Input / Output:‬‭name =‬‭input‬‭("Enter your name"),‬‭print‬‭("Transaction‬‭Complete")‬
‭Casting: str‬‭(29),‬‭int‬‭("102"),‬‭float‬‭(30),‬‭bool‬‭("False")‬
‭Random Number:‬‭number =‬‭random‬‭(1,100)‬

‭NEEDS TO BE CONTINUED‬
‭Flowcharts‬
‭ flowchart can be used to visually represent an algorithm. It is more likely you will need to be able to interpret‬
A
‭a flowchart rather than draw one. The flowchart symbols are:‬

‭Reading Algorithms‬
I‭ n an exam you may be asked to read an algorithm and prove your understanding,‬
‭most commonly by listing the outputs. Start from the first line and follow the‬
‭program line by line, recording the value of variables as you go. When you‬
‭encounter a for loop, repeat the indented code as many times as stated in the‬
‭range.‬
‭Understanding Algorithms: Listing Output‬

‭Structure Diagrams‬
‭ tructure diagrams display the organisation (structure) of a problem in a visual format, showing the‬
S
‭subsections to a problem and how they link to other subsections. The noughts and crosses structure diagram‬
‭below has subsections in light yellow. Each‬
‭subsection could be coded by a different‬
‭person.‬

‭ tructure diagrams are different to‬


S
‭flowcharts (those show how data is input,‬
‭processed and output within a program or‬
‭system).‬
‭Trace Tables‬
‭ tructure Trace tables are used to track the value of variables as a program is run.‬
S
‭They can be used to manually track the values in order to investigate why the‬
‭program isn't working as intended. Each row in the trace table represents another‬
‭iteration. Each column stores the value of a variable as it changes. See below how the‬
‭trace table is updated for the simple algorithm on the left.‬

‭ or most algorithms,‬‭not‬
F
‭every variable‬‭will be‬
‭updated‬‭in‬‭each‬
‭iteration‬‭.‬
‭​‬
‭Values‬‭may not be‬
‭entered in‬‭the‬‭order‬‭of‬
‭the trace table either. For‬
‭example, each iteration‬
‭outputs num1 + num2 and‬
‭then decreases the value‬
‭of num2 by 1.‬

‭1.3 - Searching & Sorting Algorithms‬

‭Linear Search‬
‭ linear search is the most simple search algorithm. Each data item is searched in order from the first value to‬
A
‭the last as if they were all laid out in a line. The list does not have to be in any order before it is searched. This‬
‭search is also known as a sequential search because the list is searched in a sequence from start to end. For‬
‭large lists, this search is not very efficient.‬
Linear Search Explained - CSNewbs
‭ ey features of a linear search:‬
K
‭• A loop is used to check the first value in a list and increment by 1, checking each value for a match to the‬
‭target.‬
‭• Reaching the last element of the list without finding a match means the value is not included.‬

‭Binary Search‬
‭ binary search is a much more efficient searching algorithm as it generally searches through fewer data and‬
A
‭is often much quicker - especially for large data sets. In a binary search, the middle point of the data is selected‬
‭ ith each iteration and compared to the value being searched for. When the midpoint matches the target‬
w
‭value, it has been found and the search can stop.‬
‭!!‬‭However there is a prerequisite of using a binary‬‭search - the list of data must already be sorted. A‬
‭prerequisite is a condition that must be satisfied before an algorithm will work correctly.‬
Binary Search Explained - CSNewbs
‭Key features of a binary search:‬
‭-‬ ‭A midpoint, lowpoint and highpoint are calculated.‬
‭-‬ ‭A while loop is used to repeatedly compare the midpoint to a target value.‬
‭-‬ ‭The upper half or lower half of the data is ignored if the midpoint does not equal the target.‬

‭Merge Sort‬
‭ erge sort is a sorting algorithm based on the idea of 'divide and conquer'. A merge sort divides a list into half,‬
M
‭again and again until each data item is separate. Then the items are combined in the same way as they were‬
‭divided, but now in the correct order. When the individual lists are all merged together as one list again, then‬
‭the data is in order and the algorithm will end.‬
Merge Sort Explained - CSNewbs
‭Key features of a merge sort:‬
‭-‬ ‭This algorithm calls itself from within the subroutine (this is known as a recursive algorithm).‬
‭-‬ ‭It continually splits sublists into a left side and a right side until each sublist has a length of 1.‬

‭Bubble Sort‬
‭ his algorithm is based on the comparison of adjacent data elements. Data elements are swapped if they are‬
T
‭not in the correct order. The algorithm will only stop when a complete iteration through the data is completed‬
‭with no swaps made. A bubble sort is not suitable for large sets of data.‬
Bubble Sort Explained - CSNewbs
‭Key features of a bubble sort:‬
‭-‬ ‭Uses an outer while loop (condition controlled) to check no swaps have been made.‬
‭-‬ ‭Uses an inner for loop (count controlled) to repeat through the length of the data set.‬
‭-‬ ‭Uses a flag (a Boolean value) to track if a swap has been made and uses a temporary value to help‬
‭correctly swap elements.‬

‭Insertion Sort‬
‭ he list is logically split into sorted values (on the left) and‬
T
‭unsorted values (on the right). Starting from the left, values‬
‭from the unsorted part are checked and inserted at the correct‬
‭position in the sorted part. This continues through all elements‬
‭of the list until the last item is reached, and sorted. Insertion‬
‭sorts are efficient for small data sets but would be slow to sort‬
‭large sets, compared to alternatives such as a merge sort.‬

‭Key features of a insertion sort:‬


‭-‬ ‭Uses an outer for loop (count controlled) to iterate through each value in the list.‬
‭-‬ U ‭ ses an inner while loop (condition controlled) to find the current value's correct position in the sorted‬
‭part of the list.‬
‭-‬ ‭An insertion sort moves 'backwards' to find the correct position of each value, by decreasing the index‬
‭within the while loop.‬

‭2-2: Programming Fundamentals‬


‭Topic Contents:‬
‭ .1‬‭- Programming fundamentals‬
2
‭2.2‬‭- Data Types‬
‭2.3‬‭- Additional Programming Techniques‬

‭2.1 - Programming fundamentals‬


‭Programming Constructs‬
‭There are three constructs (ideas of programming) that are used to control the flow of a program:‬
‭●‬ ‭Sequence‬
‭○‬ ‭Structuring code into a logical, sequential order.‬
‭●‬ ‭Selection‬
‭○‬ ‭Decision making using if statements.‬
‭●‬ ‭Iteration‬
‭○‬ ‭Repeating code using for or while loops‬

‭Local & Global Variables‬


‭ arge programs are often modular - split into subroutines with each subroutine having a dedicated purpose.‬
L
‭Local variables are declared within a specific subroutine and can only be used within that subroutine. Global‬
‭variables can be used at any point within the whole program.‬
‭Local variable advantages‬
‭●‬ ‭Saves memory - only uses memory when that local variable is needed - global variables use memory‬
‭whether they are used or not.‬
‭●‬ ‭Easier to debug local variables as they can only be changed within one subroutine.‬
‭●‬ ‭You can reuse subroutines with local variables in other programs.‬
‭​Global variable advantages‬
‭●‬ ‭Variables can be used anywhere in the whole program (and in multiple subroutines).‬
‭●‬ ‭Makes maintenance easier as they are only declared once.‬
‭●‬ ‭Can be used for constants - values that remain the same.‬

‭Constants‬
‭ s specified before, a variable is data that can change in value as a program is being run. A‬‭constant‬‭is‬‭data‬
A
‭that does not change in value‬‭as the program is run‬‭- it is‬‭fixed‬‭and remains the same. ​An example of‬‭a‬
‭constant in maths programs is‬‭pi‬‭- it will constantly‬‭remain at‬‭3.14159‬‭and never change.‬
‭Operators‬
‭ omparison Operators‬‭- compares two data values (eg,‬‭2>5=FALSE, 5<=(2+4)=TRUE)‬‭(ie, >, <, >=, <=, ==,‬‭!=)‬
C
‭Arithmetic Operators‬‭- operators used to mathematically‬‭change values‬‭(ie, +, - , * ,/ , %, //, **)‬
‭Logical Operators‬‭- operators which determine a boolean‬‭output (eg, 9>2 AND 2>9 = FLASE)‬‭(ie, AND, OR,‬
‭NOT)‬

‭2.2 - Data Types‬


‭Data Types‬
‭ haracter‬‭- One character, such as a letter, number,‬‭or punctuation symbol‬
C
‭String‬‭- A sequence of characters (eg, “hello world”)‬
‭Integer‬‭- A whole number (ie, an integer)‬
‭Float‬‭- A decimal number (eg, 2.456,‬‭pi‬‭)‬
‭Boolean‬‭- An answer that has two possible values (eg,‬‭TRUE/FALSE)‬

‭Casting‬
‭ onverting the value of a variable from one variable to another is known as casting.‬
C
‭Python automatically assumes an input is a string, so the int() command is used to cast the string to an integer‬

‭2.3 - Additional Programming Techniques‬


‭Subprograms‬
‭ hat is a subprogram?‬
W
‭Large programs are often broken down into smaller subprograms (also called subroutines). Each subprogram‬
‭focuses on a specific function of the code, helping to decompose a complex problem into more manageable‬
‭chunks.‬

​‬‭Defining subprograms‬
‭A subprogram is defined (identified) using the def command in Python. A program may use many‬
‭subprograms, which are usually defined at the start of the code.‬

​‬‭Calling subprograms‬
‭Running a line of code that includes the name of a subprogram will call (activate) it. When called, the program‬
‭will run the subprogram code before returning back to the line that called it. Subprograms are only run when‬
‭called, so depending on decisions made, a program may end without calling every (or any) subroutine.‬

​‬‭Parameters‬
‭A parameter is a value that is passed into a subprogram when it is called, allowing the value to be used within‬
‭the subprogram. A subprogram may not use a parameter, e.g. multiply(), or one parameter, e.g.multiply(num),‬
‭or several e.g. multiply(num1,num2). Any parameters must be identified when the subprogram is defined, e.g.‬
‭def multiply(num):‬

‭ eturn‬
R
‭The return command will send a value back to the line the subprogram was called on, allowing it to be used‬
‭there. For example, the 'quad' subprogram in the example below returns the value of the 'result' variable back‬
t‭ o the main program, allowing it to be printed. A subprogram will end either by reaching the last line of code‬
‭within it, or when it reaches a return command. Subprograms that return a value are called functions.‬

‭ ubprogram example‬
S
‭This subprogram is defined using the identifier 'quad' with a parameter named number.‬
‭The subprogram is called in the main program, multiplies the number passed in as a parameter by 4 and‬
‭returns a value back to the main program to be printed.‬

‭def quad(number):‬
‭result = number * 4‬
‭return result‬
‭#Main Program‬
‭number = int(input("Enter a number: "))‬
‭print("The number quadrupled is" , quad(number))‬

‭ nter a number: 5‬
E
‭The number quadrupled is 20‬

‭Functions and Procedures‬


‭ here are two types of subprograms:‬
T
‭Function‬‭- a subprogram that returns a value, using‬‭the return command, which allows the value to be used in‬
‭the line of code the function was called in.‬

‭Procedure‬‭- a subprogram that does not return a value.‬

‭Advantages of using subprograms‬‭​‬

-‭ ‬ S ‭ ubprograms‬‭break a complex program down‬‭into smaller‬‭parts, making it‬‭easier to design and test‬‭.‬
‭-‬ ‭​Using subprograms allows code to be‬‭easily reused‬‭in other programs, as it has‬‭already been written‬‭,‬
‭making it‬‭quicker to develop‬‭new programs‬‭or build‬‭on existing work.‬
‭-‬ ‭​Using subprograms‬‭avoids code repetition‬‭, as they‬‭can be called as many times as necessary.‬
‭-‬ ‭​Work can‬‭easily be split up between team members‬‭to work on different subprograms at the same‬
‭time.‬

‭Array‬
‭ n array is a static data structure that can hold a fixed number of data elements. Each data element must be‬
A
‭of the same data type i.e. real, integer, string.‬
‭The elements in an array are identified by a number that indicates their position in the array. This number is‬
‭known as the index. The first element in an array always has an index of 0.‬
‭You should know how to write pseudocode that manipulates arrays to traverse, add, remove and search for‬
‭data. The following steps use Python as an example, although Python does not use arrays and uses a similar‬
‭ ata structure called a list (that can change in size as the program runs). See the 8a and 8b Python pages for‬
d
‭tasks on how to use lists.‬

‭ raversing an Array‬
T
‭To traverse ('move through') an array a for loop can be used to display each data element in order.‬

‭Example code for traversing:‬

‭Output:‬

'‭Inserting' a value‬
‭In an array the size is fixed so you cannot insert new values, but you can change the value of elements that‬
‭already exist. Overwriting the fourth element (Daphne) with a new value (Laura) will change it from Daphne to‬
‭Laura.‬
‭Example code for inserting:‬

‭Output:‬

'‭Deleting' a value‬
‭In an array the size is fixed so you cannot delete values, but you can overwrite them as blank. Overwriting the‬
‭second element (Shaggy) with a blank space makes it appear deleted.‬

‭Example code for deleting:‬

‭Output:‬

‭Searching an Array‬

‭ or large arrays a for loop is needed to search through each element for a specific value. This example checks‬
F
‭each name to see if it is equal to Velma.‬

‭Example code for searching:‬

‭Output:‬
‭COMPLETE THIS‬
‭Two-Dimensional Array (2D array)‬
‭ ften the data we want to process comes in the form of a table.‬
O
‭The data in a two dimensional array must still all be of the same‬
‭data type, but can have multiple rows and columns. The‬
‭two-dimensional array shows the characters from Scooby Doo‬
‭along with their associated colour and their species. Each value in‬
‭the array is represented by an index still, but now the index has‬
‭two values. For example [3] [0] is 'Daphne'. Unless stated in an exam, measure row first, then column.‬

‭ earching a two-dimensional array:‬


S
‭To print a specific data element you can just use the index number like Daphne above. To search for a specific‬
‭value you will need two for loops, one for the row and another for the values of each row. The example to the‬
‭right is looking for the value of 'Velma' and when it is found it prints the associated data from the whole row.‬

‭Records‬
‭ nlike arrays, records can store data of different data types. Each record is made up of information about one‬
U
‭person or thing. Each piece of information in the record is called a field (each row name). Records should have‬
‭a key field - this is unique data that identifies each record. For example Student ID is a good key field for a‬
‭record on students as no two students can have the same Student ID. A 2D array may be used to represent‬
‭database tables of records and fields.‬

‭SQL‬
‭ QL‬‭(‬‭structured query language‬‭) is a language that‬‭can‬
S
‭be used to‬‭search for data‬‭in a‬‭database‬‭.‬

‭ he format of an SQL statement is:‬


T
‭SELECT‬‭field1, field2, field3…‬
‭FROM‬‭table‬
‭WHERE‬‭criteria‬

‭ xample of an SQL statement using the Cars table:‬


E
‭SELECT‬‭Make, Colour‬
‭FROM‬‭Cars‬
‭WHERE‬‭Miles > 1000 AND Age > 8‬
‭Cars table‬

‭ QL uses‬‭wildcards‬‭which are symbols used to substitute‬‭characters.‬


S
‭The * symbol represents‬‭ALL‬‭fields.‬
‭ xample:‬
E
‭SELECT *‬
‭FROM Cars‬
‭WHERE Colour = “blue”‬

‭2-3: Producing Robust Programs‬


‭Topic Contents:‬
‭ .1‬‭- Defensive Design‬
3
‭3.2‬‭- Testing‬

‭3.1 - Defensive Design‬


‭Defensive Design Considerations‬
‭There are several things to consider when creating a program that is‬‭secure and robust‬‭, including:‬
‭-‬ ‭Anticipating Misuse:‬‭Planning ahead‬‭to‬‭take steps‬‭against‬‭potential misuse‬‭(e.g the app‬‭X‬‭prevents‬
‭the‬‭same tweet sent twice‬‭in a row as it might be‬‭spam‬‭)‬
‭-‬ ‭Input Sanitisation:‬‭Checking and‬‭cleaning up data‬‭that has been‬‭input‬‭, (e.g.‬‭removing special‬
‭characters‬‭to‬‭prevent a SQL injection‬‭).‬
‭-‬ ‭Validation:‬‭Checking whether input‬‭data follows specific‬‭criteria‬‭and should be‬‭accepted‬‭(e.g. a‬
‭length check‬‭on a password).‬
‭-‬ ‭Verification:‬‭Checking whether‬‭data that has been‬‭entered‬‭is‬‭correct‬‭(e.g.‬‭double entry‬‭).‬
‭-‬ ‭Authentication:‬‭Ensuring‬‭only authorised users‬‭can‬‭gain‬‭access to a system‬‭(e.g.‬‭usernames‬‭and‬
‭strong passwords‬‭).‬
‭-‬ ‭​Maintainable code:‬‭Allowing‬‭other programmers‬‭to‬‭easily read‬‭and‬‭quickly understand code‬‭that has‬
‭been written (e.g. using‬‭comments‬‭,‬‭indentation‬‭and‬‭appropriate variable names‬‭).‬

‭Input Validation‬
‭Validation‬‭is a process to check that data is‬‭reasonable‬‭or sensible‬‭before it is accepted.‬

‭Range Check‬ ‭Type Check‬ ‭Format Check‬


‭ hecks that Data is‬‭within a‬
C ‭ hecks that Data is a‬‭certain data‬ C
C ‭ hecks that Data is‬‭entered a‬
‭certain range‬ ‭type‬ ‭certain way‬
‭Age:‬ ‭Height:‬ ‭Date(DD/MM/YYYY)‬
‭34 -‬‭Allowed‬ ‭182 -‬‭Allowed‬ ‭23/06/2026 -‬‭Allowed‬

‭203 -‬‭Disallowed‬ ‭Two metres -‬‭Disallowed‬ ‭23rd June 2026 -‬‭Disallowed‬

‭Presence check‬ ‭Lookup Table‬ ‭Length Check‬


‭ hecks that data has‬‭actually‬
C ‭ Table of‬‭Acceptable entries‬‭,‬
A ‭ hecks the‬‭length‬‭of the input is a‬
C
‭been entered‬‭and has‬‭not been‬ ‭also known as a list‬ ‭certain amount‬
‭left blank‬
‭“username123” -‬‭Allowed‬ ‭+44 7767 898672 -‬‭Allowed‬

‭“” -‬‭Disallowed‬ ‭+44 7215 -‬‭Disallowed‬

‭Maintainability‬
‭ rograms should be written in a way that makes‬‭maintaining‬‭and‬‭understanding them‬‭as straightforward as‬
P
‭possible. Examples of making a program‬‭maintainable‬‭include:‬
‭-‬ ‭Using‬‭subprograms‬‭to‬‭reuse code‬‭and make them‬‭easier‬‭to test‬‭. This is called‬‭modularisation‬‭.‬
‭-‬ ‭Appropriate variable names‬‭, using a‬‭naming convention‬‭,‬‭ensure the‬‭purpose‬‭of a variable is‬
‭immediately understood.‬
‭-‬ ‭Using‬‭indentation‬‭to‬‭improve readability‬‭and clearly‬‭show each ‘block’ of code.‬
‭-‬ ‭Comments‬‭enable a programmer to‬‭understand the purpose‬‭of each line of code. Crucial when‬
‭working in a team‬‭.‬
‭-‬ ‭Using‬‭constants‬‭is another method of improving maintainability.‬‭This keeps the program code‬
‭consistent‬‭, which makes it‬‭easier to read and debug‬‭a program‬

‭3.2 - Testing‬
‭ he main‬‭purpose of testing‬‭is to ensure that a‬‭program‬‭works correctly‬‭no matter what‬‭input has been‬
T
‭entered‬‭by the user.‬
‭Other reasons to test a program include ensuring the‬‭user requirements have been met‬‭,‬‭errors‬‭have been‬
‭removed‬‭and the‬‭program doesn't crash‬‭while running‬‭.​‬

‭Types of testing‬
I‭ terative Testing‬
‭Iterative testing takes place‬‭during program development‬‭.‬
‭The programmer‬‭develops a module‬‭,‬‭tests it‬‭and‬‭repeats‬‭this process‬‭until the‬‭module‬‭works as expected.‬

‭ inal Testing‬
F
‭Final testing, also known as‬‭terminal testing‬‭, takes‬‭place‬‭after development‬‭and‬‭before the program is‬
‭released‬‭to the end user.‬
‭This testing takes place once‬‭all modules have been‬‭individually tested‬‭to ensure the‬‭whole program‬‭works‬‭as‬
‭originally expected.‬

‭Programming Errors‬
‭Syntax Error‬
‭ syntax error is a mistake in the grammatical rules of the programming language, such as an incorrect‬
A
‭spelling of a command word.A syntax error will prevent the program from being compiled and executed.‬
‭Examples:‬

‭Incorrect Spelling:‬ ‭pront‬‭("hello")‬


‭Incorrect punctuation:‬ ‭print ("hello"‬‭(‬

‭Logical Error‬
‭ logic error is a mistake made by the programmer - the program runs without crashing but will display the‬
A
‭wrong output.‬
‭Examples:‬

I‭ ncorrect calculation:‬
‭total = num1‬‭-‬‭num2‬
‭print (total)‬
‭Incorrect variable printed:‬
‭age = 16‬
‭name = "Steve"‬
‭print ("Nice to meet you" ,‬‭age‬‭)‬

‭Test Data‬

‭ est data is used to test whether a program is functioning correctly. It should cover a range of possible and‬
T
‭incorrect inputs, each designed to prove a program works or to highlight any flaws.‬
‭Four types of test data are:‬
‭1.‬ ‭Normal‬‭data‬‭- Sensible data that the program should‬‭accept and be able to process‬
‭2.‬ ‭Boundary‬‭data‬‭- Data at the extreme boundary of any‬‭data range‬
‭3.‬ ‭Invalid‬‭data‬‭- Data of the correct data type that‬‭does not meet the validation rules‬
‭4.‬ ‭Erroneous‬‭data‬‭- Data of the wrong data type that‬‭the program cannot process and should not accept‬

‭2-4: Boolean Logic‬


‭Topic Contents:‬
‭4.1‬‭- Boolean Logic‬

‭4.1 - Boolean Logic‬


‭What is a logical operator?‬
I‭ nside of each computer system are millions of transistors. These are tiny switches that can either be turned on‬
‭(represented in binary by the number 1) or turned off (represented by 0). Logical operators are symbols used to‬
‭represent circuits of transistors within a computer. The three most common operators are:‬
‭-‬ ‭NOT‬
‭-‬ ‭AND‬
‭-‬ ‭OR‬

‭Order of precedence‬
‭The order of precedence is as follows:‬
‭-‬ ‭BRACKETS‬
‭-‬ ‭NOT‬
-‭ ‬ A‭ ND‬
‭-‬ ‭OR‬

‭What is a truth table?‬


‭ ruth tables are used to show all possible inputs and the associated output for each input. The input and output‬
T
‭values in a truth table must be a Boolean value - usually 0 or 1 but occasionally True or False.‬

‭NOT‬ ‭AND‬ ‭OR‬

‭A‬‭NOT‬‭logical operator will produce‬ ‭ n‬‭AND‬‭logical operator will‬


A ‭An‬‭OR‬‭logical operator will output‬
‭an output which is the‬‭opposite‬‭of‬ ‭output 1 only if‬‭both inputs‬‭are‬ ‭1 if‬‭either input‬‭is 1.‬
‭the input.‬ ‭also 1.‬ ‭OR‬‭is also known as‬‭Disjunction‬‭.‬
‭NOT‬‭is also known as‬‭Negation‬‭.‬ ‭AND‬‭is also known as‬‭Conjunction‬‭.‬ ‭The symbol for‬‭OR‬‭is‬‭∨ ‬
‭The symbol for‬‭NOT‬‭is‬‭¬‬ ‭The symbol for‬‭AND‬‭is‬‭∧ ‬

‭NOT Logic Gate Symbol‬ ‭AND Logic Gate Symbol‬ ‭OR Logic Gate Symbol‬

‭A‬ ‭¬A‬ ‭A‬ ‭B‬ ‭A ∧ B‬ ‭A‬ ‭B‬ ‭A ∨ B‬

‭0‬ ‭1‬ ‭0‬ ‭0‬ ‭0‬ ‭0‬ ‭0‬ ‭0‬

‭1‬ ‭0‬ ‭1‬ ‭0‬ ‭0‬ ‭1‬ ‭0‬ ‭1‬

‭0‬ ‭1‬ ‭0‬ ‭0‬ ‭1‬ ‭1‬

‭1‬ ‭1‬ ‭1‬ ‭1‬ ‭1‬ ‭1‬

‭2-5: Languages & IDEs‬


‭Topic Contents:‬
‭ .1‬‭- Languages & Translators‬
5
‭5.2‬‭- Integrated Development Environment‬

‭5.1 - Languages & Translators‬


‭There are two types of programming languages used within computer systems:‬
‭High-Level Languages‬
‭ hy do programmers use high-level languages?‬
W
‭High-level programming languages use code written in a way that is similar to a natural‬
‭human language, such as English, making it easier to understand and use the language.‬
‭Using high-level languages leads to fewer errors and allows for more powerful and‬
‭complex commands compared to low-level languages. However, a high-level language‬
‭must be translated into machine code (binary) before it can be run, as high-level‬
‭languages cannot be executed directly by the CPU.‬
‭Low-Level Languages‬
‭ ow-level languages do not closely resemble a natural human language, making it harder for humans to‬
L
‭understand and write in. Low-level languages are used when a program must be executed quickly or when‬
‭programmers need to write code that interacts directly with the hardware, such as device drivers.‬
‭There are two types of low-level language:‬
‭-‬ ‭Machine Code:‬‭This is the pure binary code that computers‬‭can directly process and execute. It is‬
‭extremely tedious and difficult for humans to understand and write machine code. However, machine‬
‭code can be used when a programmer needs to perform a very specific command that can't be done in‬
‭a high-level language. Machine code will be executed faster than high-level programs because it is‬
‭already in a format the CPU can execute and does not need to be translated.‬
‭-‬ ‭Assembly Language:‬‭Assembly language uses specialised‬‭command mnemonics to perform actions.‬
‭See the Assembly Language section in the programming tab for a list of mnemonics such as INP, OUT‬
‭and HLT. Assembly language is preferred by many programmers over machine code because it is easier‬
‭to understand and spot errors. It is faster to execute than high-level languages and, like machine code,‬
‭can be used to directly control the CPU.‬

‭Translators‬
‭ translator changes (translates) a program written in one language into another language (usually machine‬
A
‭code). There are two main types of translator:‬

I‭ nterpreter:‬ ‭ ompiler:‬‭A compiler converts high-level language‬


C
‭An interpreter converts high-level language one line‬ ‭into machine code for execution at a later time. The‬
‭at a time into machine code and executes it.‬ ‭entire program is converted at once.‬

‭Interpreters vs Compilers‬
‭Interpreter‬‭:‬ ‭Compiler‬‭:‬
‭-‬ E ‭ xecution Method:‬‭An interpreter translates‬ ‭-‬ E ‭ xecution Method:‬‭A compiler translates all‬
‭source code (high level code) into machine‬ ‭the source code (high level code) into machine‬
‭code one line at a time.‬ ‭code in one go. A compiler produces an‬
‭executable file that will run on other machines‬
‭-‬ ‭​Execution Speed:‬‭An interpreter is slower‬
‭without the compiler needing to be installed.‬
‭than a compiler because the code must be‬
‭-‬ ‭Execution Speed:‬‭Compilers can produce‬
‭reinterpreted each time the program is run.‬ ‭much more efficient code than interpreters‬
‭-‬ ‭Complexity:‬‭Interpreters are smaller, simpler‬ ‭making the compiled programs run faster.‬
‭programs.‬ ‭-‬ ‭Complexity:‬‭Compilers tend to be large‬
‭-‬ ‭Error Reporting:‬‭In error reporting, the‬ ‭complex programs.‬
‭interpreter would encounter the errors and‬ ‭-‬ ‭Error Reporting:‬‭The compiler would analyse‬
‭the entire program, taking note of where‬
‭report it to the user immediately and stops the‬
‭errors have occurred and record them in an‬
‭program from running.​‬ ‭error file.‬
‭-‬ ‭Repetition:‬‭Interpreted programs can be‬ ‭-‬ ‭Repetition:‬‭Compilation requires analysis and‬
‭edited and run without translating the whole‬ ‭the generation of the code only once, whereas‬
‭program. Interpreters must reinterpret the‬ ‭interpreters must re-interpret each time.‬
‭program every time it is run.‬ ‭However, compiled programs have to be‬
‭recompiled after any changes have been‬
‭made.‬

‭5.2 - Integrated Development Environment‬


‭ n IDE (Integrated Development Environment) provides programmers with the following facilities (tools) to‬
A
‭help create programs:‬

‭Editors‬
‭ he editor is software that allows a programmer to‬‭enter and edit source code‬‭.‬
T
‭Editor features may include:‬
‭-‬ ‭Automatic formatting‬‭(e.g. automatic indentation).‬
‭-‬ ‭Automatic line numbering‬‭(this helps to identify exactly‬‭where an error has occurred).‬
‭-‬ ‭Automatic colour coding‬‭(e.g. Python IDLE turns loop‬‭commands orange and print commands purple).‬
‭-‬ ‭Statement completion‬‭(e.g. offering to auto-complete‬‭a command as the user is typing.)‬

‭Compilers & Interpreters‬


‭ oth tools convert the‬‭source code‬‭written by a programmer‬‭into‬‭machine code‬‭to be executed by the CPU. A‬
B
‭compiler‬‭converts the‬‭entire source code‬‭into executable‬‭machine code‬‭at once‬‭. After compilation, the‬
‭program can be‬‭run again without having to recompile‬‭each time‬‭. An‬‭interpreter converts source code into‬
‭machine code line by line‬‭. An interpreter must‬‭reinterpret‬‭the code each time the program is required to‬
‭run‬‭. See 5.1 for both types of translators.‬

‭Break Point‬
‭ he programmer‬‭selects a specific‬‭line and the program‬‭displays the variable values at that point‬‭. The code‬
T
‭can then be executed‬‭one line at a time‬‭to find exactly‬‭where the error occurs. This process is called‬
‭single-stepping‬‭.‬
‭Variable Watch/Watch Window‬
‭ isplays the‬‭current value of a selected variable‬‭.‬‭A variable can be‬‭watched line-by-line‬‭to see how‬‭the‬
D
‭value changes‬‭.‬

‭Trace‬
‭Logs‬‭the‬‭values of variables‬‭and‬‭outputs of the program‬‭as the code is executed‬‭line by line‬‭.‬
‭Error Diagnostics & Debugger‬
‭ oth tools are used to‬‭display information about an‬‭error when it occurs‬‭, such as the‬‭line it occurred‬‭on and‬
B
‭the‬‭error type‬‭(e.g. syntax). These tools may also‬‭suggest solutions to help the programmer to find and fix the‬
‭error.‬

‭Run Time Environment‬


‭ ‬‭runtime environment‬‭allows a‬‭program to run‬‭on a‬‭computer system. It‬‭checks for runtime errors‬‭and‬
A
‭allows users to‬‭test the program‬‭. A‬‭runtime error‬‭occurs as the program is‬‭being executed‬‭, such as‬‭dividing‬‭a‬
‭number by zero‬‭. A commonly used example is the‬‭Java‬‭Runtime Environment‬‭. This allows programmers to‬
‭design a program on‬‭one platform‬‭(using the programming‬‭language‬‭Java‬‭) which allows the‬‭finished‬
‭program‬‭to then be‬‭run on many other systems.‬‭A runtime‬‭environment enables the‬‭tools‬‭above such as a‬
‭trace‬‭and‬‭breakpoint‬‭to be used.‬

You might also like