[Music] good morning good afternoon and good evening tick whichever one applies to you this is my a level complete paper 1 revision lesson let's get started beginning with 1.1.1 structure and function of the processor here we go this is a diagram this is what we're going to be talking about in this section all the different bits and pieces that you need to know about the control unit or CU sends out control signals to other parts of the CPU for example read or write signals to memory executes programs by following the fetch decode execute cycle contains the clock which coordinates CPU activity and the decoder the arithmetic logic unit or ALU carries out calculations and logical operations upon the data this includes the usual add multiply divide and subtract calculations but also data comparison such as greater than less than or equal to moving on to registers the program counter a PC holds the address and memory of the next instruction remember it holds the location in memory of the next instruction not the actual instruction itself the memory address register or M stores the address of the data that has been fetched from or is about to be sent to memory while the memory data Reg register or MDR stores the data that has been fetched from or is about to be stored into memory the current instruction register or cir stores the most recently fetched instruction waiting to be decoded and executed and finally the accumulator or ACCC holds the results of calculations and operations performed by the ALU buses we all love buses buses are great the address bus provides a memory address to system memory or input output devices the data bus transfers data between the CPU and memory or IO devices and vice versa and the control bus provides control signals that cause the memory or IO to perform a read or write operation moving on to the fetch to code execute cycle the task or the job of the CPU is to execute programs by repeatedly carrying out the fetch to code execute cycle sometimes shorten to fetch execute cycle fde cycle or even Fe cycle it all means the same thing let's take a look at that in more detail starting with fetch step one the program counter copies the address of the next instruction it contains into the memory address register step two the control unit loads the address to be used onto the address bus step three the control unit triggers a read signal down the control bus that causes main memory RAM to place the instruction being asked for on the datab bus step four the instruction on the data bus is loaded into the memory data register step five the memory data register copies the instruction into the current instruction register step six the program counter can now be incremented by one to point to the next instruction and the fetch stage is now complete the decode stage the contents of the current instruction register are sent to the control unit the control unit then decodes the instruction the execute stage the instruction within the current instruction register is carried out or executed by the CPU registers can be changed in different ways during the execution phase depending on the instruction if a memory location is to be read from or written to that is an LDA or sta instruction in the little man computer then the address stored within the current instruction register will be loaded into the memory address register in the case of the STA or store operation the data stored in the accumulator is sent to memory in the case of a load or LDA instruction the data is loaded from memory into the accumulator if the instruction is to carry out a calculation that is an add or a sub operation then the contents of the memory data register and the accumulator are sent to the ALU and the results sent back to the accumulator next we have the factors affecting the performance of the CPU starting with clock speed a clock in the control unit sends a pulse at fixed intervals to control the speed speed that the CPU carries out the fetch decode execute cycle the higher the speed of this pulse the more instructions can be completed per second overclocking some CPUs allow the clock speed to be altered this can result in Faster performance because the CPU can carry out more instructions in the same amount of time but generates more heat and could damage the CPU cash cash is a small amount of very fast memory built into the CPU it holds instructions or data that are frequently used have recently been used or are about to be used it is faster for the CPU to fetch data from cash rather than from the slower Ram uh that's the Von nyman bottleneck in operation however cash is expensive more expensive certainly than Ram number of cores a core is a complete Processing Unit it has its own control unit ALU registers Etc each core can independently carry out the fetch decode execute cycle this allows multiple instructions to be processed at the same time the use of pipelining pipelining is a technique for fetching an instruction while the prior one is being decoded and the one before it is being executed it is a simple form of parallel processing so you can see from the table here during step one we can fetch instruction number one in step two we can fetch instruction two while at the same time decoding instruction number one and then at the next stage we can fetch instruction three while at the same time decoding instruction number two and executing instruction number one and so on and so forth a pipeline controller has to predict jump instructions in order to keep the pipeline full if the controller makes a mistake the pipelines have to be emptied or flushed which degrades performance V noyman Harvard and contemporary processor architectures the Von nyman architecture has a single control unit and a single ALU it works sequentially through instructions stores instructions and data together in the same memory unit in a binary format the Harvard architecture well the idea of the Harvard architecture is to split the memory into two parts one part for data and another part for programs each part is accessed with a different bus and this gives certain advant ages over Von nman architecture however it's more difficult to design and build and more difficult to program and generally more expensive modern architecture makes use of parallel processing processing more than one piece of data at the same time this include something like pipelining which we've already discussed array processing which is an example of simd single instruction multiple data here a number of alus allow one instruction to be performed on a large data set simultaneously ly an example of array processing would be a graphics card or something similar we also have multicore processing which is MD multiple instruction multiple data here each CPU has a number of cores which are complete Processing Unit or each computer system has multiple CPUs for example a workstation or a supercomput next up we have types of processor we'll start this section with cisk and risk processors CIS complex instruction set Computing supports more instructions which requires more transistors and a larger physical size therefore requiring more power and generating more heat but the more complicated Hardware means the software is less complicated compilers are easier to design for cisk systems risk reduced instruction set Computing supports fewer instructions which requires less transistors and a smaller physical size requiring less power and generating less heat risk instructions usually take a single clock cycle meaning pipelining can be used with maximum efficiency the simplified Hardware however means that the software is more complicated gpus and their usage GPU stands for graphical processing unit and this is something that is specifically designed to perform the calculations associated with Graphics it is an example of of an array processor which means it has a number of alus to allow a single instruction to be performed on multiple items of data at the same time sometimes this would be called a simd or single instruction multiple data system while designed for graphics for example gaming animation computerated design gpus are increasingly being used in many other fields so some examples modeling physical systems audio processing breaking password cryptography cryptocurrency generation machine learning all that other sort of stuff multicore and parallel systems parallel processing is the simultaneous processing of data parallel processing can be considered to be a nonv architecture there are a number of different ways to do this depending on the use and this brings us back to SD and mimd again single instruction multiple data here the same operation is carried out of multiple pieces of data at one time so for example with a GPU multiple instruction multiple data means that different instructions are carried out concurrently on different pieces of data this can be achieved by having a number of cores inside a CPU a multicore system a problem can then be divided up and run in parallel amongst these cores mimd takes place on a much larger scale on workstations and supercomputers these can have multiple CPUs with each CPU consisting of multiple cores we can also do this with distributed computing where multiple computer systems are connected together via Network to work on a problem 1.1.3 input output and storage so input and output this is quite simple input devices allow data to be entered into a computer so for example a keyboard a mouse a microphone a scanner a joystick while output device allow information to be retrieved from a computer examples include printer speakers monitors actuators Etc you are not expected to know the detailed working of any of these sort of devices for the examination but you're expected to be able to choose a suitable input and output device for a given scenario please do not be that student that gets the input and output confused in the exam storage devices are used to hold data and programs for the long term they are all non volatile storage devices fall into three categories magnetic Flash and Optical when looking at storage there are many considerations cost how much does it cost to be purchased per gigabyte speed how quickly can it be read from and written to capacity how much data can it store durability How likely is it to be damaged or break reliability will it retain the data safely for a long time will will it break with wear and tear over time magnetic storage uses magnetizable material patterns of magnetization are used to represent binary sequences examples include hard dis drives and Magnetic Tape sometimes still used to Archive data magnetic storage tends to have high capacity at low cost however it's vulnerable to magnetic fields and x-rays also remember that hard disk drives or hdds have moving parts so they are vulnerable to shock so for example being dropped or moved suddenly optical storage such as CDs DVDs and Blu-rays work by using lasers sounds very futuristic but this sort of technology is becoming slightly outdated but you do still need to know it for the exam Optical media tends to be cheap to mass produce and distribute it is Fairly reliable as long as it's not scratched or broken that's why with CDs and DVDs Etc you usually have a case so you can store the disc safely and you have multiple varieties a CD you're looking at about 700 megab of storage DVD is about 4.7 GB while a Blu-ray disc can be anything from 25 GB to 100 GB or more depending on what technology you're using dual sided dual layer that sort of thing flash memory works by using a special type of Sol state memory that is both nonvolatile and can be overwritten examples include memory sticks or memory cards s solid state Dives solid state drives sorry ssds and modern ROM chips Advantage can be read from and written to at high speeds and as it has no moving parts has lower power consumption and is unaffected by sudden movement or shocks this Advantage is more expensive per gigabyte than magnetic storage you also have a limited number of erase right Cycles but that number is actually very high and isn't really applicable to a home user but if you're an Enterprise user you will have to replace all the drives eventually RAM and ROM the classics you've always got to know your RAM and your ROM Ram Is Random Access Memory and it's a type of primary memory where programs and data being run by a computer are temporarily stored so for example the parts of the operating system that are currently needed programs that are currently running any data those currently running programs require ROM is readon memory it is a form of primary memory that can be read from but not written to as ROM retains its contents where the power is lost it is referred to as being nonvolatile a common use for ROM on computers is storing the BIOS the basic input output system holds the instructions to boot the computer and initialize Hardware on embedded systems the firmware and ROM may act as the device's complete operating system virtual storage is sometimes known as cloud storage in fact it's probably called cloud storage more often but the exam board like to call it virtual storage please do not confuse this with virtual memory this type of storage is based around the concept of storing data over the internet instead of on a local storage device has grown a lot more popular in recent years thanks to the growth of internet access and speed and also the growth of 4G and 5G mobile networks so you can get access to your data on the go advantages of virtual storage data can be accessed from any location as long as you have the uh internet access obviously data can be shared easily between people and devices capacity can be considered Limitless from the point of view of the user increase storage can always be purchased and the capacity is scalable to the needs of the user you can have more one month and less the next backing up the data and security you're no longer the concern of an individual user or business you can let a big professional company take care of it for you disadvantages you need a fast reliable internet connection can get expensive if you need to store very large amounts of data and you need to trust the company running the service how good is their security do they have multiple backups in different locations do they comply with necessary laws moving on to the next section we have 1.2.1 system software the need for function and purpose of an operating system well basically an operating system or Os is the software that manages the computer hardware and software modern operating systems have several purposes including to manage the hardware SL peripherals provide a user interface provide a platform to run other software manage the security of the system manage CPU usage through scheduling and interrupts provide utilities for system maintenance and manage available memory memory management memory RAM is a finite resource and must be managed by the operating system the memory manager controls the allocation of Random Access Memory to each running process if the memory manager fails to manage memory well then the computer will slow down and might crash the memory manager must also control virtual memory so that programs and data can be loaded and run even with the physical RAM is full inup sometimes Hardware software needs to get the cpu's attention immediately polling here the CPU regularly pulls or inquires if a device needs attention this is inefficient because usually the answer is no a more efficient solution is interrupts if a hardware device or application needs attention it raises an interrupt with the CPU technically if it's an application it's software so it's raising it first with the operating system if this interrupt is of a higher priority than the current task the relevant ISR or interrupt service routine is run if there are any interrupts and they are of higher priority than the current task then the following steps are carried out the contents of the program counter and the other registers are copied to an area of memory called the stack the relevant interrupt service routine can then be loaded by changing the program counter to the value of where the ISR starts in memory when the interrupt service routine is complete the previous values of the program counter and other registers can be restored from memory to the CPU and yes before you ask an interrupt can be interrupted by another interrupt at the end of each iteration of the fetch tocode execute cycle the processor checks to see if there are any interrupts so we can say fetch tocode execute and actually check for interrupts before fetching the next instruction scheduling a schedu or schedule manager is the part of the operating system that uses a scheduling algorithm to determine how to share processor time remember even on today's multicore systems you'll have a lot more processes running than you have cores so the whole usage of the CPU has to be shared between multiple running applications how it does this well there are lots of different ways and I'll give you a brief rundown round robin in round Robin scheduling each process is given a fixed amount of time if it hasn't finished by the end of that time it goes to the back of the queue first come first served similar to round robin except each process is allowed to run to completion shortest job first shortest job first picks the job that will take the shortest amount of time uh measured in estimated FD cycles and run until it finishes shortest remaining time the scheduler estimates how long each process will take and then picks the one that will take the least amount of time and runs that if a job is added with a shorter remaining time the scheduler switches to that one and then we have multi-level feedback cues this takes into account the priority of a task by maintaining cues with different priority levels if a process is in say the low priority Q for too long it will get moved up so that eventually all processors will get a chance to be processed accessed there are many different types of operating system used in many different capacities and often individual operating systems can borrow different parts from different types of operating system so it's not strictly one type or the other you can kind of blend these together and you'll see that when we go through them a multitasking operating system is one that is designed to allow the user to do multiple things at the same time a multi-user operating system allows a the user to share the resources of one powerful machine for example a supercomputer distributed operating system is one that runs across lots of individual computers but appears to be one system to the end user an embedded OS one usually found in a piece of Hardware that serves a single purpose and a real-time operating system reacts to input as close to real time as possible device drivers contain software that tell the operating system how to understand the data coming from an external hardware device and what format it expects to receive the data in BIOS is your basic input output system this controls the startup sequence of the computer and also helps configure Hardware devices virtual machines a VM or virtual machine is a program designed to fully simulate a computer but in software it is a simple way to run more than one operating system on the same computer or a very powerful server can be split into several smaller vers virtual machines to use its resources better it can also help with security if the virtual machine is affected by a virus or another nasty piece of software the host operating system is unaffected there are also virtual machines designed to run intermediate code from a specific computer language for example Java now let's move on to 1.2.2 Applications generation application software is software that allows a user to perform a task or produce something for example a word processor a spreadsheet a web browser you may have to recommend an application and justify it for a given scenario use the generic name in the exam not the name of particular product so please recommend a word processor not Microsoft Word a utility is a small program that has one purpose usually concerned with the maintenance of the system for for example disk cleanup defragmenter compression encryption make sure you're familiar with the key types so you can justify recommending one for a given situation op Source versus Clos Source software op Source software means that the source code for the software is available usually the software is free can be amended by the user to add features and fix bugs this is said to encourage collaboration and Rapid development Clos Source software on the other hand means that the source code is proprietary and is not available usually more polished than open-source software often easier to install and easier to use with a more attractive user interface usually comes with a warranty or guarantee of some sort and often has customer support available translators a translator converts source code into machine code there are three types assembler interpreter and compiler an assembler converts assembly code into machine code interpreter converts highlevel source code into machine code line by line good for use during coding and debugging a compiler converts highlevel source code into machine code all in one go this can take a long time but afterwards it can run without the need for source code or trans lator so it's faster what happens when your software is compiled let's take a look at these stages of compilation first of all we have lexical analysis here comments and whites space are removed from the program the remaining code is turned into a series of tokens a symbol table is created to keep track of the variables and sub routines we then move on to syntax analysis this will produce an abstract syntax tree that will represent the program it checks that the code has been written using a valid syntax code generation optimization code generation is when the compiler converts the output of the syntax analysis into object code compilers can be tweaked to optimize for either speed or memory as it is often difficult to optimize both at the same time libraries contain existing code that developers may wish to reuse use linkers are used to incorporate Library code into the final program and a loader is the part of the operating system responsible for loading an executable file into memory now the bit that you're all waiting for 1.2.3 software development software development life cycle methodologies a process for planning creating testing and deploying highquality software we need to know the waterfall life cycle rapid application development or rad spiral model and agile software development starting with the waterfall model this divides the process into sequential stages which are followed in a linear fashion this works well when there is a clear expected output at each stage and everyone has clear responsibilities tends to suit large-scale projects with stable requirements if the project requirements change this model is inflexible and cannot respond easily no working software is produced until late during the life cycle so problems may not be discovered until it is too late the waterfall life cycle is not suited to highrisk or complex projects the rapid application development model involves building a prototype this is evaluated and refined over multiple iterations until it becomes the final product rad is well suited to projects where the requirements aren't entirely clear from the outset allows a product to be made and put to Market extremely quickly compared to say the waterfall model the end product is likely to have excellent usability but it does require a heavy input time from the client to give feedback and guide the project rad does not scale well and it so is less suited to large projects with big teams that will take a long time to develop the spiral model is designed to manage risk and requires risks to be identified and evaluated at each stage so it manages risk well and is flexible and is perfect for large scale or risky projects however it requires a high level of expertise in Risk analysis good risk analysists are expensive which adds to the cost of the project it is also complex there are many stages to pass through so it's very time consuming agile methods are designed to deal with projects where there may be changing requirements one form of agile is Extreme programming or XP this is an agile method where the focuses on producing extremely high quality code each iteration in XP produces a version of the system with code of good enough quality to be used in the final product this can involve pair programming the quality of the final code is therefore likely to be very high the project object however can be too code focused and not designed Focus so may not be the best possible product and XP also produces little or no documentation algorithmic thinking is key to solving any problem not just those related to computers an algorithm as you should know by now is a set of instructions to solve a problem this could be a computer program or a recipe for your favorite meal we often use pseudo code or flowcharts to represent algorithms 1.2.4 types of programming language programming paradigms a common way of grouping languages together is by their General approach to problem solving what we refer to as their Paradigm these approaches are often specialized they focus on one aspect of programming at the expense of others each Paradigm offers advantage over other types and each one of course has some limitations there is not one Paradigm that the best each Paradigm is very good in certain situations very roughly we can divide the classes of programming language into low level or high level low level can include things like machine code and Assembly Language high level can be subdivided into imperative and declarative languages we can divide imperative into procedural and objectoriented and those are the ones you probably have most experience with if we look at the declarative Lang languages we can have declarative logic and functional languages which are maybe a little bit more exotic low-level languages are those directly linked to the architecture of the computer machine code and Assembly Language are low-level languages low-level languages are excellent for close control of the CPU for example many device drivers are coded in Assembly Language they can be very efficient well optimized code written in a low-level language can be made to run very quickly compared to other programming languages a highlevel language is one designed to be closer to the way we express ourselves using a mixture of English words and mathematical Expressions imperative language well imperatives means to give orders or instructions so these languages are all about the computer being told what to do step by step and we often subdivide this into procedural and objectoriented declarative languages these tell the computer the qualities of the solution that we're looking for but not how to compute it step by step and here we can have logic and functional languages procedural instructions are given in sequence selection is used to decide what a program does and iteration dictates how many times it does it programs are broken down into key blocks called procedures and functions hence the name procedural examples of procedural languages include basic C Pascal Etc objectoriented a programming style in which a solution consists of objects that interact with each other examples of objectoriented languages include Java C++ C Etc declarative logic designed for applications such as AI where deductions need to be made based on a set of rules examples include prologue functional these are designed for the original purpose of computers calculated so these can be used for mathematical and simulation applications some examples might include lisp and Wolfram next up we have Assembly Language Assembly Language is a big topic I could easily spend an hour talking about Assembly Language in detail and what you need for the exam but this is just a basic refresher on the next few slides while machine code uses binary instructions to represent instructions what we call op codes and the data they use operand assembly uses pneumonics that are easier for people to remember as each assembly code instruction represents a machine code instruction assembly code programs can often be much longer than their highlevel equivalents so over here we have the little man computer instruction set that you need to know for your test the little man computer is a very simplified version of a computer that only has a very limited instruction set obviously if you're programming in modern Assembly Language for example x86 or risk platform you're going to have a lot more instructions and the exam board just want to know that you can do the basics so I'm going to take a look at two programs and just take you through how they work line by line first of all we have a very simple program that just adds two numbers together and outputs the result line one a number is entered and stored in the accumulator that's what imp does imp line two the contents of the accumulator are stored in a memory location labeled num line three a number is entered and stored in the accumulator this will overwrite the previous entered value so if you haven't stored the value of the accumulator into memory it will be lost when you input another value line four the value held in the memory location label num is added to the value held in the accumulator five the value in the accumulator is output so Out means output nice and simple line six is HLT or halt so the program ends and then line seven we've declared that we're going to use a location in memory and we're going to label it as numb so these are kind of like our variables we decare them though at the end of the program not at the start like we usually do in high level languages so I'm going to be taking a memory location and I want to refer to it as num so I'm going to declare that at the bottom of my program and then I can use it in the rest of my program now we have a more complicated program this program can pass two numbers that are input and we'll output the second if it is bigger otherwise it outputs the first so basically it's doing a comparison and deciding which of the two numbers input is the biggest and then outputting it so line one a number is entered and stored in the accumulator line two the contents of the accumulator are stored in a memory location labeled first line three numers entered and stored in the accumulator again this will overwrite the previous entered value but that's okay cuz I have stored it in memory line four the contents of the accumulator are stored in a memory location labeled second line five the value held in the memory location labeled first is subtracted from the value held in the accumulator note the order of the subtraction there line six is starting to get a little complicated if the value held in the accumulator is zero or positive jump to the location labeled second big line seven fetch the value held in the memory location first and store it in the accumulator line8 the value in the accumulator is output line n always jump to the location labeled program end line 10 start with a label that could be jumped to from elsewhere in the program fetch the value in the memory location second and store it in the accumulator 11 the value in the accumulator is output line 12 starts with a label that can be jumped to from elsewhere in the program the program then ends and then we have declared our two memory locations that we want to use we're going to have a memory location labeled first and another memory location labeled second that we can use to store values throughout our program if you find this a bit confusing go to little man computer website type it in run it see what's happening do a bit of experimenting modes of addressing memory memory address modes determine the method used by a running program to access its data or the next instruction if you're programming in a high level language then you don't really have to worry about this but if you're programming for example in a assembler then you do have control about which addressing mode that you use the ones we need to know about are immediate addressing means that the data to be used is hardcoded into the instruction itself the operand is the data direct addressing here the operand contains the memory address telling the CPU directly where to look indirect addressing means that the address of the data is held in an intermediate location so that the address is first looked up and then use locate the data itself indexed addressing means that the final address for the data is determined by adding an offset to a base address this is what we could use for something like an array for example now let's look at objectoriented languages so again this is another huge topic I could spend hours talking about this again we're just going to revise it just give you a few key points on a few slides objectoriented languages oo is a style of programming where we try to understand a computer program in the same way that we understand Real World objects it is a programming language model in which programs are organized a z instead of an S there American spelling in which programs are organized around data or objects rather than functions and logic sometimes referred to as oop objectoriented programming an object can be defined as a data field that has unique attributes and behavior the main idea for objectoriented languages is to gather the data what we call attributes and all the functions methods that act upon that data into one entity called a class so making data hiding through encapsulation and abstraction code reuse through inheritance and polymorphism and maintenance much easier object oriented programming oop relies on objects in the real world being classified now remember a class is just a template a cookie cutter it is used to define what attributes and methods objects of a certain type should have all classes of three main sections a class name attributes all the information generic to that object and methods the procedures and functions that allow you to access and manipulate data so over here you can see we've created a class called dwelling and it represents where somebody lives so the class name is just dwelling all dwellings need an address and a number of rooms and the methods that we require are going to be output data get address and get number of rooms this is very simplified of course again you'll notice this is just a template there's no actual information stored it's just the structure of what the data is going to look like we then use the class to create or instantiate new objects so we can have different dwellings with different attributes that can access their methods here we'll have a look at the entire dwelling class written in pseudo code so this isn't C++ or C or Java it's just the OCR pseudo code just to make it nice and easy for everyone to understand we start with the name in this case class dwelling we then declare the attributes so again these are just variables we have the keywords private or public attributes are typically private that means we can can use encapsulation the data is not accessible from outside the class we then move on to our Constructor we know that that's a Constructor because we're using the keyword new obviously it has to be accessible from outside of the class so it is declared public it takes in the values that we require so we can set those attributes to the values that we need to hold we then have the methods the procedures and the functions uh that we require in this class again you can just write them like you would any procedure or any any function just remember typically they will have the keyword public because often there'll be access from outside of the class then we can use this to create new objects by instantiating them just like this again we're using that keyword new and the name of the class here often just simply being able to instantiate a simple object in the exam can be worth two or three marks some more key words abstraction objects only reveal internal mechanisms that are relevant for the use of other objects hiding any unnecessary implementation code this concept helps developers make changes and additions over time more easily encapsulation the implementation and state of each object can be private this characteristic of data hiding provides greater program security and avoids unintended data corruption this can be an advantage of of oop over procedural languages inheritance this is the concept in which we define a class which inherits attributes and methods from a parent class this encourages code reuse in programming polymorphism the ability to use the same code to process different objects according to their type the program will determine which meaning or usage is necessary for each execution of that object cutting down on the need to duplicate code 1. 3.1 compression encryption and hashing compression when transmitting files storing very large number of files or storing a large number of files we need to compress the data to make it smaller there's two main types lossy compression and lossless compression with lossy compression you're removing data to reduce file sizes whereas with lossless compression there is no data loss lossy compression achieves more compression than lossless however lossy compression you are resulting in a reduced quality compared to say lossless where there is no loss of quality with lossy compression it depends on the kind of fault tolerance of human senses sometimes you might notice this you might not but lossless obviously you never have that loss of quality lossy compression is irreversible the discarded data cannot be recovered whereas with lossless compression it is reversible the exact uncom compress data can be recovered here we have a little table just taking you through the basics of lossy and lossless compression and some key information that you need to know to go into it to a little bit more detail let's look at a couple of forms of lossless compression first of all rle or run length encoding this replaces repeating consecutive sequence of data with a single data value and account of how many times that data value occurs for example if there's a sequence of 100 blue pi in an image this could be encoded as blue b for blue 100 this process works best if there are long sequences of the same data however small files without long sequences of repetition may end up being larger after compression in the image below there are 144 pixels with a color depth of 8 bits per pixel so the uncompressed image size would be 144 bytes after un lengthen coding is applied the size would be 70 bytes we can further take run length encoding and apply it at bit level another form of lossless compression is dictionary coding this makes use of redundant repeated data so that if a data item occurs multiple times the item is stored once in a dictionary and then the position of that data is also stored the best savings are in Long files with lots of repeated data small files with little repeated data may end up being longer after compression considering the following sentence if you're not fired with enthusiasm you will be fired with enthusiasm the original text is 70 characters and let's say one bite per character we can then use this to build a list of unique words of the text so we have our dictionary and to store the dictionary let's say is 36 characters we can then store the text just as the sequence of numbers representing the order of the words the new text well we have 36 in the dictionary 26 in our list after to include spaces there obviously as well and that gives us 62 bytes we've gone from 70 to 62 which is a reduction of about 11% now remember the original can still be reconstructed exactly no data is lost for larger blocks of text with many repeated words this could reduce the size of the file consider ably encryption is the process of scrambling data in such a way that only legitimate and authorized users can read it in symmetric encryption the same key is used to encrypt the message and also decrypt it this works well when you can physically give the key to another person so you know that it's been passed securely and then you can then pass messages and data to each other that can be decrypted easily asymmetric encryption however requires the use of two different keys this makes it much better for use across something like the internet where two computers cannot meet and securely exchange Keys the key used to encrypt the message in this case is not the same as the key needed to decrypt it one of the keys is publicly known and is used to encrypt messages a second key is kept private and is used to decrypt the message if you have have The Scrambled Cipher text and you have the encryption key you cannot decrypt it you can only decrypt it if you have the private key this is sometimes known as a public private Key System hashing is generating a value or values from a string of text using a mathematical function this is a one-way process that scrambles data if we apply a hashing algorithm for example sha256 the opening chapter of A Tale of Two Cities we get something like this some uses of hashing include faster searching hashing can be used to speed up searching a database if you store an index of hashes users can search for the shorter hash rather than the longer data we can use it to verify the Integrity of files hashing can be used as a digital fingerprint to verify the Integrity of files you can run a hashing algorithm on a downloaded file to see if it matches the one provided we can also use it to help encrypt passwords when a user chooses a password it is subjected to a hashing algorithm that transforms it into a fixed length hash value this not the password is then stored on the server so the password list is stolen it will not Grant access so if you type the hash directly into the password field when you're logging in obviously it'll run the hashing algorithm on that and it'll come up with some gobleg that doesn't match what's stored in the database possible issues with hashing algorithms data collisions the algorithm has to ensure there's a low risk of different files producing the same hash calculation time there's a computational overhead for hashing and if this is too high it may discourage usage this is why in the past and even sometimes in the present proper hashing isn't done on passwords that website store size the algorithm has to produce hashes that are smaller than the original file otherwise there's no point in using it to make comparisons next up we have 1.3.2 databases fun for the whole family a database is a structured persistant collection of data a flat file database is where all the data is stored in one large table this is easy to set up and can be created in software such as Excel so spreadsheet software the main problem with a flat file database is redundant data data that is repeated needlessly a relational database is where the database is stored in Separate Tables that are linked together through the use of primary and foreign keys so here is a simple database for a school library at the top here you can see the flat file system all the fields all the records everything is in one table you can see there is a lot of repeated data there if you wanted to update somebody's phone number or a book title or a name it would be quite difficult to make sure it's updated everywhere consistently whereas with the relational database at the bottom you have three tables students borrows and book the tables are linked together through the use of primary and foreign keys so member ID links student and borrows and book ID links borrows and book together some more vocabulary a primary key is a field Within a database which enables every record to be uniquely identified foreign key is used to link tables together a field in one table that is linked to a primary key in another table secondary key is made on a field that you would like to be indexed for faster searches a table can have more than one secondary key we model entities and relationships by means of an entity relationship diagram sometimes referred to as an ER diagram there are three types of relationship between entities we have one to one one to many and many to many if you're drawing this in the exam pay particular attention to the relationships to make sure you get them right it's very easy to make a mistake here many to many relationships should not exist in an efficient relational database they break the rules of normalization that we'll look at later if you have a many to many relationship a link entity needs to be added this is an entity that sits between the two current entities and has a on to many relationship with each so we have students and courses we can transform that so we have students linked to registration which links to courses actor and films can be changed so we have this cast entity in the middle so actor to cast has a on to many relationship and cast to film has a on to many relationship again it's always going to look the same as this pattern one to many many to one it's always going to be the same when you draw it like this capturing Data before setting up a database the data must be collected the data entered into a database must be accurate we have the expression garbage in garbage out for a reason methods may include data capture forms could use optical character recognition OCR to speed up the capture process we could have web forms that we're very familiar with filling in barcodes QR codes magnetic stripes Etc selecting data Well we'd often use SQL for that structured query language this is a common query language for all databases which allows data to be extracted from a database a user may also be presented with a graphical interface to help sort and filter the data depending on their database management system managing data the database management system provides a layer of abstraction between the user or database designer and the data the dbms hides the underlying structure of how the data is stored enforces data Integrity rules and provides secure access and encryption SQL is both a data definition language and a data manipulation language it can be used to modify the data creating and changing tables adding records deleting data Etc exchanging data of often we need to exchange data between databases and other applications and there are a variety of different ways to do this now in the exam you're unlikely to be asked specifically about one of these methods however you do need to be able to describe one or two for use in a certain situation so whether it's XML or Json or SQL or CSV files or apis or electronic data inter change you want to probably memorize two or three of these just so you can talk about them in an exam if you need to now moving on to normalization to third normal form I'm going to spend a little bit more time on this just because I find this is something students often struggle with uh when we do revision lessons in school normalization this is a process where a collection of data is gradually organized into tables in a series of steps each step leads to what we call a normal form for your a level you need to understand up to 3 NF third normal form zero normal form this just means the data is not normalized yet it's just a very basic flat file database all the fields are in one table first normal form to decide whether the data is in one NF you must check the data conforms to the criteria listed here each record must have a primary key remember this is a single attribute or combination of tributes for uh composite primary keys but could be guaranteed to be unique two the data in each field each column must be Atomic this means a field contains a single value that cannot be sensibly subdivided three each record must have no repeating groups of attributes a set of attributes that appear more than once within the record not the table is a problem and four each field must be unique repeated or similar columns should be removed second normal form to decide whether data is in second normal form to NF you must check the data conforms to this criteria first of all the data should be in first normal form and then two there should be no partial dependencies partial dependencies arise where a table has a composite primary key check that all non-key Fields depend on the entirety of the composite primary key assign the data is not in second normal form is data sets that occur in multiple rows if you do find their partial dependencies split the table on that attribute and move to a new table create relationships between these new tables and earlier Tables by means of foreign Keys third normal form for a database to be in 3 NF well got to check the data is in second normal form first and then we have to remove any columns that are dependent on non-key fields and not on the primary key there must be no non-key or transitive dependencies call them what you want it means the same thing for third normal form check that each non-key column is dependent on the key the whole of the key and nothing but the key so let's have a look at some uh an example here so we got a little database here we can look at and go is this in first normal form well let's have a look at our criteria each record must have a primary key yep it's got a primary key the data in each field must be Atomic nope that is not true student name is not Atomic each record must have no repeating groups of attributes well again that's not true each record has multiple subject numbers subject names Etc within it can't have that is each field unique yep it is so it works on that field so two and three it fails the test for first normal form to make it first normal form we must make student name Atomic separating forame and surname we must also remove all duplicate values by creating separate rows for each instance of a subject and we have this now we can make a composite primary key Now by combining student number and subject number together so you can see they're both underlined that is the composite primary key now we have to decide is it in second normal form or do we have to make any changes well let's have a look at it forame surname and address depend only on half of the primary key which is student number on the other hand subject name teacher number and teacher depend only on subject number a sign of this is there's a lot of repeated data in the records so again to make it second normal form we have to make some changes we create two tables both are linked together by means of the foreign key student number so student number is obviously a primary key for student and we can all use that to link to the correct subject in the subject table we have a problem though one student can take many subjects one subject can have many students We've Ended up creating a many to many relationship and we want to not do that so we need to create another entity another table to join these two together go from student to subject student to registration to subject in the exam what you call that new third table doesn't really matter just give it something sensible but remember it's a one to many relationship between all the tables here so now we can link all three tables together by the use of foreign keys so student number will link to the student table and subject number will link to the subject table we still have a problem though if we're in third normal form because subject is not fully normalized we have transitive dependencies because not all details on this table are dependent upon the primary key teacher depends on teacher number not subject number so we need to take normalization a step further and eliminate any non-key dependencies so now we have a teacher table and teacher number links both tables together so now we have third normal form and everybody's favorite SQL I really do like SQL I think it's really simple to get marks for SQL in the exam if you know it well enough you do have a bit to spend a bit of time on it not make careless errors that students often make but if you've got some good understanding of this it's really a good way to pick up marks in the exam so what do we know for what do we need to know for SQL we need to know the basic code select from where select your field names from the table name where a condition occurs don't get your field names and your table names mixed up that happens all the time always remember the order select from where you can do it in one line two lines lines doesn't matter as long as you get the keywords in the right order so the example here is Select forame comma surname from student where grade greater than 50 and year equals 12 don't think that's too difficult but again requires just that little bit of practice and confidence we also need to use wild cards if we are selecting all the field names we don't have to list all of them we can just use the asteris and we can also use the percentage sign to represent 0 one or M multiple characters so for example select all the fields from student where surname like and then in speech marks a and a percentage signs which starts with a and then has characters after that we can use select statements within select statements to perform more complex queries using nested selects again this is something that students can find difficult if they haven't got a bit of practice the query below returns all the students of a grade higher than the student called Smith this query can look a little difficult to start with select name from student where grade greater than Select Grade from student where surname equals Smith so what we need to do is start with the inner select first the bit this in Brackets we want to find all the students of a grade higher than the student Smith so we first of all Select Grade from student where surname equals Smith literally look through your database and find the grade of Smith say 52 for example example and that's all this will return it will return a number then select name from student where grade greater than the grade that we've just recovered so if you think about doing the inner part before the outer part it maybe makes a little bit more logical sense the join keyword allows us to join two tables with a foreign key and retrieve records from both select field names from table one join table 2 on table 1. field name equals table 2. field name so again that structure might be a little bit clumsy might just have to just write it out a few times to memorize it but the key point is you're you're linking the foreign key there you're saying there is a field in table one and a field in table two that join together they have the same information they can have different names that's fine but you just have to tell it to link them together so the example is uh here select student. surname course. name from student join course on student. courseid equals course. course ID so you can see you have the table name Dot and then the name of the column the name of the field they don't have to be called the same thing it might be student doour ID equals course doour number that would be fine transaction processing a transaction is just a change to the database the database management system ensures that when a transaction takes place the database changes from one consistent state to another for example when a transaction is taking place record may be locked to prevent another transaction from interfering with the first transaction the assd rules to protect the Integrity of a database we have atomicity consistency isolation and durability you're often asked about these in the exam and the number of students who forget what the c means or forget what the d means is usually quite impressive so just memorize these atomicity the transaction must be completed fully if it is not completed fully it will not be recorded Ed consistency any change must not break the database it must be consistent with how it was before the change isolation a transaction must be isolated and not interfere with another transaction and durability a transaction must remain in the database data Integrity refers to the accuracy and reliability of data and is of prime importance in any computer system validation and verification techniques can help Ensure data Integrity referential Integrity the database is consistent and there are no conflicts between data stored in different tables so every foreign key has a matching value to a corresponding primary key make sure you cannot delete records that are used by other tables ensures there are no orphan records records unrelated to another table when they should be record locking is used to lock a table in a table until a transaction is completed if the transaction fails the record is unlocked for the next person to access redundancy redundancies must be built into a database system for organizations such as hospitals military forces and banks for obvious reasons this means they will have multiple clone databases running at the same time that are all mirror images of each other and these databases should be held in geographically remote locations to prevent catastrophic system failure moving on again we've got 1.3.3 networks networks are collections of connected computer devices theyve become important because of the need to communicate and share data a central store of data enables all the users of the system to see the same upto-date version of the data they need allows the sharing of important resources for example printers or disk storage easier to back up data held on Central Storage efficiency of network depends obviously on the network manager if there is a problem within the network shared resources may not be available performance of a network degrades or gets worse as traffic increases and clearly you can have security concerns Network Hardware that you need to know about Nick a network interface control or network interface card enables a computer device to be connected to a network this could be a separate card in a big desktop or it could be uh a little chip built into the motherboard for a tablet or a mobile phone or something like that switch connects wi devices on a local area network wireless access point or WAP connects wireless devices on a lan router connect different types of networks together we have different transmission media copper cables transmit electrical signals typically used for ethernet cables fiber optic cables are made made up of many thin glass strands or fibers which transmit data as pulses of light and we also have radio waves which uses part of the EM spectrum to connect devices wirelessly we have different ways of classifying networks let's have a look at extent local area network covers a small geographic area for example a building or a small group of buildings the company that uses the network is responsible for the infrastructure Wan wide area network covers a large geographic area for example a city a county a country continents even infrastructure is provided by a large telecommunications company that lease or rent our access to the network to other businesses pan personal area network links personal devices such as phones tablets and other devices that people commonly have typically using Bluetooth you also have the idea of Sands and mans storage area networks and metropolitan area networks but those terms aren't so commonly used anymore we can also classify networks by topology a bus topology attaches nodes along a common backbone cheap to implement but if there's a problem with the backbone the whole network fails not commonly used nowadays ring the nodes are attached on a circular backbone data frames are sent in One Direction they pass through uh each node and are collected by whichever node is specified by address data in the frame again not commonly used nowadays in fact bus and ring haven't been commonly used since before I was in secondary school but they're still on the syllabus we still have to talk about them a better way to connect our networks together is a start apology here each node has a separate connection to a central switch or a hub typically a switch nowadays we don't really use dumb hubs anymore relatively cheap to implement and robust cable failures do not affect the whole Network and is the most common topology in homes and offices around the world mesh all nodes are connected to every other node so it is extremely fault tolerant but obviously doing this as a wired version would be extremely costly and complex this is much more useful for Wired networks especially for networks where you have to have really good resilience Network protocols these Define rules for data transmission between devices on a network a protocol allows devices to exchange data with one another as long as they're following the same rules a standard is a formalized protocol accepted by most of the parties that implement it without standards only hardware and software made by the same company could be used together having official standards is very important for networks but remember not all protocols become standards common protocols that you need to know about our TCP transmission control protocol used to ensure error free transmission IP Internet Protocol used to address and transfer packets across the internet between routers HTTP hypertext transfer protocol for accessing and transmitting worldwide web documents https hypertex transfer protocol secure a secure encrypted form of HTTP FTP file transfer protocol for transferring files from one computer to another SMTP simple mail transfer protocol for sending and managing emails pop post office protocol for retrieving and managing electronic emails and IMAP internet message access protocol a more advanced protocol for retrieving emails protocols and layering network communication is very complex we cannot have only one set of rules one protocol to handle every aspect of network communications however a problem can be broken down into components Each of which is easier to solve than the whole this has led to the concept of layering whereby different aspects of a Network's functionality are conceptualized and developed separately each component part called a layer concentrates on one aspect of the network without worrying about the others so for example here we have a typical model here we've got the application layer the transport layer the internet layer and the network or link layer so this is the TCP IP model TCP IP Suite that is kind of the basis for how we Tri transmit data across the internet the application layer is concerned with the production communication and reception of data it governs how data Moves In and Out of applications the transport layer is concerned with the establishment and termination of connections between Network entities via routers it is responsible for providing a reliable flow of data across the network the internet lay is concerned with providing links between different network types essential features of the internet that allows interoperability between all connected systems and the network or link layer passes data onto the physical Network for example copper wire or wireless radio waves so again the TCP IP is the most common set of protocols it's used to bring the internet all together as well as private networks uh it basically allows you to get data from point to point B nice and easily and you can see the idea is we've got the application layer transport layer internet layer and then the bottom layer here but we can have different protocols in different layers so we could have HTTP as the application layer or if we need an encrypted connection https we can have ethernet at the bottom or we could have a Wi-Fi protocol for example and we can upgrade the ethernet protocols or the Wi-Fi protocols over time without having to swap out any of the other protocols being used at different layers the domain name system DNS matches domain names to IP addresses using domain name servers so for example we can take a domain name like example.com and translate that into an IP version for or an IP version 6 address remember we need URLs uniform resource locators the full web address because it's easier to remember than an IP address people are very bad at remembering long strings of numbers domain names are constructed from a hierarchy so again you can see the example there like bbc.co.uk for example circuit switching the establishment of a physical connection between two communicating entities it provides an exclusive dedicated channel the channel remains open for the duration of the communication session so circuit switching is like when you watch an old movie and some makes a phone call they go through to the lady at the circuit exchange and tell her which one which phone number you want and then she makes an actual physical Connection by moving those wires across not really suitable for the modern internet you can't really do that every time you want to log into your social media so we use packet switching which divides a message into Data units called packets packets are sent across a network by whichever routes are available or most efficient and this is what we use for modern computer networks authentication most networks are protected by users having a username and password these can be CED quite easily by simple methods such as asking someone for them social engineering or simply guessing you can also have a Brute Force attack where you just try every combination 2fa two Factor authentication in addition to the above uh we can send a code to a phone or use a special security device I'm sure most of you are familiar with two-factor authentication nowadays we also have the use of biometric information such as fingerprints or Iris scans or face scans as well firewalls Monitor and filter data coming into and out of the network again remember this is both ways often the exam students just write one or the other but it's coming into and out from a network can be Hardware or software or a combination of the two and can use techniques such as IP address filtering packet filtering and Port blocking and obviously we've got encryption we've mentioned before but sensitive for private data should always be made unintelligible to unauthorized individuals before being sent across the network proxies these are computers that are interposed between a network and a remote resource so there's never a direct contact between the users computer and the remote resource everything goes through the proxy server VPN or virtual private Network uses encryption to extend a private Network across a public network corporations often use this to allow the people who work for them to use a wide area network as if it were a local area network can circumvent Duo restrictions and censorship protect personal identity and location and help to stay Anonymous on the internet moving on let's take a look at Network architectures starting with client server client server is a model where one entity the client requests resources and services from another called the server the advantages of client server Network architectures client computers need not be EXP expensive or powerful it is easier to make data and often software accessible from anywhere in the network easier maintenance easier for backups Banks of servers can be combined to make the best use of potential resource intensive activities can be devolved to a high-end machine easy monitoring of system performance amongst others disadvantage cost servers can be expensive and require specialist staff to set up and maintain if the central server fails it would bring down the whole network in contrast we have peer-to-peer in a peer-to-peer Network all computers have equal status each computer on the network acts as both client and server depending on circumstances the advantages of peer-to-peer include the fact that it's cheap to set up as there are no additional Hardware costs and robustness as there's no single peer that can bring down the network disadvantages include if a peer goes offline the resources stored on that device cannot be accessed and there's no Central maintenance you can update software centrally you can't back everything up centrally Etc 1.3.4 web Technologies there are three main elements to web pages HTML hypertext markup language for content and structure CSS cascading stylesheets for presentation and format adding and JavaScript to add interactive elements so here straight from the exam spec is everything you need to know about HTML so you need to be aware of these to be able to read them and be able to code them if required again it does say any other additional HTML tags will be explained within the question itself so here is a very simple web page that uses all of those so again this is about as complex as the HTML will be so if you understand this and you can code it you're all good and if we were to render that in a web browser we would end up with something like this again not too advanced it is a web page Circa about 1997 that they're looking for again CSS this is what you're expected to be able to know in terms of The Styling and formatting so again worth spending a bit of time on this because it's one of those situations if it comes up in the exam either you know it or you don't and again we've got some examples here of what it would look like either uh embedded directly into a web page or with an external stylesheet and again that would look something like this which is perfectly hideous JavaScript is again an interesting one because it's a fully featured language what you need to know about JavaScript for the exam isn't that much you need to be able to read some basic JavaScript but if you've done any programming at all JavaScript should be quite easy to follow in terms of actually coding it it's really about outputting something on screen and you can see here there are three different ways of doing that any additional JavaScript will be explained in the question itself you can see here we have a simple function to validate form again even if you're not familiar with JavaScript you can probably see how this works so in the exam you may have to debug it if there's an obvious error or just read it and understand it and then the rest of the page isn't too difficult you can see there's a little bit to Output the code as well here and you just have to really follow along with that in an exam situation search engines they build up indexes of websites that can be searched quickly by various search algorithms when a search engine indexes a page a program called a spider or a crawler or a bot transverses the web it takes each word in the document and it adds an entry for the page under the word in the index alongside the word position on the page page rank algorithm one of the most successful ways that search engines have been used to produce meaningful results basically this is what Google came up with back in the day this doesn't just look at content to assess relevance it ranks possible web pages according to external links the following factors may affect a website's page rank ranking the number of pages that link to the site the page rank of the linking sites the number of outward links from the site the process can be applied recursively to get a fairly good estimate of how important a page is now this is the uh original algorithm you don't really need to memorize the whole algorithm it certainly never come up in the exam what they might ask you about is the damping Factor the D here okay so the damping Factor can be set between Z and one the damping Factor reduces the ranking on the assumption that a typical user will eventually give up clicking and represents the probability that the user will continue and it's generally taken as being about 85 client side scripting the code is run locally on the user's computer through a web browser transfer some of the processing load away from the server with related performance benefits input data can be validated by client side scripts before being sent this will reduce the likelihood of erroneous data being sent for the server to validate process client side scripting would include something like JavaScript server side the code runs on the website's server less security concerns than client side scripts remember it is vital to keep the data owned by an organization secure SQL processes will largely have to be located at the server end no sensitive data should be sent to the client where it could be intercepted and manipulated while a user can view client side scripts by inspecting the web page serers side scripts are not visible to the user this would include something like PHP 1.4.1 data types primitive data types every piece of data that is stored has a type the type determines how it is stored and what you can do with the data I will assume that if you reached a level that you are familiar with primitive data types but just double check that you do know the definitions for character string Boolean integer and real it is easy to make a mistake in the examp and you're throwing away kind of very simple marks to get another topic that you should be familiar with is representation of positive integers in binary we should know the computer store and process data using binary numbers bits we only use one and zero for the bits in binary each digits place is multiplied by two as we move from right to left so we start with 1 2 4 8 16 so on and so forth the largest number that we can represent with eight bits is 255 so we can represent 256 values from 0 to 255 and the largest value that we could represent for example with 16 bits is 65,535 binary to denary conversion what is the 8bit binary number one11 01 in dener well we just have to fill in our table if it's an 8bit number it's from 1 to 128 we write out the ones and zeros if there's a one that's a value that we need to add together so in this example it's 12 28 + 16 + 8 + 4 + 1 = 157 please don't get the values in the table the wrong way around I've seen that happen more than once don't be that student to go the other way from denary to Binary essentially we're kind of reversing the process I want to convert 75 to Binary I can just do this with a process of repeated subtraction so start at the left side with the most significant bit try and do a subtraction if you can add a one if you can add a zero and then just work work your way until essentially you run out of values so that's an example there of how we'd convert 75 to make it 0 1 0 0 1 0 1 1 getting a little bit more complicated use of sign and magnitude to represent negative numbers in binary sign and magnitude is a method of differentiating between positive and negative binary numbers the most significant bit determines whether it is a positive or A negative number if the most significant bit is a zero the number is positive if the most significant bit is one the number is negative again don't get that mixed up so we can see here we got an example for Min -3 and POS 7 we've got the value for three and then it's a one at the start so we know it must be negative and then we have the value for seven and we've got a zero at the start so we know it has to be positive there are two problems with sign and magnitude half's the biggest value that we can represent and needing a sign and a value complicates doing the arithmetic IC two's compliment a much more effective approach with two's complement we make the most significant bit a negative value this changes the column headings for 8 Bits for example to- 128 64 326 8421 so if we have a look at this value here 1 1 0 1 1 0 1 1 instead of being 128 that starts a ne28 + 64 + 16 + 8 + 2 + 1 and that gives us a total of- 37 next up we have the addition of binary integer so nothing complicated here just basic binary addition what are the rules 0 + 0 is 0 0 + 1 is 1 1 + 0 is 1 1 + 1 is Zer carry 1 because 1 + 1 is 2 which is 1 Zer in binary and 1 + 1 + 1 is 1 carry one because 3 1es is three which is 1 one in binary note in the don't just do a binary denary conversion and then add them up normally you must show evidence of knowing how to perform binary addition you have to show your carries and then you can do the conversion to double check but you have to show you understand these rules so we have two binary numbers here we're going to follow those rules to add them together bearing in mind when we add one and one we've got to carry one to the next column or if we got 1+ 1+ 1 again we have to carry one to the next column again once I'm finished I can do a conversion just to double check that I've got the right answer but make sure you show this table and you show your carries after addition we have to talk about subtraction rules of binary subtraction are quite simple 0us 0 is obviously 0 0 - one is the only complicated rule because then it's one and then you have to borrow from the next column and we'll look at that in an example in just a moment 1 - 0 stays as 1 and 1 - 1 is of course 0 so in the case of 0 - one we have to borrow two which means we take away one from the next column if the next column is a zero we turn it into a one and this repeats until we encounter a one that we can borrow they kind of fall like dominoes so if you look at this example here starting with the least significant bit over on the right hand side one - one is of course 0 0 - 1 is our special occasion so we say it's one we move along to the next column we've got a one there so we borrow from that we make it a 0 0 - 0 is 0 we move along again we've got 0 minus one so it's a one we go along to the next column to borrow a one but it's a zero there not a one we can't do the borrow so we flip that zero into a one and then move along to the next column and then take away the one from that column we borrow it from there going back we end up with 1 - 0 is 1 0 - 0 is 0 1 - 0 is 1 and 1 - 0 is 1 and that gives us our final answer convert positive dor integers into hexadecimal what is, 1461 in heximal we're just dividing by 16 and keeping the remainder so 1,461 divid 16 is 91 remainder 5 91 divid 16 is 5 remainder 11 remember 10 11 12 13 14 15 convert to a b c d e f so the 11 becomes a b 5 / 16 is 0 remainder 5 therefore if we put the remainders together we get a final answer of 5 B5 converting heximal to dener what is 23f in dener we convert 2 3F into dener value so that's 2 three which stay the same and then the F becomes 15 and then we do a calculation so in this example we're going to start with uh this table here and the First Column is 16 power of 2 16 power of 1 and then 16 to^ of 0 which is just 1 so we have 2 * 16 * 16 is 512 3 * 16 is 48 15 * 1 is 15 put all those together we get 575 convert binary to hexad decimal super easy we divide it into nibbles so four bits in each nibble and we lay out the table like this 1 2 48 and we just add all the values together so 0 0 1 1 is just 2 + 1 is 3 and then we have 1 0 1 0 which is 8 + 2 which is 10 10 we have to flip over because it's hexadecimal and that becomes an A so we have three and a convert hexadecimal to Binary so let's convert C6 to Binary first convert to denary and then convert each denary number to a single nibble C becomes 12 which in a single binary nibble is 1 1 0 0 six stays as six so that 0 1 1 0 in binary put them together for our Answer 1 1 0 0 01 1 0 representation of floating Point numbers in binary real numbers are represented in floating Point form using a mantisa and an exponent the mantisa represents the significant digits the exponent represents the Power of Two the mantisa is raised to the examle questions will tell you the size of both a mantisa and the exponent please make sure you read that carefully example the following 8bit number has a 5- bit mantisa and a 3 bit exponent so the number we're given is 0 1 1 0 1 0 1 0 our mantisa is 01101 our exponent is two move the binary point two places to the right and we get 1.01 which is 3.25 in dener remember if the exponent starts with a one move the binary place to the left instead if the first bit of the mantisa is one then it is a negative number so example here is 1 1 0 1 011 we convert the mantisa to siden magnitude form by reversing the ones and zeros and adding one so 0 1 0 1 0 becomes 0 1 0 1 1 that gives us a mantis of 0.1 011 the exponent is still three we move the binary point three places to the right to get 010 1.1 or - 5.5 normalization of floating Point numbers in order to improve the accuracy the mantisa should not waste bits by having redundant digits at the start of a value for a positive mantissa after the leading zero the mantisa is floated so that the zero is followed by a one for a negative mantisa after the leading one the mantisa is floated so that this one is followed by a zero this is done by adjusting the exponent once the binary point is flooed to the right place positive mantises are padded with zeros negative mantises are padded with ones so using an 8 bit floating point with five bits for the mantisa and three points for the exponent in the binary fraction 0.0011 we need to float the binary point two places to the right so need an exponent of Min -2 in three bits 2's complement minus 2 is represented by 1 1 0 0.0011 is written as 0.11 0110 in normalized floating Point form a normalized floating Point number will always start with either 0 1 or 1 0 and that's sometimes is an exam question how do you know well that's how you know some floating Point rules briefly negative numbers will always be stored in two's complement positive numbers stored in two's complement remain unchanged if the mantissa or the exponent begins with a zero then it is positive if the Mantis or exponent begins with a one then it is negative to perform two's complement hold the bits to the right of the first one flip the bits on the left to reverse it do the same moving the decimal place to the right is the same as shifting a number to the left and the mantisa will get larger as it has a positive exponent moving the decimal place to the left is the same as Shifting the number to the right and the mantisa will get smaller as it has a negative exponent if we have more bits for the exponent we lose accuracy but have an increased range if we have more bits for the mantissa we increase accuracy but have a reduced range there is always a trade-off between the range and accuracy when choosing the size of the mantisa and the exponent floating Point normalization rule rul we normalize mantises to maximize the Precision accuracy of the value stored and to avoid multiple representations of the same number you can spot an unnormalized mantisa because it does not begin with 0 1 or 1 0 to normalize a mantisa we float the binary Point Left Right shift to be in front of the first significant digit and adjust the exponent accordingly which will be negative if the Mantis is positive we lose the extra zeros and if the mantisa is negative we lose the extra ones we will need to unnormalized perform an addition or a subtraction in order to line up the decimal places thus making the exponents the same when we unnormalized a positive mantisa the values paded with zeros to fill in the mantisa on the left when unnormalized a negative mantisa the values padded with ones to fill the mantisa on the left adding and subtracting floating Point numbers when adding and subtracting normalized floating Point numbers we need to undo the normalization of the mantissa we need to make the exponents the same for both values all the values so the binary point is in the same place you could just change one of the exponents so that they are the same but in exams this often leads to error because you shift it the wrong way it is always better to unnormal all of the mantises using a 16bit floating Point number with 10 bits 2's complement mantisa and six bits 2 complement exponent to add numbers we must match the exponent so that's the the next slide so you have a look at this if you follow the rules that I've gone through that takes you through the whole process we make sure we normalize it at the end just to be sure but if we follow this method we should get the right answer so again this is adding it same idea if we do a subtraction again we can use two's complement there as well well again making sure we uh discard the Overflow bit and make sure we normalize the answer and always we can just kind of double check uh if we do a deer conversion just to make sure we do have it right but do make sure you are showing enough stages often in the exam if this is a four or five mark question for example you need to show four or five lines of working if you're taking any shortcuts and skipping things over you're probably going to lose marks bitwise manipulation and masks moving the digits in a binary number left to right is called a binary shift each time the value shifted one place to the left the number is multiplied by two so if we have 33 represented in binary and we shift everything one place to the left you can see we now get 66 and of course each time the value shifted one place to the right the number is divided by two so for example if we have 68 represented in binary and we move everything one place to the right then we're going to get 34 shifting number left when the most significant bid is a one means that we lose one which results in an overflow error Shifting the number right when the least significant bit is a one means that we lose a one which results in an underflow error and results in a loss of precision logical operations and masking the ALU can perform bitwise operations using the standard logical operators not and or an exor not is applied to each bit in the binary to reverse the value of that bit so I think that's quite obvious there for and or and exor the operation is applied to matching bits in two binary numbers the operand and The Mask to determine each bit in the resultant binary value so here you go we've got it for and we've got it for or we've got it for exor again you should be able to work that one out quite easily masking is a very important concept that allows the CPU to manipulate individual bits in the operand checking for values allow ing bits through or blocking them and is useful for checking conditions stored in a binary value masking with a one Returns the operand bit value masking with a zero excludes the upper and bit value or can reset individual bits in a binary value masking with one will always set the return bit to one masking with zero Returns the original operand bit value exor will check that the two bits are not the same that is return one if the bit bits are different zero if they're the same if both mask and operand are the same it returns zero if the mask and the operand are different it returns a one how character sets are used one approach to representing text value is asky the American Standard code for information interchange each alphabet character digits 0 to9 and a selection of special symbols and control codes are represented by agreed binary patterns the asky character set was originally based on 8bit binary pattern using seven bits plus a single Pary bit and was able to represent 128 characters with the values between 0 and 127 the extended asky uses eight bits so it can represent 256 separate characters from 0 to 255 due to size limitations asy makes it impossible to display the wide range of characters for other alphabets or symbol sets for example French or Japanese a more modern approach is Unicode Unicode was originally a 16bit code allowing for more than 65,000 characters to be represented this was updated to remove the 16bit Restriction by using a series of code pages with each page representing the chosen language symbols the original asy representations have been included as part of the Unicode character set with the same numerical values 1.4.2 data structures starting with arrays arrays or data structures which are fixed size so they're static and contain data of the same type stored in a contiguous block of memory a one-dimensional array is a single set of data single row which is easy to visualize a 2d array is a set of data which can be visualized as a table structure with both rows and columns now a three-dimensional array can be a bit more complicated because it's a collection of two-dimensional arrays like a series of tables on top of each other which can be a bit harder to visualize record a record is accessed through an attribute a record is an unordered data structure indices may be programmed to provide the data ordered on a particular tribute the ability to access data through the tribute makes the record structure more user friendly the need to Define all the attributes before use makes the record structure more complex to initialize a list is an ordered data structure a list is accessed through an index the index in indicates the position of the data in the list lists have no predefined number of elements not needing to Define attributes in advance makes the list easier to initialize than a record accessing the data in order by index is straightforward to program Tuple a tuple is an immutable list the data cannot be modified tupal are useful for data that must be accessed by index but must not be changed link L list a list of data together with a set of links to sort the data on various factors data is stored in order it is input and pointers are used to link the data in the desired order a start pointer is used to identify the first item a null pointer is used to identify the last item of data a free storage pointer indicates the first available free location the use of pointers means that unlike arrays data in link list do not have to be stored contiguously in memory they're also referred to as being dynamic in that they can grow or Shrink in size as and when necessary link lists are commonly used data structures with benefits of flexibility and ease of use they can be used to implement other data structures such as stacks and cues below is a list of animals that can be stored alphabetically through the use of pointers below is a list of animals that can be stored alphabetically through the use of pointers so if you have a look here we can see we're storing it platypus dog gerbal so it's not alphabetical but if you follow the pointers then we do get this alphabetical order because the start pointer is pointing at two which is dog and then we go to gerbal and then to platypus so the order is still alphabetical adding data to a linked list additional data is inserted at the next available free node so if we're adding elephant elephant is added to the location indicated by the free storage pointer which is four the free storage pointer is updated to the next location which is five the location in the list is identified it follows dog the pointer for this location is updated to point to the location for the new data item which is four and the pointer for the new data items updated to point to the next item three so if we want to delete Geral from the list dog points to node four which is elephant the data at node 3 can be deleted the node for the deleted item is added to the free storage location in this case it becomes the first available free location cues data is added to the end of the structure data is removed from the start of the structure cues are a first in first out data structure cues can be implemented using other data structures such as arrays or linked lists in either case two extra pointers are required to identify the front or the head of the queue and the rear or tail of the que qes can be both static and dynamic several operations can be carried out on Q's so these could have different names and different scenarios but the idea is basically the same we've got to inq which adds an item to the rear of the que we've got to DQ which removes and displays the item at the front of a queue we've got is empty to check to see if the Q is empty and is full to check to see if the Q is full so you might be expected to use similar operations similar functions or you may have to code them depending on the type of question Q's of course have a wide range of uses in computer science including storing print jobs until the printer is ready to print CPU scheduling and breadth first traversal of a graph qes can be both linear and circular when an item of data is removed from the front of a linear queue all the other items move up one place this is only suitable in a small queue otherwise data processing time can be excessive when an item of data is removed from the front of a circular queue the only processing required is to update the two pointers identifying the new front and rear of the queue Stacks data is added to the top of the structure data is removed from the top of the structure stacks are a last in first out data structure pushes the command to insert data pop is the command to remove data Stacks can be implemented using other data structures such as arrays or linked lists in either case an extra variable is required to identify the top of the stack a top pointer the most common use of stacks is to reverse the order of a set of data items as they are popped in the opposite order that they were pushed into the stack problem with stacks cues a stacker Q cannot grow indefinitely if you try to push more data into a structure you can get for example a stack overflow when this happens it often causes the program to crash obviously it's up to the programmer to ensure that this doesn't happen and it can be the same if your stacker Q is empty and you're trying something like a pop operation we can get an underflow and again this can cause the program to crash therefore the programmer to check that the structure is not empty before tempting to do this trees for data that does not fit into a list for example the directory structure on a computer hardk drive we need hierarchical data structures such as trees the node at the start of the structure is called the root node the nodes immediately down from another node are called children the nodes with children are called parents the lines that join the nodes are called branches binary trees one specific kind of tree is the binary tree where each each node is only allowed to have two children each node contains a left pointer data and a right pointer for an alphabetical list if the next name is higher in the alphabet go right if it is lower go left for numbers this means the left sub tree contains numbers less than the root and the right sub tree contains numbers greater than the root there are three ways to navigate or Traverse a tree data structure pre-order in order and postorder in order in this traversal method the left sub tree is visited first then the root and then the right sub tree so you have a look at this tree here if we do in order it would go a b CDE e f g hi I nice and simple there pre-order in this traversal method the root node is visited first then the left subtree and finally the right subtree so again with this example we would have FB a d c e g i h and finally post order here the root node is visited last hence the name first we Traverse the left subtree then the right subtree and then finally we go to the root so here we'd get a c e d bhi GF graphs graphs are data structures used to represent data items which have connection between them such as locations on a map or products on an e-commerce website the data nodes are called vertices the connections are called edges es edges may be assigned weightings a graph may be directional or undirected in a directed graph the data connection May flow in one or both directions in an undirected graph the edges are all bidirectional there are two methods of traversing a graph depth first and breadth first depth first tree traversal depth first traversal involves traveling down one route as far as possible before reversing and travel traveling as far down the next route as possible so with this uh list of nodes here we would get a b e c d GF with bread first tree traversal this involves visiting all the adjoining nodes for each node in turn so for this we would have a b c e d FG hash tables a data structure that can map keys to values a hash table uses a hash function to compute an index X also called a hash code into an array of buckets or slots from which the desired value can be found during lookup the key is hashed and the resulting hash indicates where the corresponding value is stored hashing is an example of A Spacetime tradeoff collisions a perfect hashing algorithm will generate a unique index should this not be the case a collision will happen when a collision occurs a rehashing algorithm can be used to determine the next available slot in which to store the data or the data is stored in a linked list starting at that location moving on to 1.4.3 Boolean algebra now I'm not going to try and teach you in this section how to do Boolean algebra it's just a revision uh some key points about these topics that you should know or refresh yourself on before your exam so starting with our logic gates here we've got a nice table here we've got our ANS our ores Etc all listed we've got the logic gates the notation examples truth tables pretty much everything you can need to know about simple logic gates here a half adder is a logic circuit with two inputs and two outputs the sumon the carry where two inputs are added in binary so you have to be able to recognize this you know need to know the truth table you need to know the logic gates Etc we put these together we can get a full adder a full adder allows the carry from a previous calculation to be carried forward in the calculation we now require three inputs one for a one for B and one carried over from the previous column this can be done by using two half adders and an orgate flip-flop these circuits are capable of storing information for example RAM memory a flip-flop can store one bit of information flip-flop circuits are combined to make a range of other flip-flop circuits the next one we need to know is the type D the dtype flipflop two flip flops combined to make a dtype flipflop the dtype flip flop delays the signal by exactly one clock pulse it has two inputs data and a clock and outputs the data and the inverse of the data so Boolean algebra so here are the various laws and rules that we need to know about we've got to Morgan's law distribution Association commutation double negation and absorption again you need to be familiar with these as a nice way of simplifying your Boolean algebra and solving those problems we've got another couple of tables here just to help you out we've got some and rules and we've got some or rules again you can pause this and review carom Maps again very useful for simplifying all these Expressions carom maps are a modified form of truth table optimize to enable pattern recognition to be used when identifying minimal logical expressions K maps are maps of possible inputs and mapped against the required outputs so I'll just give you some simple examples just as we review this a two input example nice and simple there you can kind of go through that and double check everything three input example here as well just to show you an example of that and a four input example to get a little bit more complicated but again very useful for simplifying 1.5.1 Computing related legislation the computer misuse Act of 1990 under this it is a criminal offense to make unauthorized access to computer material with intent to commit or facilitate Commission of further offenses with the intent to impair or with recklessness as to impairing operations of a computer so hacking creating or spreading viruses and other malware stealing information for the purposes of blackmail Etc now became illegal in the UK the data prot protection act originally from 1998 strengthened in 2018 uh with the introduction of the general data protection registration or gdpr the purpose of DPA is to control the storage of data about individuals it makes a data controller responsible for the accuracy and security of data kept by an organization about the data subjects and there are eight key principles one data must be used and processed in a fair and lawful way two data must only be used for the stated purpose three data must be adequate relevant and not excessive for the specified use four data must be accurate and kept up to dat five data should be kept no longer than necessary six data should only be used according to the rights of the data subject seven data should be kept safe and secure eight data must not be transferred to organizations within other countries that do not offer a similar level of protection the copyright design and patent Act of 1988 protects the intellectual property of an individual or organization it grants automatic copyright to anyone who has created creative work whether physically or digitally under the act it is illegal to copy modify or distribute software or other intellectual property without the relevant permission and that brings us nicely on to Creative Commons Creative Commons is a licensing framework which allows content producers to publish their intellectual property with licenses that give permissions for others to use their work under such licenses the author may choose to allow complete access for non-commercial use only allowing redistribution of the work providing the user abides by certain conditions so if you've created a work and you want people to use it in certain ways you can use a creative Common's license to give some rights up and allow people to have some kind of creative use of your work but with conditions attached regulation of investigatory Powers Act 2000 gives certain bodies the rights to monitor Communications and internet activity this was prompted by an increase in criminal and terrorist activities on the internet Reaper provides certain public bodies such as the police and other government departments with the right to Demand isps internet service providers provide access to a customer or customers Communications allow Mass surveillance of communications demand isp's fit equipment to facilitate surveillance demand access be granted to protected information allow monitoring of an individual or individual's internet activities prevent the existence of such interception activities being revealed in court and moving on to the final topic 1.5.2 moral and ethical issues so this is a fairly large scale section I'm just going to go through it very quickly you do need to be reading around this looking it news stories and news events making sure you're well informed so you can answer these longer essay questions on these topics computers in the workplace computer technology in various forms plays a major part of the workplace computer technology has changed the skill set required for the modern Workforce so we need more programmers more analysts more technicians Etc but less secretaries clerks Factory workers Etc a Workforce may be subject to monitoring by computer technology to assess their productivity the way they work and their effectiveness the advantages and disadvantage of this issue depend on the type of industry and of course whether you are an employer or an employee remember there's always advantages and disadvantages for every issue automated decision making automated decision making is used where the amount of data or the response speed makes it impossible for a human to react effectively computers use algorithms to process the data and reach decisions the quality of the decision will depend on the accuracy and completeness of the data the predictability of the the situation the quality of the algorithm artificial intelligence AI chat gbt and all that other stuff sort of good stuff AI programs learn from experience they're often based on the expert system model with a knowledge-based inference engine and a user interface many low skilled jobs have already been replaced by machines for example robots in a car manufacturing Factory machines can do dangerous jobs in hazardous environments they can do boring and repetitive jobs and they never get sick or go and strike and they can work 24/7 many experts however believe the AI systems are going to begin to replace humans in mid-level jobs and to a certain extent you can already see that in some Industries AI has advanced to perform some tasks that experts believe would be impossible a few years ago for example beating top human players at the game of Go environmental issues when our computer device stops working or when we simply want a newer device all Tech is simply thrown away this is called E-Waste these devices often include toxic materials that can leech into soil and contaminate Water Supplies over time although modern computers consume low levels of electricity individually compared to older machines collectively there are billions of more devices being used now than in the past data centers cryptocurrency miners such as Bitcoin can use massive amounts of energy worldwide there are however positives for the environment Communications sent electronically do not waste paper or ink people who work from home which is made possible by computers and networks do not have to burn fossil fuels driving their cars to work industrial processes that are computer controlled rather than overseen only by humans can be more efficient and therefore cause less pollution censorship internet censorship is the deliberate suppression of what can be accessed or published on the internet governments or organizations May impose these restrictions for various reasons to limit access to socially unacceptable material to limit access to what they regard as dangerous information of course what one person regards as socially unacceptable or dangerous is not what another person regards as monitoring Behavior people are increasingly being monitored by computer technology your Search terms are tracked and often used in marketing websites you have visited can track your internet history using cookies and similar technology purchase items are often recorded and sold to advertisers who might wish to advertise similar products to you social media posts can be viewed by employers and the Press internet activity at work can be monitored by employers employers can monitor performance using special monitoring tools urin special monitoring tools okay that's funny using is much better people leave a digital fruit print wherever they go mobile phones can track our locations store credit cards record our shopping habits Etc you've got GPS as well which gives you physical locations of where people are all throughout the day and CCTV is everywhere and facial recognition is improving all the time analyzing personal information analyzing large amounts of data including personal data reveals patterns these patterns can be of shopping habit social activity criminal activity information to inform business strategies or the development of new Medical Treatments data mining is an automated process that searches for patterns in large data sets to predict events in business it is used to identify patterns to inform strategic business decisions the data can be used to predict future sales and effective and targeted marketing strategies to improve business profitability layout color paradigms and character sets content on the internet should be suitable for as many people as possible internationally the layout use of color and choice of character sets should all be carefully considered layout English language readers read from left to right so important information will often be on the top left of a web page but other cultures read from right to left color paradigms different cultures have different associations with color so in China red signifies luck while in the UK it indicates danger different different languages use different character sets to allow for any additional letters or symbols used in their alphabet so there we have it the end I've tried to go through as much as I can as fast as possible there's some topics I'd love to extend but then we'd end up with a three or 4 Hour video which probably impossible for me to get done and edited before your exam so I think this is probably going to clock in at about 2 hours I just need to go edit it and put it all together now I hope it was of some use to you in some way all the best of luck with your exams see you in the future