How Computers Work in Simple english Dr. John P. Abraham Professor UTPA
Credit given Much of these slides are borrowed.. The author did not leave information for me to cite.
Analogy A clerk and Boxes that holds instructions and data Think of it like post boxes, each box numbered. Each post office box instead of holding letters, holds simple digital information.
Instructions and Data If we consider one wall of boxes to hold instructions and another data, and start by reading the information or instructions in the first box on the instruction wall, we would then access each box sequentially unless instructed to do otherwise; we are executing a program.
Set of instructions called a program the clerk may read the information in the first box on the instruction wall and it says to take the information in the third box on the data wall and add it together with the information in the second box on the data wall, write down the sum and place it in the fifth box on the data wall. This process adds two numbers together and stores the result in a different location.
Branching with a condition the clerk may read information in the first box on the instruction wall instructing if the information or data in the first box on the data wall is larger than the information or data in the second box on the data wall, then go to the twenty-first box on the instruction wall and perform that instruction, or if it isn't larger, perform the instruction in the second box on the instruction wall. This is the decision making capability of the computer and gives it the power to do different things based upon conditions.
How computer starts When we boot the computer (start it) we force the processor to go to a special memory area which is ROM, or permanent memory. The clerk would, when he comes to work, go to a special area that is always the same and contains the same instructions. Since the clerk, when he goes home, forgets all about work, this area essentially retrains him rapidly and tells him to go the file cabinet and bring out the necessary work and place it in all the correct post office boxes. Once he is done loading all the boxes, he can start at the first and follow instructions from there on.
How does computer work with so many languages & Desciplines Software Hardware –Recognizes switches that are turned off and on –Transistors can act as switches and amplifiers. –One switch that provides two states,
Transistor analogy C Collector. Power supply voltage B base E Emittor By varying levels of current in B, the amount of current flowing into E can be regulated
2n2n 1 – – 32 6 –
ASCII and Unicode 8 bits 16 or 32 bits
Opcode and Operand Operation And what is operated on How many instructions needed?
Computer System CPU - memory Peripherals (input & output)
CPU Control unit ALU Registers Interconnection
Operation of a CPU 1. Figure out where the next instruction is in the memory (instruction address calculation). 2. Fetch the instruction 3. Figure out what the fetched code means (decoding the instruction). 4. If it requires an operand –a. Figure out where the operand is kept (operand address calculation). b. Fetch the operand
continued c. If there are multiple operands repeat a and b. 5. Execute the instruction (such as add, subtract, multiply, jump, loop, etc) 6. Figure out the location to store the result (operand address calculation) 7. store the result, if there are multiple results repeat 6 and Go back to 1 to do the next instruction, or End if it is the last instruction.
Instruction Cycle State Diagram