top of page

Search CSNewbs

289 results found with an empty search

  • App Inventor 2 | The Basics | CSNewbs

    Learn how to use App Inventor 2 to create simple programs. Perfect for key Stage 3 students to experiment with block coding and objects What is App Inventor? App Inventor 2 Link App Inventor 2 is software developed by Massachusetts Institute of Technology (MIT ), a research university in America. It allows users to create simple apps and learn about the way that they work in a fun manner. There is no need to learn how to program with text editors as everything is based around blocks, a bit like Scratch. To open App Inventor 2 (the current version of the program) click the button in the top right. You will need to log in with a Google account. There are two layouts to App Inventor, Designer and Blocks . You can switch between them with the bottoms in the top right corner. This guide will show you how to make seven simple programs and introduce you to programming concepts such as variables and properties . Download all App Inventor images you will need for the 7 tasks by clicking the camera icon. Note to Computer Science Teachers - The easiest way to test programs made using App Inventor 2 is using the emulator which should be pre-installed by the IT technician team at your school. See here for information on how to set it up. Also, Google accounts are required to access and use App Inventor 2. Viewer - This is a mock-up of what your app will look like. Components - Each component can be renamed or deleted here. Designer Layout Palette - Drag the component that you want to use in your app, into the centre. Properties - Edit the settings for each component. Media - Upload images and sound here before they can be used in your app. Blocks Layout Viewer - This is space for you to drag blocks to make things happen. Blocks - Drag the code block that you want to use into the centre. The blocks connect together like in Scratch. Warnings - Any errors with your code will be displayed here. Backpack - Drag code into to backpack to store it for later. KS3 Home Tasks 1 & 2

  • Python | 5e - More Libraries | CSNewbs

    Learn how to use the math library and to refresh the screen (on some editors only). Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 5e - More Libraries Clear Screen Importing the os library and using the .system() command with the "clear" parameter will clear the screen . The console won't clear on offline editors like IDLE but will work with many online editors like Replit. import os print ( "Hello" ) os. system ( "clear" ) print ( "Bye" ) Bye Clear Screen Task ( Trivia Questions ) Ask three trivia questions of your choice to the user and clear the screen between each one. You should display the total they got correct after the third question - to do this you need to set a variable called correct to equal 0 at the start and then add 1 to correct each time a correct answer is given . Example solution: The Math Library The math libraries contains several commands used for numbers: sqrt to find the square root of a number. ceil to round a decimal up to the nearest whole number and floor to round down to the nearest whole number. pi to generate the value of pi (π ). The sqrt command will find the square root of a number or variable placed in the brackets and return it as a decimal number . from math import sqrt answer = sqrt(64) print (answer) 8.0 The ceil command rounds a decimal up to the nearest integer and the floor command rounds a decimal down to the nearest integer . from math import ceil, floor answer = 65 / 8 print ( "True answer:" , answer) print ( "Rounded up:" , ceil(answer)) print ( "Rounded down:" , floor(answer)) True answer: 8.125 Rounded up: 9 Rounded down: 8 The pi command generates a pi value accurate to 15 decimal places . Pi is used for many mathematical calculations involving circles . The area of a circle is pi x radius² . The first example below uses 5.6 as the radius . from math import pi radius = 5.6 area = pi * (radius * radius) print ( "The area of the circle is" , area) The area of the circle is 98.5203456165759 The example below uses an input to allow the user to enter a decimal (float ) number for the radius. It also uses the ceil command to round the area up . from math import pi, ceil radius = float(input( " Enter the radius: " )) area = pi * (radius * radius) print ( "The area of the circle is" , ceil(area)) Enter the radius: 2.3 The area is 17 Clear Screen Task ( Area of a Sph ere ) The formula of a sphere is 4 x π x r² where π represents pi and r is the radius . Use an input line to enter the radius and then calculate the area of the sphere . Round the answer down to the nearest integer using floor and print it. Example solution: Enter the radius: 7.1 The area of the sphere is 633 ⬅ 5d - Coloram a Section 5 Practice Tasks ➡

  • 4.3 - Binary Calculations - Eduqas GCSE (2020 Spec) | CSNewbs

    Learn about how to perform binary addition and binary subtraction. Based on the 2020 Eduqas (WJEC) GCSE specification. 4.3: Binary Calculations Exam Board: Eduqas / WJEC Specification: 2020 + What are binary calculations? Binary addition and binary subtraction are methods of adding or subtracting binary values without having to convert them into denary. How to add binary numbers: How to subtract binary numbers: Overflow & Underflow Errors Overflow and underflow errors occur when there is not enough space to accurately represent a binary number in the bits available . What is an overflow error? An overflow error occurs when a binary value is too large to be stored in the bits available . In technical terms, an overflow error occurs if a carry (remainder) is present on the most significant bit (MSB ). The CPU then sets the overflow flag to true . The most significant bit (MSB ) is the largest bit (always the one furthest to the left ) of a binary value (e.g. 128 for an 8 bit value). A flag is an alert signal . It is either on or off. The overflow flag is turned on by the CPU when an overflow occurs. What is an underflow error? An underflow error occurs when a number is too small to be stored in the bits available . The value is too close to 0 to be accurately represented in binary. Q uesto's Q uestions 4.3 - Binary Calculations: 1a. Describe the terms ' most significant bit ' and ' flag '. [ 2 ] 1b. Using the terms from 1a , explain what an overflow error is. [ 2 ] 1c. Describe what is meant by an underflow error . [ 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 ] 3. Subtract the following binary values; put the first value on top of the second value: a. 100110102 and 000110002 [2 ] b. 110110112 and 010111012 [2 ] c. 011101102 and 011010112 [2 ] d. 110110112 and 010101112 [2 ] e. 111011012 and 110101102 [2 ] Watch on YouTube Watch on YouTube 4.2 Signed Binary Theory Topics 4.4 - Arithmetic Shift

  • 2.1 - Information Styles | Unit 2 | OCR Cambridge Technicals | CSNewbs

    Learn about the wide range of style data and information can be presented in, both digitally and physically. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification for Unit 2 (Global Information). 2.1 - Information Styles Exam Board: OCR Specification: 2016 - Unit 2 There are many different ways that information can be styled and presented , both on-screen and physically . There are many more benefits and limitations to using each information style but some key ideas have been described below. T Text Text is a written (or typed ) format of information. ✓ Text provides detailed summaries and explanations . ✓ The format of text can be changed to suit its purpose (e.g. include bullet points or different colours). ✓ Text can be written in different languages so that all literate people can understand. X Large amounts of text can be difficult and time-consuming to read. It is generally less engaging than most other methods. X Text may include spelling errors or be factually incorrect . Graphics Graphics are a visual form of information. Examples include logos , photographs and diagrams . ✓ Graphics are multilingual - they can be understood by anybody regardless of their spoken language. Companies like IKEA will use the same graphics globall y . ✓ Graphics can present an idea or message immediately and can use associations (e.g. the colour red is associated with temperature or anger). ✓ Graphics are a more engaging method of presenting information than text. X Images may take longer to load over a data-restricted network, for example, images in an email may not be automatically downloaded. Video Videos are visual formats of information, often with audio . ✓ More engaging and easier to follow than reading large amounts of text. ✓ Videos can be used to convey a message in a short space of time , e.g. television adverts. ✓ Audio can be added to videos such as music for engagement or narration to explain a process. X Videos usually take up a relatively large amount of storage space , longer videos may take time to upload / download / transfer along a network. X Videos take a long time to create including filming, editing and narration. Animated Graphics Animated graphics are images with multiple frames , such as an animation of the heart showing individual steps that a user can pause and step through in their own time. ✓ Can be used to show a process and is easier to understand than reading text. ✓ Can be understood by all ages and language speakers . X Creating an animated graphic takes time to create , especially educational resources with multiple frames and annotation. 9 Numerical Numerical information is represented by numbers . This can include a wide array of different information including statistics, financial data, dates, ages and distances . ✓ Statistical data is easier to understand and manage in a numerical format than standard text - 234,567 is simpler to work with than "two hundred and thirty-four thousand, five hundred and sixty-seven". ✓ Numerical data can be exported into spreadsheets and presented as graphs to visualise the dat a . X Long numbers can be entered by humans incorrectly and lead to incorrect results . X Formatted data like telephone numbers cannot be stored as numerical because numerical does not allow spaces and does not allow the number to start with 0 . Audio Audio is an information type using sound waves. A common form of audio is music , such as the millions of tracks stored in music libraries like Spotify and YouTube. Non-music examples include spoken instructions and podcasts . ✓ Users can listen to information when they are otherwise busy and could not read, such as when walking or driving. ✓ Visually impaired users who are unable to read can still hear audio and interact with voice recognition software . ✓ Some users prefer listening to instructions rather than reading text . X Audio may not be suitable in some environments e.g. noisy areas . X Words may be misheard and misunderstandings made, possibly due to pronunciations or accents. Tactile Images Tactile images are a form of physical information that can be interpreted by touch . Specialist software is used to create raised lines on paper that people can experience by touching . Geographers can create 3D physical objects of environments such as valleys or volcanoes. This allows researchers and land surveyors to have a better understanding of a geographic area. ✓ Users can better understand a physical environment or prospective design if it is physically built. ✓ Visually-impaired users can feel the object instead of being able to see it. ✓ The tactile image can be used as a prototype for a target audience to feel and comment on. X It is difficult to share a tactile image without physically moving it, unlike digital or paper information styles. X Creating a tactile image requires specialist equipment like a 3D printer. *screams* Subtitles Subtitles are a textual form of information that can be shown along with visual data such as a video. Subtitles are written to transcribe audio , such as speech, into words . ✓ Hearing-impaired users can access audio information formats such as video by reading the subtitles. ✓ Subtitles can be used in noisy environments or when sound cannot be played. ✓ Subtitles can be used for translated speech , such as in promotional videos or television programmes. X Auto-generated subtitles are often incorrect . X Subtitles written by a human take a long time to type up and sync in time with the audio. Tables & Spreadsheets Tables and spreadsheets can store both numerical and textual data ready for analysis . Examples include simple database tables and financial spreadsheets of a company's profits this year. Microsoft Access is an example of database software that uses tables and Microsoft Excel is an example of spreadsheet software. When using spreadsheets (or databases) records can be locked ('record locking' ) so that only one person can make edits at any one time . Edits will be saved before unlocking the file. This will stop data being incorrectly overwritten and will ensure that the data in the spreadsheet is up-to-date , accurate and fit for purpose . Spreadsheets can be linked to other documents such as forms to directly import data from. This data can be ordered into different groups and conditional formatting can be used to automatically organise and style the data. Graphs and charts can be created using values stored in a spreadsheet to easily visualise the data . Modelling can be used to see the effect of variable changes (e.g. will raising the price of one product affect overall profit?). Database tables use queries (advanced searches) to find and display data based on given criteria (such as all males under 35). Mail merge can be used to automatically send emails to the customers highlighted in the query . A report can be generated from the query results to display the information in a structured format . This can be used to make decisions and analyse data . Boolean Boolean is a data type that can only have one of two specified values . These values are most commonly 'True' and 'False' or sometimes 'yes' and 'no'. Braille Braille is an example of a tactile image that can be physically touched . Braille characters represent letters or numbers that can be 'read' by touch - used primarily by those with visual impairments . Devices like braille terminals convert characters on a screen into braille, line-by-line so that blind people can understand the information through touch . A braille printer is used to output braille dots onto paper. ✓ Allows visually impaired users to interact with a computer system using a braille terminal . ✓ A braille printer can print documents written using braille to be given to blind people to 'read'. X Braille terminals can only display a limited amount of information at a time. X Braille is not used by many people except visually impaired people so few resources are written using braille. Charts & Graphs Charts and graphs can be used to present numerical data in a format that is easier to visualise and understand . They can be labelled to show different data values and they make it easier for viewers to identify trends and make comparisons between data. Large quantities of data, like census results, are easier to visualise in a graph than reading huge tables of numbers. ✓ Charts present numerical data in a format that is easier to visualise and understand . ✓ Charts and graphs can summarise information into one image data that would take paragraphs to explain in text. ✓ Displaying information in a graph allows users to easily identify trends and make comparisons between data . X Charts can be misleading or can display incorrect information if the numerical data is wrong. Q uesto's Q uestions 2.1 - Information Styles: 1. Describe the following information styles : a. Tactile Images [2 ] b. Braille [2 ] c. Boolean [2 ] 2. Describe two advantages and two disadvantages for each of the following information styles : a. Text [8 ] b. Graphics [8 ] c. Video [8 ] d. Animated Graphics [8 ] e. Numerical [8 ] f. Audio [8 ] g. Tactile Images [8 ] h. Subtitles [8 ] i. Braille [8 ] j. Charts & Graphs [8 ] 3a. Spreadsheets and database tables can be record locked . Explain what record locking is and why it is used . [4 ] 3b. Describe different ways that spreadsheets can be used. [6 ] 3c. Describe different ways that databases can be used. [6 ] 1.7 & 1.8 - Internet Pros & Cons 2.2 - Information Classification Topic List

  • Python | 7a - Procedures | CSNewbs

    Learn how to create and use procedures in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 7a - Procedures Subroutines A subroutine is a section of code that can be re-used several times in the same program. It is separate from the main code and has to be ‘called’ upon. Subroutines are designed to be repeated, and they have three key benefits: Subroutines make programs easier to read . They reduce the duplication of code . Complex problems are broken down into smaller chunks . There are two types of subroutines: procedures and functions . A procedure just executes commands , such as printing something a certain number of times. A function produces information by receiving data from the main program and returning a value to the main program. For example, a function could take the radius of a sphere from the main program, calculate a sphere’s area and return the value of the area to the main program. A function generally requires parameters to work – these are the values to be transferred from the main program to the subroutine. Procedures A procedure i s a type of subroutine that runs independently of the main program . A subroutine must be defined at the top of the program before the main code by typing def and the name of the subroutine . In the example below I have created a procedure to calculate the multiplication of two numbers and a separate procedure for the division. The main program starts beneath the subroutines , against the left side of the editor. I have created a while true loop that asks the user if they want to multiply, divide or stop the program. If they choose to multiply, the multiply subroutine is called . This initiates that subroutine then returns to the main program when it is complete. If they choose to divide, the divide subroutine is called instead. Typing stop will break (end) the loop. Here you can see the two parts of the program put together. Subroutines must be written first , with the rest of the program underneath. Subroutines can be called in any order . Below I have run the program and divided then multiplied before breaking the loop: Practice Tasks 1 1. Create a procedure called hello that just prints “Hello there! ”. In the main program create a for loop that calls the procedure 10 times. You must use a procedure. 2. Create a program with two procedures. The addition procedure allows the user to add two numbers together. The subtraction procedure allows the user to take a number away from another. Use a while true loop in the main program and a break to stop the loop. Example solution for #1: Local & Global Variables Programming languages use local variables and global variables . A global variable can be used anywhere in the program . A local variable can only be used in the subroutine it is created in . I have adapted the multiply / divide program below to use global variables by stating the global command and the name of the variables in each subroutine. This allows me to ask the user to enter numbers in the main program. Practice Tasks 2 1. Adapt your addition / subtraction program from the first practice task section to use global variables. 2. Create a program that asks the user to enter their name in the main program. Call a subroutine that greets the user using the name variables. You must use a procedure and a global variable . Example solution for #2: ⬅ Section 6 Practice Tasks 7b - Functions ➡

  • 1.2 - Designing Algorithms - OCR GCSE (J277 Spec) | CSNewbs

    Learn about designing algorithms including constructing pseudocode and flowcharts. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). Exam Board: OCR 1.2: Designing Algorithms Specification: J277 Watch on YouTube : Inputs, Processes & Outputs Structure Diagrams Pseudocode Flowcharts Writing Code in Exams Trace Tables What is an algorithm? An algorithm is a set of instructions , presented in a logical sequence . In an exam you may be asked to read and understand an algorithm that has been written. To prove your understanding you may be asked to respond by actions such as listing the outputs of the algorithm, correcting errors or identifying an error within it. Programmers create algorithm designs as a method of planning a program before writing any code. This helps them to consider the potential problems of the program and makes it easier to start creating source code. There are two main methods of defining algorithms are pseudocode and flowcharts . In exams , OCR will display algorithms in their own 'OCR Exam Reference Language '. Visit the Python section of CSNewbs ---> OCR Exam Reference Language T he OCR exams require specific questions to be written either in OCR Exam Reference Language (shown below) or a high-level programming language such as Python . Basic Commands Annotation // Comments are written using two slashes Assignment name = "Harold" age = 49 Constants and Global Variables constant tax = 15 global name = "Admin" Input / Output name = input ( "Enter your name") print ("Transaction Complete") Casting str (29) int ("102") float (30) bool ("False") Random Number number = random (1,100) Selection Selection (if - then - else) if firstname == "Steven" then print("Hello" + firstname) elif firstname == "Steve" then print("Please use full name") else print("Who are you?") end if Selection (case select) switch day: case “Sat”: print(“It is Saturday”) case “Sun”: print(“It is Sunday”) default : print(“It is a Weekday”) endswitch Iteration Iteration (for loop) for i = 1 to 10 step 1 input item next i Iteration (while loop) while firstname ! = "Steven" firstname = input("Try again:") endwhile Iteration (do while loop) do firstname = input("Guess name:") until firstname == "Steven" String Handling Length of a String word = "dictionary" print(word.length ) outputs 10 Substrings word = "dinosaurs" print(word.substring (2,3)) outputs nos print(word.left (3)) outputs din print(word.right (4)) outputs aurs Concatenation name = "Penelope" surname = "Sunflower" print(name + surname) String Cases phrase = "The Cat Sat On The Mat" print(phrase .lower ) print(phrase .upper ) ASCII Conversion ASC ("C") returns 67 CHR (100) r eturns "d" File Handling File Handling - Reading Lines file1 = open ("Customers.txt") while NOT file1.endOfFile() print(file1.readLine() ) endwhile file1.close() File Handling - Writing to a (New) File newFile ("paint.txt") file2 = open ("paint.txt") paint = input("Enter a paint colour:") file.writeLine (paint) file2.close() Arrays Declare Array array names[3] array names = "Ella", "Sam", "Ali" Declare 2D Array array grid[4,5] Assign Values names[2] = "Samantha" grid[1,3] = "X" More Programming Keywords Connecting strings together using the + symbol is called concatenation . Extracting certain parts of a string (e.g. using .substring() ) is called slicing . An if statement within an if statement or a loop within a loop is called nesting . Flowcharts A flowchart can be used to visually represent an algorithm. It is more likely you will need to be able to interpret a flowchart rather than draw one. The flowchart symbols are: The terminator symbol is also known as a terminal . Algorithm Examples Below are two different methods for representing the same algorithm - a program to encourage people to buy items cheaply at a supermarket. The program allows the price of items in a supermarket to be entered until the total reaches 100. The total price and the number of items entered are tracked as the program loops. Once the total reaches 100 or more, an if statement checks how many items have been entered and a different message is printed if there are 20 or more items, 30 or more items or less than 20 items. Pseudocode // This is a program to see how many items you can buy in a supermarket before you spend over £100} total = 0 itemsentered = 0 while total < 100 itemprice = input ("enter the price of the next item") total = total + itemprice itemsentered = itemsentered + 1 endwhile if itemsentered >= 20 then print ("You are on your way to saving money.") elif itemsentered => 30 then print ("You're a real money saver.") else print ("Look for better deals next time.") endif Flowchart Reading Algorithms In an exam you may be asked to read an algorithm and prove your understanding , most commonly by listing the outputs . Start from the first line and follow the program line by line , recording the value of variables as you go . When you encounter a for loop , repeat the indented code as many times as stated in the range . Example Algorithm: procedure NewProgram() maxvalue = input() for i = 1 to maxvalue output (i * i) ??????? print("program finished") endprocedure Example Questions: 1. List the outputs produced by the algorithm if the 'maxvalue' input is 5 . 2. State the code that has been replaced by '???????' and what the code's purpose is. Example Answers: 1. Outputs: 1 4 9 16 25 program finished 2. Missing Code: next i Purpose: Moves the loop to the next iteration. Watch on YouTube Structure Diagrams Structure diagrams display the organisation (structure ) of a problem in a visual format , showing the subsections to a problem and how they link to other subsections . The noughts and crosses structure diagram below has subsections in light yellow. Each subsection could be coded by a different person . Structure diagrams are different to flowcharts (those show how data is input, processed and output within a program or system). You may be asked in an exam to draw or fill in a simple structure diagram . Trace Tables Trace tables are used to track the value of variables as a program is run . They can be used to manually track the values in order to investigate why the program isn't working as intended . Each row in the trace table represents another iteration . Each column stores the value of a variable as it changes. See below how the trace table is updated for the simple algorithm on the left. num1 = 2 num2 = 5 for i = 1 to 3 output (num1 + num2) num2 = num2 - 1 next i print("complete") For most algorithms, not every variable will be updated in each iteration . Values may not be entered in the order of the trace table either. For example, each iteration outputs num1 + num2 and then decreases the value of num2 by 1. Q uesto's Q uestions 1.2 - Designing Algorithms: 1. What is the definition of an algorithm ? Name two ways an algorithm can be designed . [ 3 ] 2. Using a high-level programming language such as Python , or the OCR Exam Reference Language , write an algorithm that inputs 6 decimal numbers and outputs the total , largest , smallest and average values. [ 8 ] For example, entering 3.1 , 5.3 , 2.3 , 5.4 , 2.9 and 4.4 would output 23.3 (total), 5.4 (largest), 2.3 (smallest) and 3.9 (average). 3. Draw and label the flowchart symbols . [ 6 ] 4. What is the purpose of a structure diagram ? [ 2 ] 5. Create a trace table for the NewProgram() algorithm in the Reading Algorithms section on this page. [ 7 ] 1.1 - Computational Thinking Theory Topics 1.3 - Searching & Sorting

  • HTML Guide 7 - Head Tags | CSNewbs

    Learn about the tags in the head section of an HTML document including the title and meta tags. 7. Head Tags HTML Guide Watch on YouTube: Remember that all HMTL documents are split into the head and the body. The following tags must be typed inside of your head tags . title Title The title is not the main heading. The title is the page title itself that you can see at the tab at the top of your web browser. Add a title to your web page. metadata Metadata Metadata is information about the web page itself. This commonly includes data about the author, the page's contents and any keywords. Metadata will not appear on the actual web page . Add meta data tags between your head tags for author, keywords and a description. The meta tag is made up of a name and content . Author represents who created the web page. Keywords are commonly used words. Description is used for displaying search engine results (such as a Google search). Next it is time to embed YouTube videos into your web page. 6. Organisation Tags HTML Guide 8. Videos

  • 4.7 - Sound Representation - Eduqas GCSE (2020 Spec) | CSNewbs

    Learn about how sounds are represented in a computer system including how analogue sound waves are converted into binary. Also, learn about sample rate, bit depth and metadata. Based on the 2020 Eduqas (WJEC) GCSE specification. 4.7: Sound Representation Exam Board: Eduqas / WJEC Specification: 2020 + Converting Analog Sound to Binary To store sound on a computer analog sound waves must be converted in to digital data ( binary ). The sound is sampled using an ADC (Analog to Digital Convertor) and stored as a binary value (such as 01010011) called a sample . 0010 1011 0101 0101 Analog sound wave ADC (Analog to Digital Converter) Binary sample Sampling an Analog Sound Wave Digital sampling is discrete (separate) and not continuous like analog waves. To get the highest quality sound, many samples are taken to recreate the analog wave as closely as possible . Sample Rate The sample rate is the number of samples taken per second . It is measured in kilohertz (kHz), for example CD quality is 44.1kHz (44,100 samples per second). The higher the sample rate , the better the audio quality as the digital data more closely resembles an analog wave . However, higher sample rates result in larger file sizes because more data is stored for each individual sample. A low sample rate will result in a low-quality sound because the digital data does not closely resemble the original analog wave . A higher sample rate will result in a higher-quality sound because the digital data more closely resembles the original analog wave . Improving Audio Quality Bit Depth Bit Rate The bit rate is defined as the amount of audio data processed per second . It is measured in kilobytes per second (kbps ). The bit rate is calculated by multiplying the sample rate and bit depth . Because the bit rate is the measure of the sample rate and bit depth multiplied together, the higher the bit rate the higher the quality of the sound . The bit depth is the number of bits available to represent each sample . For example, a sample with a bit depth of 4 could be 0101 or 0111 or 1010. A sample with a bit depth of 8 could be 01010110 or 1010110 or 11001111. A common bit depth is 16 bits . The higher the bit depth , the more bits are available to be used for each sample. Therefore the quality is often higher as the wave more closely resembles an analog wave . The file size will also be larger if the bit depth is higher, as each sample stores additional bits . Example: A short audio sample has a bit depth of 4 and a sample rate of 10 samples per second . The clip is 15 seconds long . Calculate the bit rate by multiplying the sample rate and bit depth : 4 bits x 10 = 40 bits . Now that is the correct data for one second. Multiply the bit rate by the number of seconds in the file: 40 x 15 = 600 bits . To convert the answer from bits to bytes , divide by 8 . 600 bits ÷ 8 = 75 bytes . Calculating File Size Metadata for Sound Files Music libraries such as Apple Music or Spotify store a huge amount of metadata on each song. Metadata is additional data about a file such as: Artist Title / Track Title Product / Album Title Track Number Date Created / Year Genre Comments Copyright Software Type Duration File size Bit rate Sampling rate Channels Volume Q uesto's Q uestions 4.7 - Sound Representation: 1. Explain how an analog sound wave is converted into a binary sample . [ 2 ] 2a. What is a sample rate ? [1 ] 2b. Explain two ways an audio file will be affected if the sample rate is increased . [4 ] 3a. What is bit depth ? [2 ] 3b. Explain two ways an audio file will be affected if the bit depth is increased . [4 ] 3c. Explain what the bit rate is. [ 2 ] 4 . An audio sample has a bit depth of 8 , a sample rate of 10 and it is 12 seconds long . What is the file size in bytes ? [ 2 ] 5a. What is metadata ? [ 2 ] 5b. State four different types of metadata for audio files . [4 ] low bit rate = lower quality high bit rate = higher quality Converting Analog Sound to Binary 1 4.6 Graphical Representation Theory Topics 4.8 - Compression

  • 2.1 - Programming Fundamentals - OCR GCSE (J277 Spec) | CSNewbs

    Learn about the fundamentals of programming - selection, sequence and iteration. Also find out the difference between local and global variables and constants. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). Exam Board: OCR Specification: J277 2.1: Programming Fundamentals Watch on YouTube : Programming Fundamentals Sequence Selection Iteration Operators This section of the specification includes programming topics that are outlined in 1.2 (Designing Algorithms). You must have an understanding of a range of programming techniques , such as how to use selection , loops and operators . The best practice for learning is to try the tasks in the Python pages on this website (see the link to the right). Visit the Python section of CSNewbs ---> Programming Constructs There are three constructs ( ideas of programming ) that are used to control the flow of a program : Sequence Structuring code into a logical, sequential order . Selection Decision making using if statements . Iteration Repeating code using for or while loops . Variables Variables are used to store data in programs. They can be changed as the program runs . A variable has two parts - the data value such as "Emily" and an identifier such as First_Name . An efficient program will use variables with sensible identifiers that immediately state their purpose in the program. Using variable names like 'TotalNum' and 'Profit' rather than 'num1' and 'num2' mean that other programmers will be able to work out the purpose of the code without the need for extensive comments. Local & Global Variables Large programs are often modular - split into subroutines with each subroutine having a dedicated purpose. Local variables are declared within a specific subroutine and can only be used within that subroutine . Global variables can be used at any point within the whole program . Local variable advantages Saves memory - only uses memory when that local variable is needed - global variables use memory whether they are used or not. Easier to debug local variables as they can only be changed within one subroutine. You can reuse subroutines with local variables in other programs. Global variable advantages Variables can be used anywhere in the whole program (and in multiple subroutines). Makes maintenance easier as they are only declared once. Can be used for constants - values that remain the same. Constants π As specified before, a variable is data that can change in value as a program is being run. A constant is data that does not change in value as the program is run - it is fixed and remains the same. An example of a constant in maths programs is pi - it will constantly remain at 3.14159 and never change. Operators Comparison Operators Comparison operators are used to compare two data values . A table of common comparison operators used in programs are below: Arithmetic Operators Arithmetic operators are used to mathematically manipulate values . The most common arithmetic operators are add (+ ), subtract (- ), multiply (* ) and divide (/ ). Further arithmetic operators are shown below: Modulo division (also known as modulus ) reveals the remainder from the last whole number . For example: 9 % 4 = 1 (4 goes into 9 twice (8) with a remainder of 1) Integer division (also known as quotient ) reveals the ‘whole number of times ’ a number can be divided into another number : 9 // 4 = 2 (4 goes into 9 fully, twice) The symbol ^ represents exponentiation . However, Python uses ** to represent exponentiation. For example '2^3 = 8' is equivalent to '2³ = 8'. Logical Operators Logical operators typically use TRUE and FALSE values which is known as Boolean . You can find more information about Boolean values in section 4.1 . Q uesto's Q uestions 2.1 - Programming Fundamentals: Programming Constructs 1. Describe and draw a diagram for the 3 programming constructs . [6 ] Variables 1. What is the difference between local and global variables ? [4 ] 2. Describe two advantages of using local variables . [2 ] 3. Describe two advantages of using global variables . [2 ] 4. What is a constant ? Give an example . [2 ] 1.3 - Searching & Sorting Theory Topics 2.2 - Data Types

  • 2.3 - Units - OCR GCSE (J277 Spec) | CSNewbs

    Learn about different data units of storage from bit up to petabyte, as well as data capacity calculations. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 2.3: Data Units Exam Board: OCR Specification: J277 Watch on YouTube : Units of Data Storage Capacity Requirements All computer systems communicate , process and store data using binary . Binary is a number system consisting entirely of 0s and 1s . Why do computers use binary? Computer systems consist of billions of tiny transistors which are switches that only have two values - on (1 ) or off (0 ). Therefore all data must be represented and processed in this way. Everything that a computer needs to process must be converted into a binary format including text , images , videos and audio . 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 Units of Data Storage 0 / 1 All data in a computer system is made up of bits . A single bit is a 0 or a 1 . 4 bits (such as 0101 or 1101) is called a nibble . 1,000 bytes is called a kilobyte . A kilobyte can store a short email . A 8 bits is called a byte . A byte can store a single character . 1,000 kilobytes is called a megabyte . A megabyte can store about a minute of music . 1,000 megabytes is called a gigabyte . A gigabyte can store about 500 photos . 1,000 terabytes is called a petabyte . A petabyte can store about 1.5 million CDs . 1,000 gigabytes is called a terabyte . A terabyte can store about 500 hours of films . Calculating Data Capacity Requirements It is important to be able to calculate the required storage capacity for a given set of data . Example: A local DJ has a USB memory stick with a capacity of 32GB . There is currently only 9GB of space remaining . Each song is 6MB . How many songs can be stored on the remaining space of the USB stick? Solution: Because each song is recorded in megabytes but the USB stick capacity is measured in gigabytes , the values must be converted into the same storage unit . 9GB x 1000 = 9000MB 9000MB ÷ 6MB = 1,500 songs Q uesto's Q uestions 2.3 - Data Units: 1. Explain why computer systems use binary to represent data. [ 2 ] 2. Put the following data storage units in order from smallest to largest : a . kilobyte - gigabyte - byte - megabyte - nibble - bit [3 ] b. gigabyte - petabyte - kilobyte - byte - terabyte - megabyte [ 3 ] 3. A hard drive contains 25GB of remaining available storage space. Tim is an animator backing up video files. Each file is 200MB . How many files can he fit on the hard drive? [ 2 ] 4. Samantha is a musician. She has compressed each song to 900KB . Her USB memory stick contains 1.2GB of free storage. How many songs can she fit on the USB stick? [ 2 ] 5. A CD has a capacity of 650MB . How many 0.2GB audio files can be stored on the CD? [ 2 ] 0101 2.2 - Secondary Storage Theory Topics 2.4a - Number Systems

  • 1.1b - Registers & FE Cycle - OCR GCSE (J277 Spec) | CSNewbs

    Learn about key registers used in the fetch - execute cycle such as the program counter and current instruction register. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 1.1b: Registers & The F-E Cycle Exam Board: OCR Specification: J277 Watch on YouTube : Registers in the FE Cycle Reading instructions The fetch - execute (F-E) cycle is performed by the CPU millions of times every second. This cycle is how the CPU processes data and instructions for each program or service requiring attention . Important Registers A register is a small storage space for temporary data in the CPU . Each register has a specific role . There are four essential registers used in the F-E cycle : Program Counter (PC) A register that tracks the RAM address of the next instruction to be fetched . Memory Address Register (MAR) Stores the RAM address of the current instruction (or data ) the CPU needs to access . Memory Data Register (MDR) The MDR stores the instruction that has been transferred from RAM to the CPU . Accumulator (ACC) The ACC stores the result of mathematical or logical calculations . The PC , MAR and MDR are used in the fetch stage , whereas the ACC is used in the execute stage . The PC and MAR store an address (a memory location in RAM ) whereas the MDR and ACC store data (a value ). Fetch - Execute Cycle The essential idea of the F-E cycle is that instructions are fetched from RAM , to be decoded (understood) and executed (processed) by the CPU . 1. The Program Counter (PC ) register displays the address in RAM of the next instruction to be processed . This value is copied into the Memory Address Register (MAR ). 0054 2. The PC register is increased by 1 . This prepares the CPU for the next instruction to be fetched. 0055 3. The CPU checks the address in RAM which matches the address held in the MAR . 0054 4. The instruction in RAM is transferred to the Memory Data Register (MDR ). MDR 5. The instruction is decoded by the contol unit which splits the instruction into an opcode (an action ) and an operand ( data or address ). 6. The instruction i s executed (run). Any result of an execution is stored in the Accumulator (ACC ) register, such as calculations made by the ALU . ACC 7. The cycle repeats by returning to the first step and checking the program counter for the address of the next instruction . Q uesto's Q uestions 1.1b - Registers & The F-E Cycle: 1 . What is the purpose of the registers ? [1 ] 2 . Describe the purpose of each register : a. The Program Counter (PC) [ 2 ] b. The Memory Address Register (MAR) [ 2 ] c. The Memory Data Register (MDR) [ 2 ] d. The Current Instruction Register (CIR) [ 2 ] e. The Accumulator (ACC) [ 2 ] 3. Draw a diagram with icons and words to show the steps of the Fetch - Execute cycle . [7 ] 1.1a - The CPU Theory Topics 1.2 - CPU Performance

  • 2.2a - Applications & Utilities | OCR A-Level | CSNewbs

    Based on the 2015 OCR Computer Science A-Level specification. Exam Board: OCR 2.2a: Applications & Utilities Specification: A-Level 2015 An instruction set is a list of all the instructions that a CPU can process as part of the FDE cycle . CPUs can have different sets of instructions that they can perform based on their function. The two most common instruction sets are the simpler RISC (Reduced Instruction Set Computer ) and more complicated CISC (Complex Instruction Set Computer ). Instruction Sets This page is still being updated. Graphical Processing Unit What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Q uesto's Q uestions 2.2a - Applications & Utilities: 1. What is cache memory ? [ 2 ] 2.1 - Operating Systems Theory Topics 2.2b - Translators & Compilation

© CSNewbs 2025

The written, video and visual content of CSNewbs is protected by copyright. © 2025
bottom of page