Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Lecture-2 CS-120 Fall 2000 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood.

Similar presentations


Presentation on theme: "1 Lecture-2 CS-120 Fall 2000 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood."— Presentation transcript:

1

2 1 Lecture-2 CS-120 Fall 2000 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood Op Codes

3 2 Revising Lecture-1 Define “Decision Making” power of computers Computer Science definition The role of information in computer science Algorithms and their examples

4 Introducing Computer Architecture “Architecture” refers to the structural details of buildings, systems and complex machines The basic architecture of a computer is surprisingly simple It consists of four main elements

5 Four Main Elements The four main elements are: –Processor –Memory –Input/Output –System Bus ProcessorMemoryInputOutput Bus

6 Running Your Programs A program is written by you You wish to EXECUTE it (run it on the computer) You feed it to the computer using INPUT The instructions and data of the program gets stored in the MEMORY

7 Running Your Programs The PROCESSOR reads instructions of the program and executes these instructions using the data as available The results of the program are conveyed to the OUTPUT or stored in the MEMORY During the execution, information flow between all elements is through the BUS

8 7 Fetch-Execute Cycle The PROCESSOR needs to fetch the instructions from the memory before they can be executed Once fetched, the instructions are DECODED Decoding means trying to understand what operations are to be carried out

9 8 Fetch-Execute Cycle The processor has a decoder that can interpret the instructions Necessary operands are also loaded and then the instruction is executed The results are forwarded and then the next instruction is fetched. This is called FETCH-EXECUTE cycle

10 9 A Look Under the Hood No matter what type of information is being processed, it is represented in the same way in the computer If you look at the contents of memory, all you will find are 1’s and 0’s (e.g. 110000101011110001011110101) The computer does not understand English All it knows are those cryptic 1’s and 0’s

11 10 A Look Under the Hood How can we then type English characters and see the same on the screen? The secret is in “coding” All information, whether text or numbers or data, must be translated into 1’s and 0’s before being stored in the memory When displaying back, the 1’s and 0’s are converted into the appropriate display symbols

12 11 A Look Under the Hood Each letter or digit is related to a “binary number” A binary number is simply a string of 1’s and 0’s For example, Capital “C” is 0100 0011 Capital “A” is 0100 0001

13 12 A Look Under the Hood This coding is standard and it is from a scheme called ASCII (American Standard Code for Information Interchange) Similarly integer numbers can be represented by 16-bit binary numbers (bit is the count of binary digits in the binary number)

14 13 A Look Under the Hood For example, integer 9 is represented as 0000 0000 0000 1001 Floating point numbers can also be represented in binary form

15 14 The Op Codes Instructions in a program are directions for doing something These directions are represented as “op codes” inside the memory Op code is short for “operation code” Instructions generally have op codes followed by operands

16 15 Op Codes For example, an add instruction has an op code for ADD, followed by two numbers that are to be added together Op codes also have binary representation For example, in a computer 011 may mean MUL (multiply op code)


Download ppt "1 Lecture-2 CS-120 Fall 2000 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood."

Similar presentations


Ads by Google