Download presentation
Presentation is loading. Please wait.
2
1 Lecture-2 CSIT-120 Spring 2001 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 Defining “Decision Making” power of computers Computer Science definition and relating it to use of computers as tools The role of information in computer science What is IT? 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
Program Storage ProcessorMemoryInputOutput Bus
8
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
9
Program Execution ProcessorMemoryInputOutput Bus
10
9 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
11
10 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
12
11 FETCH NEXT INSTRUCTION DECODE EXECUTE Fetch-Execute Cycle
13
12 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
14
13 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
15
14 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
16
15 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)
17
16 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
18
17 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
19
18 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)
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.