========================================================= Introduction to programmable computing devices ========================================================= Computer = Com + putare Putare = to reckon Com = intensify A computer is a "reckoning" or computing device.... ============================================== Computing devices: "Ancient" computing device: the abacus 1822: Babbage's difference engine Programmable devices: Programmable machine = a device which function can be altered by a program Mechanical piano/music box Mechanical loom Instruction encoding: using HOLES !!! How to encode instruction using numbers: 1 = add 2 = subtract and so on ======================================================== Introduction to computer: storing instructions and information ======================================================== Most common view (perception) of a computer (desktop computer) Component of the computer by their functionality: Input devices Output devices I/O devices Computer System (the box) Hardware and Software Hardware = the physical parts of a computer Software = the computer programs that you run with a computer Logical view of a computer: I/O device | Input -----> Computer System -----> Output Compute System = CPU + Memory RAM memory: Structure (address, memory cell) Operation (Store, recall) - Calculator ! ======================================================= Storing information in computer using numbers: Encoding = an agreement Everything inside a computer are stored as numbers Example: Computer instruction: 0 = add, 1 = subtract, and so on Sex info: 0 = male, 1 = female Marital status: 0 = single, 1 = married, 2 = divorced, 3 = widowed $64,000 question: What does 0 represent ??? Answer: context is needed to know what 0 represent !!! Just like: You IS an English word. You is NOT used in the context of "Personal pronoun" ====================================================== The computer memory and the binary number system ====================================================== A memory device must have more than 1 states The electrical switch is a memory device: on / off One switch can be in one of 2 states off = 0 on = 1 N switches can be in 2^N states. Representing numbers with switches: binary number system ===================================================== Computer memory: 1 switch = bit (BInary digiT) 8 switches = byte Each byte is assigned a unqiue address like SSN Adjacent memory cells can be combined to make larger memory cells: 2 bytes = 16 bits 4 bytes = 32 bits 8 bytes = 64 bits We need larger memory cells due to "overflow" (demo program - Overflow *********************) ======================================================= Introduction to the computer: how a computer executes instructions ======================================================= Structure of CPU Operation of the CPU Pointers Program flow Branching Types of instructions that a computer can execute: Read/write memory Compute Branching Entire programs consist of the 3 types of instructions !!!! ======================================================= Computer Algorithms ======================================================= Algorithm = a step-by-step procedure for solving a problem Computer Algorithm: is an algorithm that can be executed by a computer Difference between instructing Humans and Computer (Machine): A machine does not know how to remove a bulb Computers have no common sense knowledge (really dumb) A real life algorithm: Tell them to use 2 pieces of paper and follow instructions Euclid Alg for finding Greatest Common Divisor.