| A | B |
| Hardware | The physical machine. Circuits that execute, store, and interact with instructions. Execution: CPU. Storage: Memory. Interaction: Peripherals, like keyboards and monitors |
| Sofware | All the different programs used collectively to give instructions to the computer are software. Ex. Windows 7, Google Chrome, Microsoft Word |
| Program | The set of instructions for a computer to carry out, also known as software. Our programs will be in Java |
| Instructions | A sequence of 0s and 1s that represents a single operation on the computer. |
| Bits | The individual 0s and 1s are referred to as bits. |
| Why only use 0s and 1s? | Its easier to make an electrical device that has only 2 stable states |
| Byte | A byte is the smallest addressable unit of memory contains 8 bits (0s or 1s). |
| What's the Central Processing Unit (CPU)? | The "brain" of the computer. It executes instructions (reads data from memory, does calculation, writes calculation results back to memory). CPU sees everything as memory. |
| Memory | Holds data for the computer (how much CPU can remember) |
| Main memory is | Holds current program and the data it's manipulating. It disappears when you shut your comp down.Ordered sequence of cells , directly connected to the CPU (aka. Random Access Memory, RAM). All programs must be brought into main memory before execution. |
| Secondary memory is | Hard drives, CDs, flash drives. It exists until you delete it, retaining info even if power is off |
| 1 Kilobyte (KB) | 1,000 bytes |
| 1 Megabyte (MB) | 1 million bytes (1,000 KB) |
| 1 Gigabyte (GB) | 1 billion bytes (1,000 MB) |
| 1 Terabyte (TB) | 1,000,000,000,000 bytes (1,000 GB) |
| Main memory, memory address | Used to locate certain memory positions, CPU fetches data according to memory address. |
| Peripherals (input devices) | Keyboard, mouse, etc. When they get input they save that at certain memory addresses |
| Peripherals (output devices) | Monitor, speaker, printer. They're projected to a certain memory address. When CPU wants to output, it writes those addresses. |
| High-level programming languages | Designed to be relatively easy for people to understand and use. Java is high level. |
| Why do we use Java? | It's widely used, incorporates (most ) modern features |
| Machine language | Machine language is the most basic language of a computer. A sequence of 0s and 1s (bits). Every computer directly understands its own machine language. |
| Compiler | The translation of a high-level language program to a low-level language is often done by a program called a compiler. So it takes something from human-readable to machine-readable |
| Programming languages: Java | General purpose. Best for writing larger programs. |
| Programming languages: Javascript | No relation to Java! Very specialized. Run in your web browser and adds advanced behavior to web pages |
| Programming languages: Python | General purpose but a scripting lang. Much easier to write small programs, but not bigger ones |
| Programming languages: Matlab | Very different from other 3 languages. Very powerful/specialized. Good for solving equations, graphing data etc |
| Program Counter (PC) | Points to the next instruction to be executed |
| Instruction Register (IR) | Holds the currently executing instruction |
| Arithmetic Logic Unit (ALU) | Carries out all arithmetic and logical ops |
| Accumulator (ACC) | Holds the results of the operations performed by the ALU |
| Main memory with 100 cells | Each memory cell has a numeric address which uniquely identifies it |
| How is info moved from main memory to secondary memory? | As needed |
| Example of CPU running program: Opening Notepad | Use mouse to select Notepad. CPU requests Notepad application. Notepad is loaded from the hard drive to main memory. CPU reads instructions from MM and executes one at a time. Notepad is displayed on your monitor. |
| Operating System (OS) | Monitors overall activity of the computer and provides services. Written using programming language. Example services: memory management, input/output, storage management |
| Application Programs | Written using prog languages. Perform a specific task, run by the OS. Examples: Browsers, word processors, spreadsheets, games |
| Classify the following as operating system or application: Microsoft Windows 8 | OS |
| Classify the following as operating system or application: Microsoft PowerPoint | Application |
| Classify the following as operating system or application: Linux | OS |
| Classify the following as operating system or application: Your COMP 110 programs | Application |
| All about data (software/hardware) | Software is data (#s, characters, instructions, programs). Hardware stores and precesses data (read, write, add/subtract/multiply) |
| Digitizing information | All info in a computer is digitized (broken down and represented as numbers) |
| Why can’t windows programs run on Apple computers? | Because the machine language is specific and different, so it cant be applied to a different program. |
| Bit permutations | Each permutation can represent a particular item. There are 2N permutations of N bits (N bits are needed to represent 2N unique items) |
| How many items can be represented by 2 bits? | 2^N = 2^2 = 4 items |
| Syntax rules | Which statements are legal and which are not |
| Semantic rules | determine the meaning of the instructions |
| Token | Smallest individual unit of a program. Has special symbols, word symbols, and identifiers |
| Word symbols (aka reserved words or keywords) | Always lowercase. Each word symbol is considered a single symbol. Cannot be used for anything other than their intended purpose in a program |
| Identifiers | Names of things in your program (variables, constants, etc). Can be made of any combo of letters, digits, underscore and dollar sign. Can't begin with a digit, and can't have any spaces. May be any length. Java is CASE SENSITIVE!!! |
| 4 primitive data types in Java that represent integers | Byte, short, int, long |
| 2 primitive data types in Java that represent floating point numbers | Float, double |
| 1 primitive data type in Java that represents characters | Char |
| 1 primitive data type in Java that represents boolean values | Boolean |
| What are primitive data types | Fundamental values like numbers and characters. Data types are sets of values and the operations that can be performed on those values. |
| Integers | Ex. -6778, -67, 0, 1203. Positive integers don't have + sign in front of them (but they can). No commas are used in an integer |