top of page

Search CSNewbs

286 items found for ""

  • Searching & Sorting Algorithms - OCR GCSE (J277 Spec) | CSNewbs

    1.3: Searching & Sorting Algorithms Exam Board: OCR Specification: J277 Key features of a bubble sort: Uses an outer while loop (condition controlled ) to check no swaps have been made . Uses an inner for loop (count controlled ) to repeat through the length of the data set . Uses a flag (a Boolean value ) to track if a swap has been made and uses a temporary value to help correctly swap elements . Linear Search A linear search is the most simple search algorithm. ​ Each data item is searched in order from the first value to the last as if they were all laid out in a line . The list does not have to be in any order before it is searched . This search is also known as a sequential search because the list is searched in a sequence from start to end. For large lists , this search is not very efficient . Binary Search A binary search is a much more efficient searching algorithm as it generally searches through fewer data and is often much quicker - especially for large data sets . In a binary search, the middle point of the data is selected with each iteration and compared to the value being searched for . When the midpoint matches the target value , it as been found and the search can stop. ! ! However there is a prerequisite of using a binary search - the list of data must already be sorted . A prerequisite is a condition that must be satisfied before an algorithm will work correctly . Merge Sort Merge sort is a sorting algorithm based on the idea of ‘divide and conquer ’. A merge sort divides a list into half , again and again until each data item is separate . Then the items are combined in the same way as they were divided , but now in the correct order . When the individual lists are all merged together as one list again, then the data is in order and the algorithm will end . Bubble Sort This algorithm is based on the comparison of adjacent data elements . ​ Data elements are swapped if they are not in the correct order . The algorithm will only stop when a complete iteration through the data is completed with no swaps made . ​ A bubble sort is not suitable for large sets of data . Insertion Sort The list is logically split into sorted values (on the left) and unsorted values (on the right). ​ Starting from the left, values from the unsorted part are checked and inserted at the correct position in the sorted part. ​ This continues through all elements of the list until the last item is reached, and sorted. Insertion sorts are efficient for small data sets but would be slow to sort large sets , compared to alternatives such as a merge sort. Key features of a linear search: A loop is used to check the first value in a list and increment by 1 , checking each value for a match to the target . Reaching the last element of the list without finding a match means the value is not included . Key features of a binary search: A midpoint , lowpoint and highpoint are calculated . A while loop is used to repeatedly compare the midpoint to a target value . The upper half or lower half of the data is ignored if the midpoint does not equal the target . Key features of a merge sort: This algorithm calls itself from within the subroutine (this is known as a recursive algorithm ). It continually splits sublists into a left side and a right side until each sublist has a length of 1 . Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube Key features of a insertion sort: Uses an outer for loop (count controlled ) to iterate through each value in the list . Uses an inner while loop (condition controlled ) to find the current value’s correct position in the sorted part of the list . An insertion sort moves ‘ backwards ’ to find the correct position of each value, by decreasing the index within the while loop. Q uesto's Q uestions 1.3 - Searching & Sorting Algorithms: ​ Linear Search Explain step-by-step how the number 8 would be found in the following list using a linear search : 12, 5, 3, 2, 8, 19, 14, 6 [4 ] ​ Binary Search Explain step-by-step how the number 2 would be found in the following list using a binary search : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 [6 ] ​ Merge Sort Explain step-by-step how a merge sort would sort the following list of numbers: 4, 8, 5, 1, 3, 6, 7, 2 [6 ] ​ Bubble Sort Explain step-by-step how a bubble sort would sort the following list of numbers: 3, 1, 6, 5, 2, 4 [6 ] ​ Insertion Sort Explain step-by-step how an insertion sort would sort the following list of numbers: 5, 2, 6, 3, 1, 4 [6 ] 1.2 - Designing Algorithms Theory Topics 2.1 - Programming Fundamentals

  • 4.1 - Security Threats - OCR GCSE (J277 Spec) | CSNewbs

    4.1: Security Threats Exam Board: OCR Specification: J277 Types of Malware ​Malware is any type of harmful program that seeks to damage or gain unauthorised access to your computer system. Virus A virus can replicate itself and spread from system to system by attaching itself to infected files . A virus is only activated when opened by a human . Once activated, a virus can change data or corrupt a system so that it stops working . Worm A worm can replicate itself and spread from system to system by finding weaknesses in software . A worm does not need an infected file or human interaction to spread. A worm can spread very quickly across a network once it has infiltrated it. Trojan A trojan is a harmful program that looks like legitimate software so users are tricked into installing it . A trojan secretly gives the attacker backdoor access to the system . Trojans do not self replicate or infect other files. Spyware Spyware secretly records the activities of a user on a computer. The main aim of spyware is to record usernames, passwords and credit card information . All recorded information is secretly passed back to the attacker to use. Keylogger A keylogger secretly records the key presses of a user on a computer. Data is stored or sent back to the attacker. The main aim of a keylogger is to record usernames, passwords and credit card information . Keyloggers can be downloaded or plugged into the USB port . Ransomware Ransomware locks files on a computer system using encryption so that a user can no longer access them. The attacker demands money from the victim to decrypt (unlock) the data . ? ? ? ? Attackers usually use digital currencies like bitcoin which makes it hard to trace them. SQL Injection SQL ( Structured Query Language ) is a programming language used for manipulating data in databases . ​ A SQL injection is when a malicious SQL query (command) is entered into a data input box on a website. ​ If the website is insecure then the SQL query can trick the website into giving unauthorised access to the website’s database . ​ An SQL injection can be used to view and edit the contents of a database or even gain administrator privileges . DoS Attack A DoS (Denial of Service ) attack is when a computer repeatedly sends requests to a server to overload the system . A server overload will slow the system and may take websites offline temporarily. ​ A DDoS (Distributed Denial of Service ) attack is a coordinated attack using a botnet of infected systems to overload a server with requests . A botnet is a large group of devices controlled and used maliciously by an attacker. Brute-Force Attack Every possible combination is tested in order from start to finish . This is not a quick method but it should break the password eventually and can be sped up if multiple computer systems are used at the same time. Social Engineering Social engineering means to trick others into revealing their personal data by posing as a trusted source . For example, impersonating an IT technician of a school via email and asking for a student's username and password . Data Interception This is when data packets on a network are intercepted by a third party (e.g. a hacker) and copied to a different location than the intended destination. ​ Software called packet sniffers are used to intercept and analyse data packets. 4.1 - Security Threats: 1. What is malware ? [ 2 ] 2a. Describe three characteristics of a virus . [3 ] 2b. Describe three characteristics of a worm . [3 ] 2c. What is a trojan ? [ 3 ] 2d. Describe how spyware and keyloggers work. [ 4 ] 2e. Explain how ransomware works and why it is difficult to trace attackers . [ 3 ] 2f. In your opinion, which malware do you think is the most dangerous and why ? [ 2 ] 3. Describe what an SQL injection is and how an attacker would use it. [ 3 ] ​ 4a. Describe what a DoS attack is and its impact . [2 ] 4b. Describe how a DDoS attack is different to a DoS attack . [2 ] ​ 5a. Describe a brute-force attack. [ 2 ] 5b. Describe social engineering and give an example of when it might be used . [2 ] 5c. Describe interception . [2 ] Q uesto's Q uestions 3.2b - Protocols & Layers Theory Topics 4.2 - Preventing Vulnerabilities

  • 3.2 - Testing - OCR GCSE (J277 Spec) | CSNewbs

    3.2: Testing Exam Board: OCR Specification: J277 The main purpose of testing is to ensure that a program works correctly no matter what input has been entered by the user. Other reasons to test a program include ensuring the user requirements have been met , errors have been removed and the program doesn't crash while running .​ Types of Testing Iterative Testing Iterative testing takes place during program development . ​ The programmer develops a module , tests it and repeats this process until the module works as expected . Final Testing Final testing, also known as terminal testing , takes place after development and before the program is released to the end user. ​ This testing takes place once all modules have been individually tested to ensure the whole program works as originally expected. Programming Errors Syntax Error Logical Error A syntax error is a mistake in the grammatical rules of the programming language , such as an incorrect spelling of a command word. ​ A syntax error will prevent the program from being compiled and executed . ​ Examples: Incorrect Spelling: pront ( "hello" ) Incorrect punctuation: print ( "hello" ( A logic error is a mistake made by the programmer - the program runs without crashing but will display the wrong output . ​ Examples: Incorrect calculation: total = num1 - num2 print (total) Incorrect variable printed: age = 16 name = "Steve" print ( "Nice to meet you" , age) Test Data Test data is used to test whether a program is functioning correctly . It should cover a range of possible and incorrect inputs , each designed to prove a program works or to highlight any flaws . Four types of test data are: Q uesto's Q uestions 3.2 - Testing: ​ 1. Give 3 reasons why programs are tested . [ 3 ] ​ 2. What is the difference between iterative and final testing ? [ 2 ] ​ 3a. What is a syntax error ? Give an example . [ 2 ] 3b. What is a logical error ? Give an example . [ 2 ] ​ 4. State and describe the four types of test data . [ 6 ] Normal data - Sensible data that the program should accept and be able to process . Boundary data - Data at the extreme boundary of any data ranges. ​ Invalid data - Data of the correct data type that does not meet the validation rules (e.g. outside of the range). It should not be accepted . ​ Erroneous data - Data of the wrong data type that the program cannot process and should not accept . 3.1 - Defensive Design Theory Topics 4.1 - Boolean Logic

  • 5.1 - Languages & Translators - OCR GCSE (J277 Spec) | CSNewbs

    5.1: Languages & Translators Exam Board: OCR Specification: J277 There are two types of programming languages used within computer systems: High-Level Languages Why do programmers use high-level languages? ​ H igh-level programming languages use code written in a way that is similar to a natural human language , such as English, making it easier to understand and use the language. ​ Using high-level languages leads to fewer errors and allows for more powerful and complex commands compared to low-level languages. ​ However, a high-level language must be translated into machine code (binary) before it can be run, as high-level languages cannot be executed directly by the CPU . Popular high-level languages: PYT HON C++ Ja v a Visual Basic Low-Level Languages Low-level languages do not closely resemble a natural human language , making it harder for humans to understand and write in. ​ Low-level languages are used when a program must be executed quickly or when programmers need to write code that interacts directly with the hardware , such as device drivers. ​ There are two types of low-level language : Machine Code ​ This is the pure binary code that computers can directly process and execute . ​ It is extremely tedious and difficult for humans to understand and write machine code. ​ However, machine code can be used when a programmer needs to perform a very specific command that can't be done in a high-level language. ​ Machine code will be executed faster than high-level programs because it is already in a format the CPU can execute and does not need to be translated . 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0101 0100 1010 1010 1010 1010 1111 1110 0010 1001 0100 1001 0010 0111 0111 0101 0011 1010 1000 0101 0110 0111 0000 1010 1010 0011 1101 1001 0010 1101 0010 0100 1001 0011 1010 1001 0101 0101 0010 0101 0111 0101 0101 1000 1011 0111 Assembly Language ​ Assembly language uses specialised command mnemonics to perform actions . See the Assembly Language section in the programming tab for a list of mnemonics such as INP , OUT and HLT . ​ Assembly language is preferred by many programmers over machine code because it is easier to understand and spot errors . ​ It is faster to execute than high-level languages and, like machine code, can be used to directly control the CPU . INP STA Number1 OUT HLT Number1 DAT Translators A translator changes (translates) a program written in one language into another language (usually machine code ). ​ There are two main types of translator : Interpreter An interpreter converts high-level language one line at a time into machine code and executes it. Compiler A compiler converts high-level language into machine code for execution at a later time. The entire program is converted at once . PYT HON PYT HON 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 Interpreters vs Compilers Interpreter Compiler Execution Method: An interpreter translates source code (high level code) into machine code one line at a time . ​ Execution Speed: An interpreter is slower than a compiler because the code must be reinterpreted each time the program is run. ​ Complexity: Interpreters are smaller, simpler programs . ​ Error Reporting: In error reporting, the interpreter would encounter the errors and report it to the user immediately and stops the program from running.​ ​ Repetition: Interpreted programs can be edited and run without translating the whole program . Interpreters must reinterpret the program every time it is run. Execution Method: A compiler translates all the source code (high level code) into machine code in one go . A compiler produces an executable file that will run on other machines without the compiler needing to be installed. ​ Execution Speed: Compilers can produce much more efficient code than interpreters making the compiled programs run faster . ​ Complexity: Compilers tend to be large complex programs . ​ ​ Error Reporting: The compiler would analyse the entire program , taking note of where errors have occurred and record them in an error file . ​ Repetition: Compilation requires analysis and the generation of the code only once , whereas interpreters must re-interpret each time. However, compiled programs have to be re-compiled after any changes have been made. x1 ∞ x1 Q uesto's Q uestions 5.1 - Languages & Translators: ​ 1a. Describe three reasons why programmers use high-level languages . [ 3 ] 1b. Explain one limitation of using high-level languages . [2 ] ​ 2a. Describe a key difference between low-level languages and high-level languages . [ 2 ] 2b. Describe when a low-level language would be used instead of a high-level language . [2 ] 2c. Describe an advantage and a disadvantage of writing directly in machine code . [2 ] 2d. Describe what assembly language is. Give one benefit to using assembly language instead of machine code and one benefit to using it instead of a high-level language . [3 ] ​ 3. Compare high-level and low-level languages by stating which is: a. Easier to understand [ 1 ] b. Requiring translation [ 1 ] c. Quicker to execute [ 1 ] ​ 4. Compare interpreters and compilers for each of the following features : a. Execution Method b. Execution Speed c. Complexity d. Error Reporting e. Repetition [ 10 total ] 4.1 - Boolean Logic Theory Topics 5.2 - IDE

  • 5.2 - Integrated Development Environment - OCR GCSE (J277 Spec) | CSNewbs

    Exam Board: OCR Specification: J277 5.2: Integrated Development Environment An IDE (Integrated Development Environment ) provides programmers with the following facilities (tools ) to help create programs : Editor The editor is software that allows a programmer to enter and edit source code . ​ Editor features may include: ​ Automatic formatting (e.g. automatic indentation). Automatic line numbering (this helps to identify exactly where an error has occurred). Automatic colour coding (e.g. Python IDLE turns loop commands orange and print commands purple). Statement completion (e.g. offering to auto-complete a command as the user is typing.) Error Diagnostics & Debugger Break point The programmer selects a specific line and the program displays the variable values at that point . The code can then be executed one line at a time to find exactly where the error occurs. This process is called single-stepping . Variable Watch / Watch Window cost Displays the current value of a selected variable . ​ A variable can be watched line-by-line to see how the value changes . Trace Logs the values of variables and outputs of the program a s the code is executed line by line . Both tools are used to display information about an error when it occurs, such as the line it occurred on and the error type (e.g. syntax ). These tools may also suggest solutions to help the programmer to find and fix the error . Compilers & Interpreters Both tools convert the source code written by a programmer into machine code to be executed by the CPU. A compiler converts the entire source code into executable machine code at once . After compilation, the program can be run again without having to recompile each time. ​ An interpreter converts source code into machine code line by line . An interpreter must reinterpret the code each time the program is required to run . See 5.1 for both types of translators. A runtime environment allows a program to run on a computer system. It checks for runtime errors and allows users to test the program . ​ A runtime error occurs as the program is being executed , such as dividing a number by zero . ​ A commonly used example is the Java Runtime Environment . This allows programmers to design a program on one platform ( using the programming language Java ) which allows the finished program to then be run on many others systems . ​ A runtime environment enables the tools above such as a trace and breakpoint to be used. Run Time Environment Q uesto's Q uestions 5.2 - Integrated Development Environment: ​ 1. Describe the purpose of each type of IDE tool : a. Editor b. Interpreter c. Compiler d. Error Diagnostics / Debugger e. Break point f. Variable Watch / Watch Window g. Trace h. Runtime Environment [ 2 each ] 5.1 - Languages & Translators Theory Topics

  • 5.2 - Utility Software - OCR GCSE (J277 Spec) | CSNewbs

    5.2: Utility Software What is utility software? Utility software are dedicated programs used for the maintenance and organisation of a computer system (this is known an 'housekeeping '). Utilities are required to run additional tasks not performed by the operating system . ​ ​ ​ Anti-malware (such as an anti-virus or anti-spyware ), firewall and encryption software are examples of utilities and have been explained in section 4.2 . ​ Data Compression is another utility that has been explained in section 2.5 . ​ Other utility software include backup software , disk checkers , disk formatters and auto-updaters . Exam Board: OCR Specification: J277 Defragmentation What is fragmentation and how does it happen? Over time files stored on a hard disk drive may become fragmented - this is when the file is split into parts that are saved in different storage locations . Fragmentation occurs when there is limited contiguous space in which to store a file . This may happen as data is stored and then later deleted on the hard drive . New files are created which may be bigger than the spaces left by the deleted files . The new files are then split up . Fragmentation increases access time - files that are fragmented take longer to load and read because of the distance between the fragments of the file. How does defragmentation work? Empty spaces are collected together on the hard disk drive and file fragments are moved to be stored together. ​ This means that fewer disc accesses are needed (requiring less physical movement ) as file fragments can be read consecutively . What are the effects of defragmentation? A defragmented file takes less time to read and access because the data is stored contiguously . The read/write head of the hard drive does not need to move as far to read the next piece of data because it is in the adjacent memory location , saving time . It also quicker to save new files because there is more free space together so it does not need to split the file and can store the data contiguously . Q uesto's Q uestions 5.2 - Utility Software: ​ 1. Explain what fragmentation is and how a file may become fragmented . [ 3 ] 2. Describe the process of defragmentation . [ 3 ] 3. Explain the effects of defragmenting a hard disk drive. [ 3 ] 5.1 - Operating Systems Theory Topics 6.1a - Impacts of Technology

  • 3.1 - Defensive Design - OCR GCSE (J277 Spec) | CSNewbs

    3.1: Defensive Design Exam Board: OCR Specification: J277 Defensive Design Considerations There are several things to consider when creating a program that is secure and robust , including: Anticipating Misuse Planning ahead to take steps against potential misuse (e.g the app X prevents the same tweet sent twice in a row as it might be spam ). Input Sanitisation Checking and cleaning up data that has been input , (e.g. removing special characters to prevent a SQL injection ). Validation Checking whether input data follows specific criteria and should be accepted (e.g. a length check on a password). Verification Checking whether data that has been entered is correct (e.g. double entry ). Authentication Ensuring only authorised users can gain access to a system (e.g. usernames and strong passwords ) . ​ Maintainable code Allowing other programmers to easily read and quickly understand code that has been written (e.g. using comments , indentation and appropriate variable names ). Input Validation Validation is a process to check that data is reasonable or sensible before it is accepted . Range Check Checks data is within a certain range . Age: 34 203 Type Check Checks data is a certain data type . Height (in cm): 182 Two metres Format Check Checks data is entered in a certain way . Date of Birth (DD/MM/YYYY) 25/03/2011 25th March 11 Presence Check Checks that data has actually been entered and not left blank . Password: fluffythecat123 Lookup Table A table of acceptable entries , also known as a list . Length Check Checks the length of the input is within a certain amount. Telephone Number 08323877319 07383 Maintainability Programs should be written in a way that makes maintaining and understanding them as straightforward as possible. Examples of making a program maintainable include: Using subprograms to reuse code and make them easier to test . This is called modularisation . Appropriate variable names , using a naming convention , ensure the purpose of a variable is immediately understood. Using indentation to improve readability and clearly show each ‘block’ of code. Comments enable a programmer to understand the purpose of each line of code. Crucial when working in a team . Using constants is another method of improving maintainability. This keeps the program code consistent , which makes it easier to read and debug a program. Q uesto's Q uestions 3.1 - Defensive Design: ​ 1. Describe the different considerations a programmer should make for a defensive design . [ 6 ] ​ 2. Describe the each validation check and give a suitable example . [ 12 ] ​ 3. Explain the different ways a program can be maintained . [ 5 ] 2.3 Additional Programming Theory Topics 3.2 - Testing

  • 2.3 - Additional Programming Techniques - OCR GCSE (J277 Spec) | CSNewbs

    2.3: Additional Programming Techniques Exam Board: OCR Specification: J277 Array An array is a static data structure that can hold a fixed number of data elements . Each data element must be of the same data type i.e. real, integer, string. The elements in an array are identified by a number that indicates their position in the array. This number is known as the index. The first element in an array always has an index of 0 . ​ You should know how to write pseudo code that manipulates arrays to traverse, add, remove and search data. The following steps uses Python as an example. What Traversing an Array To traverse (' move through ') an array a for loop can be used to display each data element in order. 'Inserting' a value In an array the size is fixed so you cannot insert new values, but you can change the value of elements that already exist. Overwriting the fourth element (Daphne) with a new value (Laura) will change it from Daphne to Laura. Example code for traversing: Example code for inserting: Output: Output: 'Deleting' a value In an array the size is fixed so you cannot delete values, but you can overwrite them as blank . Overwriting the second element (Shaggy) with a blank space makes it appear deleted. Example code for deleting: Output: Searching an Array For large arrays a for loop is needed to search through each element for a specific value . This example checks each name to see if it is equal to Velma. Example code for searching: Output: Two-Dimensional Array Often the data we want to process comes in the form of a table . The data in a two dimensional array must still all be of the same data type , but can have multiple rows and columns . ​ The two-dimensional array to the right shows the characters from Scooby Doo along with their associated colour and their species. ​ Each value in the array is represented by an index still, but now the index has two values . For example [3] [0] is 'Daphne'. We measure row first , then column . Searching a two-dimensional array: To print a specific data element you can just use the index number like Daphne above. To search for a specific value you will need two for loops, one for the row and another for the values of each row. The example to the right is looking for the value of 'Velma' and when it is round it prints the associated data from the whole row. Example code for printing: Output: Example code for searching: Output: Records Unlike arrays, records can store data of different data types . Each record is made up of information about one person or thing. Each piece of information in the record is called a field (each row name). ​ Records should have a key field - this is unique data that identifies each record . For example Student ID is a good key field for a record on students as no two students can have the same Student ID. SQL SQL (structured query language ) is a language that can be used to search for data in a database . The format of an SQL statement is: SELECT field1, field2, field3… FROM table WHERE criteria ​ Example of an SQL statement using the Cars table: ​ SELECT Make, Colour FROM Cars WHERE Miles > 1000 AND Age > 8 Cars table SQL uses wildcards which are symbols used to substitute characters . The * symbol represents ALL fields . ​ Example: ​ SELECT * FROM Cars WHERE Colour = “blue” Click the banner above to try a self-marking quiz (Google Form) on this topic. Q uesto's Q uestions 2.3a - Additional Programming Techniques: ​ 1. Describe the differences between a 1D array , 2D array and record . [ 3 ] ​ 2. A one-dimensional array looks like this: TigerBreeds("Sumatran","Indian","Malayan,"Amur") ​ Write the code to: a. Print the element with the index of 3. [ 2 ] b. Change Indian to South China. [ 2 ] c. Remove the Amur element. [ 2 ] d. Search through the array for 'Malayan'. [ 2 ] ​ 3a. Use the Cars table above to write the SQL statement to display the make and miles for cars that are grey OR blue . [ 3 ] 3b. Write an SQL statement to display all fields for cars that are 10 years old or less . [ 3 ] 2.2 Data Types Theory Topics 3.1 - Defensive Design

  • 4.1 - Boolean Logic - OCR GCSE (J277 Spec) | CSNewbs

    4.1: Boolean Logic Exam Board: OCR Specification: J277 What is a logical operator? Inside of each computer system are millions of transistors . These are tiny switches that can either be turned on (represented in binary by the number 1 ) or turned off (represented by 0 ). ​ Logical operators are symbols used to represent circuits of transistors within a computer. The three most common operators are: ​ NOT AND OR What is a truth table? Truth tables are used to show all possible inputs and the associated output for each input . The input and output values in a truth table must be a Boolean value - usually 0 or 1 but occasionally True or False. NOT AND OR A NOT logical operator will produce an output which is the opposite of the input . ​ NOT is also known as Negation . ​ The symbol for NOT is ¬ An AND logical operator will output 1 only if both inputs are also 1 . ​ AND is also known as Conjunction . ​ The symbol for AND is ∧ An OR logical operator will output 1 if either input is 1 . ​ OR is also known as Disjunction . ​ The symbol for OR is ∨ NOT Logic Gate AND Logic Gate Symbol OR Logic Gate Symbol Truth Table Truth Table Truth Table Multiple Operators Exam questions could ask you complete truth tables that use more than one logical operator . Work out each column in turn from left to right and look carefully at which preceding column you need to use. NOT B A AND NOT B A OR (A AND NOT B) As binary is a base-2 number system , the number of rows required in a truth table will double with each new input in the expression in order to show the unique combinations of inputs. The examples above use just two inputs (A + B) so 4 rows are required. e.g. A = 2 rows / A + B = 4 rows / A, B + C = 8 rows / A, B, C + D = 16 rows Logic Diagrams You may be asked in an exam to d raw a logic diagram when given a logical expression . ​ Draw any NOT symbols or expressions in brackets first. A logic diagram for C = ¬A ∧ B A logic diagram for D = C ∨ (A ∧ B) Q uesto's Q uestions 4.1 - Boolean Logic: ​ 1. Copy and complete the following truth tables: ​ ​ ​ 1b. Simplify the expression in the second truth table. ​ 2a. A cinema uses a computer system to monitor how many seats have been allocated for upcoming movies. If both the premium seats and the standard seats are sold out then the system will display a message. State the type of logical operator in this example. 2b. For the more popular movies, the cinema's computer system will also display a message if either the premium seats or the standard seats have exclusively been sold out. However, it will not output a message when both have been sold out. State the type of logical operator in this example. ​ 3. Draw a logic diagram for C = (¬B v A) ∧ A . 3.2 - Testing Theory Topics 5.1 - Languages & Translators

  • 3.2a - Wired & Wireless Networks - OCR GCSE (J277 Spec) | CSNewbs

    3.2a: Wired & Wireless Networks Exam Board: OCR Specification: J277 Wired Connections Wireless Connections Wireless connections, such as WiFi or Bluetooth , use no cables but require a wireless network interface card (WNIC ). Wireless connections generally have a slower speed and can be affected by the computer's distance from the wireless router as well as obstacles like walls or bad weather. Wired connections use physical cables , such as copper or fibre optic wires , and require a network interface card (NIC ) to connect to a network. These wired connections use a wired connection protocol - most commonly Ethernet . Restricted Movement Faster More Secure NIC Required Freedom of Movement Slower Less Secure WNIC Required Q uesto's Q uestions 3.2a - Wired & Wireless Networks: ​ 1. Briefly compare wired and wireless networks in terms of movement , transmission speed , security and required hardware . You could answer this in the form of a table. [ 8 ] 3.1b - Network Hardware & Internet Theory Topics 3.2b - Protocols & Layers

  • 2.4a - Number Storage - OCR GCSE (J277 Spec) | CSNewbs

    2.4a: Number Storage Exam Board: OCR Specification: J277 What is binary? By now you should know that computer systems process data and communicate entirely in binary . ​ Topic 2.3 explained different binary storage units such as bits (a single 0 or 1), nibbles (4 bits) and bytes (8 bits). ​ Binary is a base 2 number system. This means that it only has 2 possible values - 0 or 1 . What is denary? Denary (also known as decimal ) is the number system that you've been using since primary school. ​ Denary is a base 10 number system. This means that it has 10 possible values - 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 . How to convert from binary to denary: How to convert from denary to binary: Binary & Denary What is hexadecimal? Hexadecimal is a base 16 number system. This means that it has 16 possible values - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F . ​ Hexadecimal is used as a shorthand for binary because it uses fewer characters to write the same value . This makes hexadecimal less prone to errors when reading or writing it , compared to binary. For example, 100111101011 in binary is 9EB in hexadecimal. ​ Hexadecimal only uses single-character values. Double-digit numbers are converted into letters - use the table on the right to help you understand. How to convert from binary to hexadecimal: How to convert from hexadecimal to binary: Hexadecimal Converting from denary to hexadecimal / hexadecimal to denary To convert from denary to hexadecimal or the other way round you must convert to binary first . ​ Denary > Binary > Hexadecimal ​ Hexadecimal > Binary > Denary ​ Use the videos on this page if you need help converting to or from binary. ​ The most common number systems question in exams are from denary to hexadecimal or from hexadecimal to denary so make sure that you practice these conversions. Binary Addition Binary addition is a method of adding binary values without having to convert them into denary. How to add binary numbers: What is an overflow error? An overflow error occurs when a binary value is too large to be stored in the bits available . ​ With a byte (8 bits ) the largest number that can be held is 255 . Therefore any sum of two binary numbers that is greater than 255 will result in an overflow error as it is too large to be held in 8 bits . What is binary shift? Binary shift is used to multiply and divide binary numbers . The effect of shifting left is to multiply a binary number. The effect is doubled by each place that is shifted . x The effect of shifting right is to divide a binary number. ÷ Shifting by 1 has an effect of 2 . ​ Shifting by 2 has an effect of 4 . ​ Shifting by 3 has an effect of 8 . For example, shifting left by 2 places has an effect of multiplying by 4 . Another example: Shifting right by 3 places has an effect of diving by 8 . How to shift a binary number: Q uesto's Q uestions 2.4a - Number Systems: ​ 1. Explain why hexadecimal numbers are used as an alternative to binary . Use an example . [ 3 ] ​ 2. Convert the following values from binary to denary : a. 00101010 b. 11011011 c. 01011101 d. 11101110 e. 01011111 [1 each ] ​ 3. Convert the following values from denary to binary : a. 35 b. 79 c. 101 d. 203 e. 250 [1 each ] ​ 4. Convert the following values from binary to hexadecimal : a. 11110101 b. 01100111 c. 10111010 d. 10010000 e. 11101001 [1 each ] ​ 5. Convert the following values from hexadecimal to binary : a. C2 b. 8A c. DE d. 54 e. F7 [1 each ] ​ 6. Convert the following values from denary to hexadecimal : a. 134 b. 201 c. 57 d. 224 e. 101 [1 each ] ​ 7. Convert the following values from hexadecimal to denary : a. 32 b. A5 c. 88 d. C0 e. BE [1 each ] Binary Addition: ​ 1. Explain what an overflow error is. [ 2 ] ​ 2. Add together the following binary values. If an overflow error occurs you must state one has occurred. a. 010110012 and 010001012 [2 ] b. 110110112 and 010111012 [2 ] c. 001101102 and 011010112 [2 ] d. 110110112 and 010101112 [2 ] e. 011011012 and 110101102 [2 ] ​ ​ Binary Shift: ​ 1a. Draw a diagram to show the effect of multiplying and dividing a binary number . [2 ] 1b. Draw a diagram or table to show the effect a shift has for each place from 1 to 4 . For example, a shift of 1 place has an effect of 2. [4 ] ​ 2. State the effect of the following shifts: a. Shift right by 2 places. b. Shift left by 1 place. c. Shift left 3 places. d. Shift right by 4 places. [ 1 each ] ​ 3. Shift the following binary numbers and state the effect of the shift: a. 10101011 : Shift left by 2 places. b. 11101100 : Shift right by 3 place. c. 00001011 : Shift right by 2 places. d. 01101110 : Shift left by 1 place. [ 2 each ] Binary Shifts Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube Click the banners below to try self-marking quizzes (Google Form) on these topics. Binary to Denary: Binary to Hexadecimal: Denary to Binary: Hexadecimal to Binary: 2.3 - Data Units Theory Topics 2.4b - Character Storage

  • 2.5 - Compression - OCR GCSE (J277 Spec) | CSNewbs

    2.5: Compression Exam Board: OCR Specification: J277 What is compression? To compress a file means to make its size smaller . Benefits of compression include: ​ Files take up less storage space (so more files can be stored). Files can be transferred quicker (because they are smaller). Files can be read from or written to quicker . ​ There are two methods that are used to compress files: Lossy and Lossless . Lossy Compression Lossy compression uses an algorithm (set of instructions) to analyse a file and remove data that cannot be heard or seen by humans . For example, a lossy algorithm would analyse the sound waves of an audio file and remove any frequencies which humans cannot hear. This process reduces the size of the file . ​ Further lossy compression will remove data that humans can see / hear . For example, the dog image to the right has been strongly compressed using a lossy algorithm and some data has clearly been removed. Lossy compression removes the data permanently , so the file can never return to its original form . ​ Lossy compression is often used with images , audio and video to reduce the file size, for example to send over the internet. Lossless Compression Lossless compression reduces the size of a file without permanently removing any data . Because of this, the file is returned to its original form when decompressed, so no quality is lost . ​ A file that is compressed with a lossless algorithm is usually larger than a file compressed with a lossy algorithm because no data has been permanently removed. Lossless compression is used with files that would not work if data was removed, for example executable files (e.g. programs and games) or word documents . Remember that lossy and lossless compression do not just refer to images. Below is an audio file that has been compressed with lossy compression . Data has been removed so the audio quality has decreased. 197 KB 81 KB 43 KB Q uesto's Q uestions 2.5 - Compression: 1. Describe 3 benefits of compressing a file . [ 3 ] 2. Describe the differences between lossy and lossless compression . [4 ] ​ 3. A student needs to compress a Microsoft Word document to send in an email. Suggest which type of compression they should use and why . [ 2 ] 2.4d Sound Storage Theory Topics 3.1a - Network Types & Performance

bottom of page