**A Notional Machine** --- ******************************************************************************************************** * MEMORY (long row of slots) * I/O .---------. / code.py * .----------------------. |_________| .----------. / .--------. * | • Network (internet) | |_________| | / | step 1 | * | • Printer | .-----. |_________| | PERSISTENT/| | step 2 <--- INSTRUCTION * | • Screen |<---->| CPU |<---->|_________|<---->| STORAGE v | | step 3 | POINTER * | • Speakers | '-----' |_________| | (HD) | | ... | * | • ... | |_________| '----------' '--------' * '----------------------' ' ' * • * • * • ******************************************************************************************************** - The CENTRAL PROCESSING UNIT (CPU) has two essential operations + do math + move data (usually by copying it from one place to another) + for example, taking two numbers stored in different memory slots, adding them together, and storing the result in a third memory slot - Data is sent to and received from different places + MEMORY * a long row of slots, each of which can store a piece of information (number, text, the location of other information) * a sort of *short-term memeory* because information only exists in memory while it has electricity (i.e., if the machine is turned off, memory is cleared) + PERSISTENT STORAGE * typically a computer's *hard drive*, but can take other forms (e.g., magnetic tape in ye olde days) * does not require electricity to hold information, acts as the machine's *long-term memory* * where the files and folders live - including Python files like `code.py` containing instructions for the machine - when code is *executed*, it's copied from persistent storage to memory, and then instructions are sent to the CPU one at a time + INPUT/OUTPT (I/O) * external channels through which the machine can send and/or receive data - The INSTRUCTION POINTER (IP) is a special piece of data + it keeps track of the next step the machine should do + CPU can change it just like other data, meaning it can skip over some steps or go back and redo others