Search CSNewbs
304 results found with an empty search
- 11 Graphical User Interface | CSNewbs
Learn how to create and use a simple graphical user interface (GUI) in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. Python 11 - GUI Graphical User Interface In Python, you don’t have just to use a text display; you can create a GUI (Graphical User Interface ) to make programs that look professional. This page demonstrates the basic features of Python’s built-in GUI named tkinter . You can add images, labels, buttons and data entry boxes to develop interactive programs . Hyperlinked sections covered on this page: Setup: Title, Size & Background Creating Elements: Labels, Entry Boxes, Buttons, Images, Message Boxes Displaying Elements: Pack, Place, Grid Inputs & Outputs GUI Tasks Setup Setup: Title, Size & Background Firstly, import the tkinter command and set tkinter.Tk() to a variable such as window . GUI code can be quite complicated with multiple elements so it is sensible to use a comment for each section. Setting the title , size and background colour of your window is optional but can be easily set up at the start of your code. The .geometry() command sets the size of the window. The first number is the width , and the second number is the height . The .configure() command can be used to set the background colour . For a full list of compatible colours, check here . import tkinter #Setting up the Window window = tkinter.Tk() window.title( "Graphical User Interface" ) window.geometry( "400x400" ) window.configure(background = "lightblue" ) import tkinter #Setting up the Window window = tkinter.Tk() window.title( "Example Number Two" ) window.geometry( "300x400" ) window.configure(background = "darkorchid3" ) Creating Elements Creating Elements: Labels, Entry Boxes, Buttons, Radio Buttons, Images, Message Boxes Labels label1 = tkinter.Label(window, text = "Hello there" ) label1 = tkinter.Label(window, text = "Hello there" , fg = "black" , bg = "lightblue" , font = ( "Arial" , 12)) Simple label with default formatting: Label with custom formatting: No elements will appear in your window until you write code to put them there. See the 'Displaying Elements' section further down. Entry (Text) Boxes Simple entry box with default formatting: entry1 = tkinter.Entry(window ) Entry boxes will appear blank , the 'Example Text' shown in the images has been typed in. Entry box with custom formatting: entry1 = tkinter.Entry(window, fg = "blue" , bg = "gray90" , width = 12, font = ( "Arial" ,12)) Buttons The command property of a button is a subroutine that will be called when the button is pressed . The subroutine must be written above the button creation code. def ButtonPress (): #Code here runs when the button is pressed button1 = tkinter.Button(window, text = "Click Me" , fg = "black" , bg = "gold2" , command = ButtonPress) Radio Buttons The Radiobutton element is a multiple-choice option button . A variable needs to be created to track which option has been selected, in this example it is ‘choice ’. Each radio button needs to be linked to the variable and given a unique value (e.g. 0, 1, 2). The radio button with the the value of 0 will be automatically selected when the window opens . Although not shown below, the .set() command can also be used to select a specific radio button , e.g. choice.set(2) . choice = tkinter.IntVar() radio1 = tkinter.Radiobutton(window, text = "Breakfast" , variable = choice, value = 0) radio2 = tkinter.Radiobutton(window, text = "Lunch" , variable = choice, value = 1) radio3 = tkinter.Radiobutton(window, text = "Dinner" , variable = choice, value = 2) Message Boxes You need to import messagebox from tkinter before you can use message boxes . You only need to do this once in your program and it sensible to have it at the very start after you import tkinter (and any other libraries). from tkinter import messagebox tkinter.messagebox.showinfo( "Information" , "Welcome to the program!" ) tkinter.messagebox.showerror( "Error" , "There is a problem with the program." ) if (tkinter.messagebox.askyesno( "Warning" , "Have you understood the instructions?" )) == True : tkinter.messagebox.showinfo( "Warning" , "Thank you for understanding." ) else : tkinter.messagebox.showinfo( "Warning" , "Please read the instructions again." ) Yes / No Message Box Clicking Yes (True ) Clicking No (False ) Images Tkinter supports the image file types .png and .gif . The image file must be saved in the same folder that the .py file is. Resize the image in separate image editing software such as Paint to a specific size . Tkinter does not support all image file types, such as .jpg. Use an application like Microsoft Paint to save an image with a different extension like .png. photo1 = tkinter.PhotoImage(file = "hamster.png" ) photoLabel1 = tkinter.Label(window, image = photo1) An image can be turned into a clickable button rather than a label. def ButtonPress (): #Code here runs when the button is pressed photo1 = tkinter.PhotoImage(file = "hamster.png" ) button1 = tkinter.Button(window, image = photo1, command = ButtonPress) photo1 = tkinter.PhotoImage(file = "hamster.png" ) window.iconphoto( True , photo1) The icon of the window can be changed to an image . Displaying Elements: Pack, Place and Grid Pack .pack() puts the element in the centre of the window, with the next packed element immediately below. window.mainloop() should always be your last line of code in every program, after you have packed, placed or gridded your elements. Displaying Elements labelAdd.pack() buttonAdd.pack() labelMinus.pack() buttonMinus.pack() window.mainloop() Place The .place() command allows an element to be placed in specific coordinates , using x (horizontal ) and y (vertical ) axes. labelAdd.place(x = 25, y = 15) buttonAdd.place(x = 12, y = 35) labelMinus.place(x = 90, y = 15) buttonMinus.place(x = 83, y = 35) window.mainloop() Grid The .grid() command is used to create a grid system to set the row and column . Remember Python starts counting at 0 . You can use padx and pady to add extra space (x is horizontal , y is vertical ). labelAdd.grid(row = 0, column = 0, padx = 10, pady = 5) buttonAdd.grid(row = 1, column = 0, padx = 10) labelMinus.grid(row = 0, column = 1, padx = 10, pady = 5) buttonMinus.grid(row = 1, column = 1, padx = 10) window.mainloop() Inputs & Outputs Inputs and Outputs .config to Change an Element .config() overwrites the property of an element. It can be used with elements such as labels and buttons to change how they appear. label1.config(text = "Warning!" ) The example below (not showing setup and packing) adds 1 to a total variable when the button is pressed . Config is used in two ways: to display the updated total and to change the background of the label to green. def AddOne (): global total total = total + 1 labelTotal.config(text = total, bg = "green" ) total = 0 buttonAdd = tkinter.Button(window, text = "Add" , command = AddOne) Below is a similar program in full that increases or decreases and displays a total when the buttons are pressed . #Setup import tkinter window = tkinter.Tk() total = 0 #Button Presses def AddOne (): global total total = total + 1 labelTotal.config(text = total) def MinusOne (): global total total = total - 1 labelTotal.config(text = total) #Create Elements labelTotal = tkinter.Label(window, text = total, font = ( "Arial" ,14)) buttonAdd = tkinter.Button(window, text = "+" , width = 6, bg = "green" , command = AddOne) buttonMinus = tkinter.Button(window, text = "-" , width = 6, bg = "red" , command = MinusOne) #Display Elements buttonAdd.pack() buttonMinus.pack() labelTotal.pack() window.mainloop() .get to Input a Value .get() returns the value of an element such as an entry box , label or the choice variable if using radio buttons . The value of the element should be stored in a variable so it can be used elsewhere, for example: name = entryName.get() number = int (entryNumber.get()) Use int when getting a value that is an integer : The full program example below checks that the values typed into the username and password entry boxes are correct . Error Messages #Setup import tkinter from tkinter import messagebox window = tkinter.Tk() window.title( "Login" ) #Button Presses def CheckDetails (): username = entryUsername.get() password = entryPassword.get() if username == "Bob Bobson" and password == "cabbage123" : tkinter.messagebox.showinfo( "Success" , "Welcome " + username) else : tkinter.messagebox.showerror( "Invalid ", "Those details are incorrect." ) #Create Elements labelUsername = tkinter.Label(window, text = "Username:" ) labelPassword = tkinter.Label(window, text = "Password" ) entryUsername = tkinter.Entry(window) entryPassword = tkinter.Entry(window) buttonLogin = tkinter.Button(window, text = "Login" , command = CheckDetails) #Display Elements labelUsername.grid(row = 0, column = 0) entryUsername.grid(row = 0, column = 1) labelPassword.grid(row = 1, column = 0) entryPassword.grid(row = 1, column = 1) buttonLogin.grid(row = 2, column = 0) window.mainloop() .bind for Key Presses (& Close Window) .get() will run a specific function when a certain key is pressed. The name of the key must be surrounded by < > brackets and speechmarks . Any associated subroutine of a key bind will need a parameter : event has been chosen and set to None . The code below closes the window using the .destroy() command when the Esc key is pressed. def Close (event = None ): window.destroy() window.bind( "" , Close) The code below will activate the button (and display a message box) by clicking on it but also by pressing the Enter ( Return ) key . def ButtonPress (event = None ): tkinter.messagebox.showinfo( "Success" , "The button was activated" ) button1 = tkinter.Button(window, text = "Press Me" , command = ButtonPress) window.bind( "" , ButtonPress) GUI Tasks GUI Programs to Make Making a program using a GUI can be overwhelming and you must decompose the problem - take it step by step : Import tkinter and create the window (set the title, size and background colour). Create the elements you will need such as labels , buttons and entry boxes . Put the components in the window using pack , place or grid . Write the subroutines for any button presses . These are written at the top of the program after the window setup. Consider your variables - do any need to be set at the start ? Have you made them global if they’re needed within a subroutine ? Put window.mainloop() as the final line of code, only have it once. Use #comments in your code to break up the different sections, the key four sections are shown below. #Setup #Button Presses #Create Elements #Display Elements GUI Task 1 (Random Number Generator ) Generate a random number between 1 and 100 when the button is pressed and display it in a label. Extension idea: Use entry boxes to allow the user to manually input the minimum and maximum value. Example solution: GUI Task 2 (Currency Exchange ) Enter a decimal value and convert it from British pounds to American dollars. You can search for the current exchange rate. Extension idea: Show the conversion rate for other currencies such as Euros and Japanese Yen. Example solution: GUI Task 3 (Random Quote Generator ) Create a list of quotes and use the choice command from the random library to select one to be displayed in a label when the button is clicked. Extension idea: Have a separate text box and button to add more quotes to the list. Example solution: GUI Task 4 (Colour Changer ) When the button is clicked change the background colour of the button with .config to the RGB colour code in the entry box. This should be # followed by 6 hexadecimal values (0-9, A-F). Extension idea: Have an error pop up in a message box if the colour code is incorrect - it must be exactly 7 characters long and start with a hashtag. Example solutions: GUI Task 5 (Class Captain Votes ) Use radio buttons to vote for different candidates in a class vote. Use an if statement when the button is pressed to check which radio button is selected using .get() and the variable you've assigned to the radio buttons ('choice' if you've followed the code in the radio buttons section on this page). Use .config to overwrite a label's value. Remember any variables you want to use in subroutines must be globalised. Extension idea: Stop the count after a certain number - e.g. 30 votes recorded. Example solution: ⬅ Section 10 Practice Tasks 12 - Error Handling ➡
- Python | 2a - Inputting Text | CSNewbs
Learn how to input strings (text) in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 2a - Inputting Text Inputting Text (Strings) in Python A string is a collection of characters (letters, numbers and punctuation) such as: “Wednesday” , “Toy Story 4” or “Boeing 747” . Use the input command to ask a question and let a user input data , which is automatically stored as a string . Variable to save the answer into. Give it a suitable name based on the input. name = input ( "What is your name? " ) = What is your name? Paulina Type your answer directly into the editor and press the Enter key. Statement that is printed to the screen. Leave a space to make the output look clearer. Once an input has been saved into a variable, it can be used for other purposes, such as printing it within a sentence : name = input ( "What is your name? " ) print ( "It is nice to meet you" , name) = What is your name? Jake the Dog It is nice to meet you Jake the Dog Always choose an appropriate variable name when using inputs. colour = input ( "What is your favourite colour? " ) print ( "Your favourite colour is " + colour + "? Mine is yellow." ) = What is your favourite colour? blue Your favourite colour is blue? Mine is yellow. Inputting Text Task 1 ( Holiday) Write an input line to ask the user where they last went on holiday . Write a print line that uses the holiday variable (their answer). Example solution: Where did you last go on holiday? Scotland I hope you had a nice time in Scotland Inputting Text Task 2 ( New Neighbour) Write an input line to ask the user for a title (e.g. Mr, Mrs, Dr). Write another input line for an object . Write a print line that uses both input variables (title and object ). Example solutions: Enter a title: Dr Enter an object: Fridge I think my new neighbour is Dr Fridge Enter a title: Mrs Enter an object: Armchair I think my new neighbour is Mrs Armchair Using a Variable Within an Input To use a variable you have previously assigned a value t o within the input statement you must use + (commas will not work). drink = input ( "What would you like to drink? " ) option = input ( "What would you like with your " + drink + "? " ) print ( "Getting your" , drink , "and" , option , "now...." ) = What would you like to drink? tea What would you like with your tea? biscuits Getting your tea and biscuits now... What would you like to drink? apple juice What would you like with your apple juice? cake Getting your apple juice and cake now... Inputting Text Task 3 ( Name & Game) Ask the user what their name is. Ask the user what their favourite game is. Use their name in the input statement for their game. Print a response with their name and the game they entered. Example solutions: What is your name? Rory Hi Rory, what's your favourite game? Minecraft Rory likes Minecraft? That's nice to know. What is your name? Kayleigh Hi Kayleigh, what's your favourite game? Stardew Valley Kayleigh likes Stardew Valley? That's nice to know. ⬅ Section 1 Practice Ta sks 2b - I nputting Numbers ➡
- HTML Guide 10 - More Pages | CSNewbs
Learn how to create more HTML pages and link them together using the anchor tag. 10. More Pages HTML Guide Watch on YouTube: Create a New Page Create a new page by either clicking the new page icon in Notepad ++ or selecting File then New . Then you need to save your new page with an appropriate name as a HTML file . Create a new page, save it and add information to it. Your new page needs the same essential tags as your original page: Then you can add the rest of your content . Link to Other Pages The tag is used to link between pages , just like it is used to hyperlink to other websites. Make sure you type your web pages exactly as you have saved them. Make sure all of your web pages are saved in the same folder . Include links between pages on each new page. A link to the second page. Don't forget a link back to your homepage on each new page. Why not add more pages to make your website more detailed? 9. Colours & Fonts HTML Guide
- 1.3 - Primary Storage - Eduqas GCSE (2020 spec) | CSNewbs
Learn about the five types of primary storage - RAM, ROM, cache, flash and virtual memory. Based on the 2020 Eduqas (WJEC) GCSE specification. 1.3: Primary Storage (Memory) Exam Board: Eduqas / WJEC Specification: 2020 + Storage in a computer system is split into two categories. Primary Storage: Very quick to access because it is attached to the motherboard . Typically smaller in storage size . Sometimes called ‘main memory’ . Secondary Storage: Slower to access because it is not directly embedded on the motherboard . Typically larger in storage size . Sometimes called ‘backing storage’ . Storage is also split into two types - volatile and non-volatile . Volatile storage is temporary - data is lost whenever the power is turned off . Example: RAM Non-volatile storage saves the data even when not being powered . Data can be stored long-term and accessed when the computer is switched on . Example: ROM Types of Primary Storage (Memory) Random Access Memory (RAM) RAM is volatile (temporary) storage that stores all programs that are currently running . RAM also stores parts of the operating system to be accessed by the CPU. RAM is made up of a large number of storage locations, each can be identified by a unique address . Read-Only Memory (ROM) Cache Memory ROM is non-volatile storage that cannot be changed . ROM stores the boot program / BIOS for when the computer is switched on. The BIOS then loads up the operating system to take over managing the computer. Cache memory is volatile (temporary) storage that stores data that is frequently accessed . It is very quick to access because it is closer to the CPU than other types of memory like RAM. The three levels of cache memory are explained in more detail in 1.5 . RAM ( R andom A ccess M emory) ROM ( R ead O nly M emory) Cache Memory Flash Memory Flash memory is editable so it can be read and written to . It is also non-volatile so it can be used for long-term data storage even when the system is not powered on. Flash memory is also used for secondary storage devices like USB sticks and solid-state drives - see 1.4 . Virtual Memory When a computer system is running slowly and RAM is near full capacity , the operating system will convert storage space on the drive into temporary memory . This virtual memory slows the system down because it takes longer to access the drive than it does to manage RAM. Transferring data between RAM and virtual memory is called paging . Q uesto's Q uestions 1.3 - Primary Storage (Memory): 1. Describe the differences between primary and secondary storage . This could be done in a table with the column headings 'access speed' , 'storage size' and 'also known as' . [ 6 ] 2. Explain the difference between volatile and non-volatile storage . State an example of both types. [ 4 ] 3. For each type of memory below, describe it and state what information is stored within it: a . Random Access Memory (RAM) [3 ] b. Read-Only Memory (ROM) [ 3 ] c. Cache memory [ 3 ] d. Flash memory [ 3 ] e. Virtual memory [ 3 ] 1.2 - FDE Cycle 1.4 - Secondary Storage Theory Topics
- OCR CTech IT | Unit 1 | 1.4 - Connectivity | CSNewbs
Learn about different methods of wired and wireless connection methods including Bluetooth, satellite and microwave. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 1.4 - Connectivity Exam Board: OCR Specification: 2016 - Unit 1 For computers to communicate with other devices and share data a form of connection is required. Wired Connections Copper Cables Copper cables are a cheaper type of wired internet connection that may be poorly insulated and therefore susceptible to electromagnetic interference . Copper cables are more likely to suffer from attenuation (network distortion ). However, they are malleable (easier to bend) and less likely to break than other cables such as fibre optic. They have a lower bandwidth - cannot transmit as much data at once - than fibre optic cables. Fibre Optic Cables Fibre optic cables are a very fast but expensive type of wired internet connection. Signals are transmitted as waves of light through a glass rod . Because of this fibre optic cables are not affected by electromagnetic interference and suffer less from attenuation . Fibre optic cables have a higher bandwidth - they can transfer more data at one time over a long distance than copper cables but they are more fragile . Wireless Connections Bluetooth Bluetooth is a temporary short-range communication between two 'paired ' devices within a limit of about 10 metres . The required close proximity is a disadvantage , however a plus is that no other hardware is required for a connection. An example is the pairing of headphones to a smartphone to listen to music. Infrared Infrared networks have largely been replaced by Bluetooth or WiFi connections because infrared networks require devices to be in direct line of sight . Infrared is still used by some devices, such as remote controls , to transmit signals to a TV, but it only works across short distances . Microwave Microwave connections use radio waves to send signals across a large area via microwave towers . It can transmit a large amount of data but antennas must be in the line of sight of each other with no obstructions . Microwave connections are affected by bad weather , leading to higher chances of attenuation (network distortion ). Laser Satellite GSM / 5G Although not common, laser connections can send data between devices that are in the line of sight of each other as long as there are no barriers . Laser connections can transmit data up to 2km but bad weather severely affects the transmission rate. Laser connections can be used in space as there are fewer barriers between the satellites. Satellite networks use point-to-multipoint communication by using satellites above the Earth's atmosphere that receive a transmission and rebroadcast them back to Earth. Because of the distance between the communication device and the satellite (roughly 35,000km), there is a delay between data transmission and it being received. See 3.4 for more information on satellite networks . GSM (Global System for Mobile communications ) is a technology for allowing mobile phones to connect to a network for calls and text messages. Advances in mobile technology are classified by generations such as 4G and 5G (the current generation). Each generation is generally faster, more secure and allows for new opportunities. See 3.4 for more information on cellular networks . Q uesto's Q uestions 1.4 - Connection Methods: 1. Compare the differences between copper and fibre optic cables (possibly in a table) by the following features: a. Price b. Bandwidth c. Inteference d. Attenuation e. Malleability / Fragility [2 each ] 2. Describe each of the different types of wireless connection . Try to list 1 advantage and 1 disadvantage of using each type. a. Bluetooth b. Infrared c. Microwave d. Laser e. Satellite f. GSM / 5G [5 each ] 1.3 - Computer System Types Topic List 1.5 - Communication Hardware
- Computer Science Newbies
Homepage for learning about computer science in school. Discover topics across GCSE and Level 3 IT subjects, plus programming languages including Python, HTML and Greenfoot. C omputer S cience Newb ie s Popular topics: Python Programming Application Development OCR Cambridge Advanced National in Computing (AAQ) A-Level Computer Science You are viewing the mobile version of CSNewbs. The site will appear better on a desktop or laptop . OCR A-Level (H446) GCSE Computer Science OCR GCSE (J277) Latest YouTube Video Latest Blog Post Links & Information YouTube Channel Last updated: Tuesday 30th December 2025 Millions of visits since 2017! About CSNewbs
- 5.2 - Moral & Ethical Issues | OCR A-Level | CSNewbs
Learn about the moral and ethical issues of computing such as computers in the workforce, automated decision making, artificial intelligence, environmental effects, censorship and the internet, monitor behaviour, analysing personal information, piracy and offensive communications, layout, colour paradigms and character sets. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level Specification: Computer Science H446 5.2 - Moral & Ethical Issues Watch on YouTube : Moral & Ethical Issues #1 Moral & Ethical Issues #2 Artifical Intelligence Technology and the internet have transformed society , bringing huge benefits but also raising new ethical , social and environmental challenges . Below are some key modern issues linked to computing and digital systems . Moral & Ethical Issues Computers in the Workforce: Computers and automation have increased productivity and created new tech-based jobs , but they have also led to job losses in areas where machines can replace human labour . This raises concerns about unemployment and retraining in many industries . Automated Decision Making: Systems such as credit checks and recruitment tools now make decisions automatically using algorithms . While this can save time and reduce human bias , it can also lead to unfair or inaccurate outcomes if the data or programming is flawed . Artificial Intelligence (AI): AI allows machines to learn and make decisions without explicit human control , improving fields like healthcare and transport . However, it also raises ethical questions about accountability , job loss and the potential misuse of intelligent systems . Environmental Effects: Computers require energy to manufacture , use and dispose of , contributing to electronic waste and carbon emissions . Recycling and energy-efficient design can help reduce the environmental impact of modern technology . Censorship and the Internet: Some governments and organisations restrict access to information online to control what people can see or share . While this can protect users from harmful content , it can also limit freedom of expression and access to knowledge . Monitoring Behaviour: Digital systems and surveillance tools can track users’ actions , such as browsing history or location . This can improve safety and security but also raises privacy concerns about who collects this data and how it’s used . Analysing Personal Information: Companies and governments can collect and analyse large amounts of personal data to improve services or target advertising . However, this creates risks of data misuse , discrimination or identity theft if information isn’t protected properly. Piracy and Offensive Communications: The internet makes it easy to copy and share content illegally , such as music , films or software , leading to lost income for creators . It can also be a platform for offensive or harmful communication , such as trolling or cyberbullying , which can have serious social effects . Layout, Colour Paradigms, and Character Sets: Design choices like layout , colour schemes and character sets affect how accessible and inclusive digital content is. Using clear design , appropriate colours and Unicode character sets helps ensure that websites and software can be used by people of all languages and abilities . YouTube video uploading soon YouTube video uploading soon YouTube video uploading soon This page is under active development. Check here for the latest progress update. Q uesto's K ey T erms Moral & Ethical Issues: moral, social, ethical, cultural, opportunities, risks, computers in the workforce, automated decision making, artificial intelligence (AI), environmental effects, censorship, the internet, monitor behaviour, analysing personal information, piracy, offensive communications, layout, colour paradigms, character sets D id Y ou K now? In 2022 , the world generated 62 million tonnes of e-waste (roughly 7.8 kg per person globally) and only 22% of it was formally collected and recycled . 5.1 - Computing Legislation A-Level Topics
- 4.3 - Boolean Algebra | OCR A-Level | CSNewbs
Learn about boolean logic and expressions using NOT, AND OR and XOR, Karnaugh maps, Boolean algebra rules including De Morgan’s Laws, distribution, association, commutation and double negation, logic gate diagrams, truth tables, D-type flip flops, half adders and full adders. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level Specification: Computer Science H446 4.3 - Boolean Algebra Watch on YouTube : Boolean Logic (NOT, AND, OR, XOR) Karnaugh maps Boolean algebra rules Logic gate diagrams Truth tables D-type flip flops Half & full adders This topic explores how the logical operations NOT , AND , OR and XOR are used to process binary data and control digital systems . It also looks at how to simplify and represent logic using Karnaugh maps , Boolean algebra rules , logic gate diagrams and truth tables . Boolean Logic Boolean logic is a form of algebra in which all values are either True (1 ) or False (0 ). It’s used in computing and digital circuits to make decisions and control the flow of programs . NOT (negation ) (¬ ) reverses the input value - 1 becomes 0 and 0 becomes 1 . AND (conjunction ) (∧ ) outputs 1 only if both inputs are 1 (e.g. 1 AND 1 = 1 , otherwise 0 ). OR (disjunction ) (v ) outputs 1 if at least one input is 1 (e.g. 1 OR 0 = 1 ). XOR (exclusive disjunction ) (v ) outputs 1 only if one input is 1 but not both (e.g. 1 XOR 1 = 0 , 1 XOR 0 = 1 ). YouTube video uploading soon Karnaugh Maps A Karnaugh map is a visual method used to simplify Boolean expressions and make logic circuits more efficient . It organises all possible input combinations into a grid , where adjacent cells differ by only one bit (following Gray code order ). By grouping together 1s (representing True outputs ) in powers of two (1 , 2 , 4 or 8 cells ), you can identify and remove redundant terms in a Boolean expression . The simplified result reduces the number of logic gates needed in a circuit, making it faster and easier to build . YouTube video uploading soon Boolean Algebra Rules Boolean algebra rules are used to simplify Boolean expressions . De Morgan’s Laws show how to distribute negation across AND and OR operations: ¬(A AND B) = (¬A OR ¬B) and ¬(A OR B) = (¬A AND ¬B) . Distributive Law allows expressions to be expanded or factored , e.g., A AND (B OR C) = (A AND B) OR (A AND C) and vice versa for OR over AND. Associative Law means the grouping of terms doesn’t affect the result . (A AND B) AND C = A AND (B AND C) and (A OR B) OR C = A OR (B OR C) . Commutative Law means the order of terms doesn’t matter in Boolean operations, e.g., A AND B = B AND A and A OR B = B OR A . With Double Negation , two NOTs cancel each other out , returning the original value , e.g., ¬¬A = A . YouTube video uploading soon Logic Gate Diagrams Logic gate diagrams are visual representations of Boolean expressions or digital circuits , showing how data flows through logic gates to produce an output . Each gate performs a basic logical operation (such as NOT , AND , OR or XOR ) and is represented by a distinct symbol . NOT AND OR XOR YouTube video uploading soon Truth Tables A truth table is used to show all possible input combinations for a logic circuit or Boolean expression , along with the resulting output for each combination . Each row in the table represents a unique set of input values (usually 0 for False and 1 for True ). The final column shows the output produced by applying the logical operations to those inputs . The number of rows in a truth table doubles with each additional input , e.g. 4 rows for 2 inputs and 8 rows for 3 inputs . YouTube video uploading soon D-Type Flip Flops A D-type flip-flop i s a sequential logic circuit that stores a single bit of data - either 0 or 1 . It has two inputs , D (data ) and CLK (clock ), and two outputs , Q and ¬Q . When a clock pulse occurs , the flip-flop copies the value of D to the Q output , and that value is held (stored ) until the next clock pulse . This makes D-type flip-flops useful for memory storage , registers and data synchronisation . Essentially, they act as a 1-bit memory cell , storing the last value of D whenever the clock signal triggers . YouTube video uploading soon Half Adders & Full Adders A half adder is a logic circuit with two inputs (A and B ) that are added to produce two outputs - S (sum ), the result of A XOR B - and C (carry ), the result of A AND B . Half adders can only add two bits and cannot handle an input carry from a previous addition . A full adder is an extension of a half adder with three inputs : A , B , and C in (a carry-in from a previous calculation ). It produces two outputs : S (sum ) (A XOR B XOR Cin ) and C out (carry out ) ((A AND B) OR (B AND Cin) OR (A AND Cin) ). Full adders can be linked together to perform multi-bit binary addition in arithmetic circuits. YouTube video uploading soon This page is under active development. Check here for the latest progress update. Q uesto's K ey T erms Boolean Logic: NOT, AND, OR, XOR, Karnaugh maps, logic gate diagrams, truth tables Boolean Algebra Rules: De Morgan’s Laws, distribution, association, commutation, double negation D-Type Flip Flops: data, clock, Q, NOT Q Adders: half adder, full adder D id Y ou K now? The word ' Boolean ' is always spelt with a capital B because it is named after George Boole , a 19th-century English mathematician . His work has become the foundation of all modern digital electronics and computing . 4.2 - Data Structures A-Level Topics 5.1 - Computing Legislation
- OCR CTech IT | Unit 1 | 2.6 - Software Troubleshooting | CSNewbs
Learn about software errors and troubleshooting methods of solving them. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 2.6 - Software Troubleshooting Exam Board: OCR Specification: 2016 - Unit 1 A software error occurs when a program or process stops working as expected. Software errors usually occur when programs are badly written or if a user inputs unexpected data . Common Faults System Freeze The computer freezes and pressing keys or moving the mouse gives no response . Commonly caused by having too many applications running simultaneously or a virus using too much memory . Unexpected Reboot To try and fix errors, a computer might get stuck in an endless loop of booting and rebooting . Other systems may frequently restart without warning . Stop Error This occurs after a fatal system error when the operating system stops , usually because of a driver software issue . Commonly known as the 'blue screen of death ' on Windows-based systems. Update Error While designed to fix errors, updates can sometimes bring more problems if they interfere with the current software . Troubleshooting Tools for Software Errors Event Viewer (Logs) If a software error does occur, then the same characteristics as a hardware error should be logged , such as the time and date of the error , the user logged in , and the device's problem history . Memory Dump Copies and displays the contents of RAM at the time of a crash to help a technician discover what happened . Baselines Before After A comparison of what the system is like after a crash compared to a fixed point in time beforehand. The baseline can be used to see differences which may have caused the computer to fail . Anti-Virus Checks if malware is running on a device, using up resources and slowing the system down. It could then be quarantined and deleted by the anti-virus. Installable tools can also be downloaded to investigate the system and find the cause of the problem . They may help detect corrupted files , uncover deleted files , and resolve other general hardware or software issues . Q uesto's Q uestions 2.6 - Software Troubleshooting: 1. Describe each of the four common types of software error : a. System Freeze b. Stop Error c. Unexpected Reboot d. Update Error [2 each ] 2. Describe each type of troubleshooting tool and explain how it can be used to discover and fix software errors. a. Event Viewer b. Memory Dump c. Baselines d. Antivirus Software e. Installable Tools [ 2 each ] 2.5 Communication Methods Topic List 2.7 - Protocols
- 2.3 - Software Development | OCR A-Level | CSNewbs
Learn about software development methodologies such as the waterfall lifecycle, agile methodologies, extreme programming, the spiral model and rapid application development (RAD). Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level 2.3 - Software Development Specification: Computer Science H446 Watch on YouTube : Waterfall Lifecycle Extreme Programming Spiral Model Rapid Application Development Software development models are step-by-step methods for creating and maintaining software . They are used to keep projects organised , reduce mistakes and make sure the finished program meets the user’s needs . Different models suit different types of projects . Waterfall Lifecycle The waterfall model is a linear and structured approach where each phase is completed one at a time in order . It needs all requirements to be clearly defined at the start , with little to no changes allowed once a phase is finished . This model is best suited for projects with fixed requirements and minimal risk of change . YouTube video uploading soon Extreme Programming Extreme Programming ( XP ) is a type of agile methodology that uses an iterative and flexible approach, progressing in small , usable chunks called iterations (or sprints ). It relies on frequent collaboration with stakeholders and user feedback to adapt to changing requirements . This model is ideal for dynamic projects where quick delivery and frequent updates are important. YouTube video uploading soon Spiral Model The spiral model combines iterative development and risk management , progressing through repeated cycles of planning , risk assessment , engineering ( development and testing ) and evaluation . Each loop focuses on identifying and addressing risks early in the project. It is ideal for complex and high-risk projects where requirements may change over time . YouTube video uploading soon Rapid Application Development The rapid application development ( RAD ) model focuses on quickly building software through iterative development and frequent user feedback . It uses reusable components , time-boxing and constant feedback to speed up the delivery of an effective final product . RAD is best suited for projects that need to be completed quickly and where requirements can evolve during development . YouTube video uploading soon This page is under active development. Check here for the latest progress update. Q uesto's K ey T erms Software Development: waterfall lifecycle, agile methodology, extreme programming (XP), spiral model, rapid application development (RAD) D id Y ou K now? Agile development is named after the ' Agile Manifesto ' - a set of principles for software development agreed by a group of developers at a ski resort in Utah , USA in 2001 . 2.2 - Applications Generation A-Level Topics 2.4 - Programming Languages
- Python | 7b - Functions | CSNewbs
Learn how to create and use functions in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 7b - Functions What is a Function? A function is a subroutine that takes one or more values from the main program and returns a value back. For example, transferring over a sphere’s radius from the main program for the function to calculate a surface area and then return that value to the main program. The two key differences between procedures and functions are: A function uses parameters to transfer data from the main program into the function. A function returns a value to the main program. Writing Functions A function is written the same way as a procedure but it uses parameters . In the example below the parameters are num1 and num2 which are sent from the main program to be used in the function . The return command is used to send a value back to the main program . Below is another example of a function that takes the radius of a sphere and works out the area in a separate function . The area is returned to the main program and printed. Subroutines can be reused and called with different parameters . The program below repeatedly takes an integer input and adds it to a total in a function that is then returned and printed. Practice Task Create a program similar to the sphere example above, this time to work out the volume of a cylinder. In the main program ask the user to enter the cylinder's radius and then its height. The actual calculation should be done in a function and returned to the main program. The calculation for a cylinder's volume is: pi x (radius x radius) x height Extension: Use the round command from section 9b to round the number to 2 decimal places. Example solution: Using Subroutines as a Menu Subroutines are often used to split programs up and give users a selection of options . Subroutines are used for this purpose because they are separate , making it easier to code and manage a program . The example below for a simplified online banking system uses separate subroutines accessible within a while true loop . Depending on the option chosen by the user, the appropriate subroutine will be called . Instead of a further practice task here, Task 4 of the Section 7 Practice tasks page challenges you to make a similar program using multiple subroutines. ⬅ 7a - Proced ures Section 7 Practice Tasks ➡
- 1.2 - Types of Processor | OCR A-Level | CSNewbs
Learn about the differences between CISC and RISC processors, GPUs and multicore and parallel systems. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level 1.2 - Types of Processor Specification: Computer Science H446 Watch on YouTube : CISC and RISC GPUs Multicore & parallel systems Instruction Sets An instruction set is the complete list of machine code instructions a CPU is designed to execute as part of the FDE cycle . CISC (Complex Instruction Set Computer ) CPUs have a large set of complex instructions , so tasks can be achieved in fewer lines of code , but some instructions take multiple clock cycles . RISC (Reduced Instruction Set Computer ) CPUs use a smaller set of simple instructions , each designed to execute in a single clock cycle , making execution faster but sometimes requiring more instructions overall . GPUs A GPU (Graphics Processing Unit ) is a co-processor with thousands of smaller cores designed for parallel processing . This is in contrast to the CPU , which has fewer but more powerful cores . GPUs are used for rendering images , animations and video for fast , realistic graphics in games and multimedia . Because of their ability to handle many calculations at once , GPUs are widely used for non-graphical purposes too, such as machine learning , scientific simulations , data analysis and cryptocurrency mining . Multicore & Parallel Systems A multicore processor has multiple independent cores on a single CPU chip . Each core can carry out its own FDE cycle , so tasks can be split up , enabling multitasking and faster processing . However, only software designed to use multiple cores will benefit from this increased performance . A parallel system uses multiple processors (or cores ) working together on the same problem at the same time . This may involve multiple cores within one CPU or multiple CPUs in a single machine . Parallel processing greatly improves performance for tasks that can be divided into smaller sub-tasks , such as simulations and graphics rendering . However, some problems cannot be parallelised because they must be executed sequentially . Q uesto's K ey T erms Instruction Sets: instruction set, complex instruction set computer (CISC) , reduced instruction set computer (RISC) GPUs: graphics processing unit (GPU) Multicore Systems: multicore systems, parallel processing D id Y ou K now? Sony coined the term ' GPU ' for the PlayStation (1994), making it one of the first home consoles with a dedicated graphics processor . The term was later popularised further by NVIDIA in 1999 with the GeForce 256 . 1.1 - The Processor A-Level Topics 1.3 - Input, Output & Storage







