How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

17
How Computers Work in Simple english Dr. John P. Abraham Professor UTPA

Transcript of How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

Page 1: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

How Computers Work in Simple english

Dr. John P. Abraham

Professor

UTPA

Page 2: 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.

Page 3: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

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.

Page 4: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

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.

Page 5: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

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.

Page 6: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

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.

Page 7: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

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.

Page 8: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

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,

Page 9: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

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

Page 10: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

2n

• 1 – 2• 2 -4• 3 -8• 4 -16• 5 – 32• 6 – 64• 7- 128• 8 -256

Page 11: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

ASCII and Unicode

• 8 bits

• 16 or 32 bits

Page 12: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

Opcode and Operand

• Operation

• And what is operated on

• How many instructions needed?

Page 13: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

Computer System

• CPU - memory

• Peripherals (input & output)

Page 14: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

CPU

• Control unit

• ALU

• Registers

• Interconnection

Page 15: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

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

Page 16: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

continued

• c. If there are multipleoperands repeat a and b.5. Execute the instruction (such asadd, subtract, multiply, jump,loop, etc)6. Figure out the location to storethe result (operand addresscalculation)7. store the result, if there aremultiple results repeat 6 and 7.8. Go back to 1 to do the nextinstruction, or End if it is the lastinstruction.

Page 17: How Computers Work in Simple english Dr. John P. Abraham Professor UTPA.

Instruction Cycle State Diagram