What does a computer do? It performs calculations A billion calculation per second It remembers result What kind of calculation? Built-in to the language Ones that you define as thr programmer Computers only knows what you tell them TYPES OF KNOWLEDGE Declarative knowledge It is a stat,emt of fact Imperative knowledge It is a recipe or how to? It is the sequence of steps EXAMPLE 1,Sign up for a give away 2,Person chooses a random no. b/w 1 and N 3,Person finds the number and wins WHAT IS A RECIPE? 1,Sequence of steps 2,Flow of control process that specifies when each step is excuted 3,A means of determining when to stop THERE ARE 2 TYPES OF COMPUTERS 1,Fixed programs For example a calcutor it can only perform one task 2,Stored program Machine stores adn executes instructions A basic machine architecture consists of memory,contro unit and ARU[Arithmetic Logic Unit] Memory stores the actual data and the sequence The control unit is the program counter ARU checks that whether the instruction is possible to perform If the task is poosible then it infroms the control unit which increases the number by 1 and moves on to the next step A instruction might consist of a test,the test could be that it would check that whether is the value is greater or equal to value provided The test would return true or false If the test passes then it moves onto the next step If the test failes then it would go back to the first step STORED PROGRAM COMPUTER Sequence of instruction stored inside computer built for a predefined set of primitive instructions 1,Arthmetic and logic 2,Simple tests 3,Moving data CREATING RECIPES A programming