ICS3U1 Final Exam Fall Outline 2024 (PDF)

Document Details

AdroitRealism

Uploaded by AdroitRealism

2024

Tags

computer hardware computer science computer software programming history

Summary

This document contains notes covering computer hardware, software, and programming history, with topics such as computer hardware components, different types of computer software, and programming languages' evolution.

Full Transcript

ICS3U1 Notes Computer Hardware: 7 Basic Computer Parts Motherboard Physical - Large circuit board with microchips on it. It has many sockets, slots, ports, plugs on it so you can plug stuff into it. A central Communication hub of the computer. -​ CPU → Motherboard → GPU -​ Hard Drive → Moth...

ICS3U1 Notes Computer Hardware: 7 Basic Computer Parts Motherboard Physical - Large circuit board with microchips on it. It has many sockets, slots, ports, plugs on it so you can plug stuff into it. A central Communication hub of the computer. -​ CPU → Motherboard → GPU -​ Hard Drive → Motherboard → RAM Acts like a spinal cord(Brain → Spine → Bicep) Ensure that it matches the number of devices you have to connect to the devices. CPU - Central Processing Unit Physical - Small square/rectangular circuit board with one main microchip. ON the backside, there are connector pins/dots. Sometimes, the microchip is covered with a metal protector. Its main function is to perform math and logic calculations. It acts as the Math/Logic part of the brain Ensure that the CPU can match the socket in the motherboard. RAM - Random Access Memory Small rectangular circuit board with microchips on it. One side are metal connector pads. Sometimes the microchips are covered with a metal protector. Main function is to store data of currently running programs. When programs are finished executing, the data is freed for the RAM to store the next program to run. RAM is really fast, but has limited data storage capacity. Acts as the short term memory of the human brain. Needs to be compatible with RAM slots on your motherboard as well as having enough storage to run the programs apps/games you want to run. Storage - Hard Drives - SSD(Solid State Disk) There are different types of SSD’s Store the data of programs that are not currently running. Store the programs and the files that it uses. Store lots of data, but is much slower than RAM. Cannot be easily removed unless the user tells the program to do so. The long term memory of your brain Ensure that it has enough space to store all of your programs and the data that the programs use. PSU - Power Supply Unit Large metal box with a home AC power connector on one side, and on the other side one or more DC power cables. Laptops, smartphones also have PSUs, but instead of a large metal box, they use a small metal box covered in plastic. Functionalities -​ Convert home 110V AC(Alternating Currents) power to a 5-12V DC(Direct Current) -​ Distributes the power inside a PC case to all parts of the computer Acts as a Human Digestive system for the computer Ensure that it has enough WATTs to run the parts inside of the computer. Case/Tower Large metal boxes that all computer parts are installed into. Provides a rigid structure to install your computer parts into. This is like the thesis to your essay. The foundation Provide protection against the outside environment such as dust, etc. Similar to the human skeletal systems. Ensure that the case is big enough to store all your computer parts. Cooling Physical - Fans, Water Cooling, Air Conditioning, Heat Sinks Ensure that the hot microchips remain at a specific temperature. Stop the computer parts from overheating. If the microchips are too hot, it would get invalid results and crash permanently. Metal heat sinks suck the heat away Fans blow the heat away Water cooling uses water to transport heat -​ Sweating would be similar to cooling for computers. Add ON/Peripheral computer parts GPU(Graphics Card) -​ Takes data from RAM and perform color, shape, 3D math on data, produces video signals -​ Connects to the Motherboard via PCI Express x16 slot(PCIe x16) or motherboard/cpu might have GPU built in. -​ Output to RAM Monitor -​ Takes video signal from GPU and converts that signal to colours and shapes onto the screen -​ Connects to GPU - HDMI, USBc, Displayport -​ Output to RAM Keyboard/Mouse -​ Takes human hand movements and clicks to convert them into character data and the xy coordinates -​ Connects via USB -​ Wireless - USB Dongle, Bluetooth Dongle -​ Input to RAM Sound Card(SPU) -​ Take data from RAM and perform sound calculations to produce an audio signal -​ Take audio signal, perform analog to digital calculations and put it in RAM -​ Connect via PCI Express x1, PCIe x1, USB, or built in in motherboards -​ Can be Input and Output to RAM. Speakers/Headsets -​ Take audio signals from SPU and produce sound waves that we humans can hear. -​ Connects via SPU using headphone/line out jack -​ Output to RAM Network Card(NIC) -​ Take data from the network or take data from RAM and put it on the network. -​ Connects via PCIe x1, USB, or built in in motherboards -​ Can be Input/Output Computer Software: Software is appropriate for hardware Hardware is appropriate for software Types of Softwares -​ System Software -​ A software that starts other software. -​ Initialize hardware, provide UI to interact. -​ Example: Windows, MacOS, IOS -​ Utility Software -​ Fix problem, protect user, maintain system performance -​ VPN, Firewalls, Anti Virus/Spyware/Adware, System Diagnosis, Disk Clean/Organizer -​ NordVPN, WIndows Firewall, Mcafee, Windows Task Manager, Clean My Mac -​ Application Software -​ Software that does stuff -​ Office/Business, Media Creation, Media Consumption, Internet -​ Microsoft 365 Office, Photoshop, Netflix, Youtube, Zoom, Chrome -​ Edutainment Software -​ Educate while entertaining(Games) -​ Minecraft, Valorant, Brawl Stars -​ Programming Software -​ Software that creates software -​ Programming Languages OR Code editors(IDEs) -​ Java, Python, Javascript Geany, Visual Studio Code(VS Code) Programming History: Generation Description Example Code 1st Binary Programming -​ Computers made of 0001 1010 0011 transistors(Switches with 1 and 0) -​ Using physical switches or punch cards when programming 2nd - Assembly Language -​ Programming language that ADD 10 3 can be typed in SUB 12 4 -​ Replaces binary commands with 3 letter mnemonics, and binary numbers with human decimal numbers. -​ Still made of transistors -​ Need to be converted to binary before running 3rd - English Like Languages -​ Next Gen languages that Java involve english words, variables and math symbols if(intMark < 50){ -​ More accessible println(“You fail”); -​ Still made of transistors }else{ -​ Compiled before running println(“You pass”) } C, Java (Grade 11 Style), Pascal, Basic, Turing 4th - Object Oriented -​ Ability to create and Java Programming(OOP) manipulate objects. Current Gen if(hasini.mark < 50){ -​ Still made of transistors hasini.cry(); -​ Compiled to binary before hasini.cry(); running hasini.hide(); }else{ hasini.smile(); hasini.readBook(“Game Of Thrones”); } Java (Grade 12), C++, C#, Swift, Kotlin, Python 5th - Possible future programming 2 Possible Scratch languages Graphical block programming. Drag and drop blocks functionally and connect them with arrows or something similar. Plain English Programming. Just tell the computer in plain English what game you want to create and the computer will generate the code for you. The latest Large Language Model AIs can generate some code, but not full AAA games/apps… yet Computers are still made of transistors! They only understand binary. So even these future languages need to be converted to binary before running… unless you create the next type of computers that don’t use transistors: quantum CPUs, light CPUs, combining computers and biology to grow your CPUs using neurons. *(The teacher forgot to add) *Numbering Systems Decimal Numbering System (DEC) 0123456789 Binary Numbering System (BIN) Transistors, used in computers 0, 1 Hexadecimal - HEX Hacking software, color codes, saves space 0123456789ABCDEF BIN → DEC 1.​ Identify the bits in the binary number that are ON (1) 2.​ Add up the values for each of the columns (bits) that are ON (1) 3.​ Done! 01000001 BIN → 64 + 1 = 65 DEC 00101010 BIN → 32 + 8 + 2 = 42 DEC 10000110 BIN → 128 + 4 + 2 = 134 DEC DEC → BIN 1.​ Write down 8 blank spots representing the 8 bits in the future binary number 2.​ Starting from the left of the binary number, turn on bits if they fit inside of the DEC number 3.​ As you turn on bits, subtract that value from the DEC number 4.​ Repeat until all bits are 1 or 0 136 DEC 1 0 0 0 1 0 0 0 136 - 128 = 8 8-8=0 136 DEC → 10001000 BIN BIN → HEX 1.​ Take your binary number, and starting from the right, split that number into 4 bit groups 2.​ Convert each 4 bit group to HEX 3.​ Done! 10101100 BIN → 1010 1100 → AC HEX HEX → BIN 1.​ Take your HEX number and separate it into individual HEX digits 2.​ Convert each HEX digit to 4 bit binary 3.​ Done! C4 HEX → C 4 → 11000100 BIN What about DEC → HEX? It can be done, but it is hard so do… DEC → BIN → HEX​ What about HEX → DEC? It is easier to do HEX → BIN → DEC *Binary/Hexadecimal Math Geany Setup Java Programming Language Download Java JDK → Install Downloaded Installer → Test if you have Java installed → Delete installer (Can help you compile code) Download and Install The Code Editor - Geany Download Code Editor, Geany → Install Downloaded Installer → Check if Geany is installed → Delete installer Download and Install The Educational Java Library - arc.jar Download → Create a new folder → Move the library to that folder Configure your Java code editor Geany so that it can see both the Java Language as well as the arc educational library Write a basic program in Geany and save → Find the full path to the arc.jar library Configure the compile command javac: Build Menu → Set Build Commands → Compile -​ Compile commands Mac -​ javac -cp "/Users/user/Desktop/Comp Sci 11/arc.jar:." "%f" -​ Execute commands Mac -​ java -cp "/Users/user/Desktop/Comp Sci 11/arc.jar:." "%e" When you write the program, use.java When you compile, it runs the javaC command. The JavaC compiles the.java to create the.class. Java command runs that.class file. Java (C - compile) Build commands() Download: Taking data from the web. Install: Place and ensure that it is ready to use. https://staugustinechs.ca/arc/arc/Console.html Programming Here is a drawing of the flow of data in a computer system. In any program that you use, data follows this flow. 1.​ Data comes in through an input device 2.​ Data is stored in RAM 3.​ The CPU might do a math or logic calculation on it 4.​ The resulting data is output to an output device. import arc.*; public class javabasics2{ ​ public static void main(String[] args){ ​ ​ Console con = new Console(); ​ } } Basic Skeleton. For every open { there is a close }, every open ( there is a close ). For every open [ there is a close ]. Capitalization matters. Spelling matters. import arc.*; Import different programming libraries. These libraries give us access to specific Java commands. The arc library gives us commands to talk to keyboards, mice, and gpu/monitors. You can import Java libraries to give you access to: sound commands, network commands, 3d graphics commands, public class javabasics2{ } Represents the title of the java program. Needs to match this title exactly when you save your java file. Ex: javabasics2.java. Some notes about the title: no spaces, can’t start with a number, no special characters. ​ public static void main(String[] args){ ​ } This structure represents the main function/method of the Java program. All java programs have a public static void main somewhere. When you run your compiled Java code, it looks for this main method. ALL Java programs have a main method. ​ ​ Console con = new Console(); The arc library provides the Console window. Through this console window, you will get number and text input, you will be able to print out text or graphics. Get Input Keyboard, Mouse ​ ​ intAge = con.readInt(); Keyboard Input Command - This command tells the computer to read Integer data from the keyboard and put that data into the variable (Stored in RAM). con.readLine(); con.readInt(); con.readDouble(); con.readBool(); Store Data in RAM Variables: String, int, double, boolean ​ ​ int intAge; RAM Command - This command tells RAM to reserve space for future data. This reservation uses the variable name intAge. This variable will hold int data… Integers… Whole Numbers String strThing; int intThing; double dblThing; boolean blnThing; Perform CPU Calculations Math - operators, functions, Logic - If statements, While Loops, AND/OR Logic ​ ​ intDays = intAge * 365; CPU Math Command - This command tells the CPU to perform the calculation on the right hand side of the equal sign, and put the result into the variable on the left hand side of the equal sign. Here are some math operators you can use in your Java equations: * → multiply / → divide + → add - → subtract % → modulus… integer division BUT finding the remainder. Ex: 15 % 6 = 3 ( ) → brackets to force order of operations ​ ​ dblSideC = Math.sqrt(Math.pow(dblSideA, 2) + Math.pow(dblSideB, 2)); Here are some functions you can use in your Java math equations: dblResult = Math.sqrt(dblNumber); dblResult = Math.pow(dblBase, dblExponent); dblResult = Math.round(dblNumber); ← rounds to the decimal point dblResult = Math.round(dblNumber * 1000.0) / 1000.0 ← Shifts the decimal point to the right and round the number. Then, you divide by 1000 to get the rounded number with 3 decimal places. dblResult = Math.sin(dblRadians); ← trig sine function dblResult = Math.cos(dblRadians); ← trig cosine function dblResult = Math.tan(dblRadians); ← trig tangent function dblRadians = Math.toRadians(dblDegrees); ← convert angle from degrees to angle in radians intMax = Math.max(intNumber1, intNumber2); ← compares two numbers and gets the max/biggest intMin = Math.min(intNumber1, intNumber2); ← compares two numbers and gets the min/smallest ​ ​ ​ dblTotal = dblTotal + dblNumber; In this equation the dblTotal variable is on the left and right hand side of the equal sign. How can this be? On the right side of the equal sign, the dblTotal variable has the old value. On the left hand side of the equal sign, the dblTotal variable has the updated/new value. ​ ​ intLength = strWord.length(); You can measure the length of any string… you can count the numbers of characters in that string. Ex: Alfred → 6, Amy → 3 ​ ​ ​ strBack = strBack + strLetter; In this equation, the same variable is on the right and left hand side of the equation. In this case, we are adding the old strBack to the strLetter to get the new strBack. When you are adding strings together, you are not doing math, you are attaching (concatenating) two strings together. If statements Math VS Logic. Math → Take two or more numbers (variables), do some math operation/function on them, and get a result Logic → Take two or more numbers (variables), compare them together, and based on how they compare, perform a task, or not. If Statement Structure if(somecomparisonconditionistrue){ // run this code is condition is true } else if(somecomparisonconditionistrue){ // run this code is condition is true } else { // run code if all of the above is false. } CPU Logic Command - In the round brackets, we have a condition (comparison). If that condition in the round brackets is TRUE, then run any code in the following squiggly {} brackets. Else if, is an alternate condition check. If the above if or else if statement is false, then check this else if statement. Else if is optional. You can have as many or little else if statements as you need. BUT just like if statements, if the condition is true, run the code in the squiggly brackets. Else, is where the code defaults to if all conditions, all if/else if statements above are false. “Catch All” statement if all above conditions are false. Else statements are optional. You don’t need else if statements above else statements…. You can just have an if statement followed by an else statement. Here are some logic comparison symbols you can use when setting up your if statement conditions. (comparing two numbers) >= → Greater than or equal to > → Greater than

Use Quizgecko on...
Browser
Browser