Download presentation
Presentation is loading. Please wait.
Published byRolf McBride Modified over 8 years ago
1
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization & Assembly Language Lecture 2 (Structured Computer Organization)
2
From text Book: Chapter 1 (1.1.1, 1.1.2) Structured Computer Organization Languages & Levels Virtual Machines Contemporary Multilevel Machine 6 Layers representation 2Structured Computer Organization
3
A computer is a machine that solves problems by executing instructions given to it. The set or a group of instructions constitute a program. The computer only understands machine language: a limited set of simple instructions that the internal electronic circuitry can comprehend. It is composed of fairly simple instructions (ex. Add, check output value, compare …) This simplicity is due to the need to reduce the complexity & cost of the electronics All programs have to be converted to machine language before being executed 3Structured Computer Organization
4
4 Structuring the computer as a series of abstraction layers Each layer builds upon the one below it. The complexity could be decomposed and mastered Systematic and organized way to design computer systems Structured Computer Organization
5
5 There is a gap between what humans want and what the computer understands. The more understandable human instructions form a language L1. The built-in machine instructions form a language L0. To facilitate the operation of the computer on humans, L1 is used to give instructions. But computers only understands the L0 instructions Translation OR Interpretation
6
6Structured Computer Organization Replaces each instruction in L1 by an equivalent sequence of instructions in L0. The entire L1 program is converted into an L0 program The newly generated L0 program is the one that is executed Moving completely from one language to another
7
7Structured Computer Organization It is the process carried out by the interpreter The interpreter: Is a program written in L0 Takes the L1 program as input data Examines each L1 instruction in turn and executes the equivalent sequence of L0 instructions directly After each L1 instruction is examined and decoded, it is carried out immediately No new L0 program in generated.
8
Hypothetical computer or virtual machine M1 whose machine language is L1. The virtual machine for L0 is M0. If M1 could be constructed cheaply enough (not the case) People could write their programs in L1 and have the computer execute them directly (no need for M0 executing programs in L0). If M1 is too expensive or complicated to construct People can write programs for M1, just as though it really exist these programs can be translated or interpreted to L0. 8Structured Computer Organization
9
For practical translation or interpretation, the languages L0 and L1 mustn’t be too different. This means that L1 although better than L0, will still be far from ideal for most applications. Question: How do we relieve the programmer of the burden of having to express a language more suited to machine than people? 9Structured Computer Organization
10
Invent another set of instructions that is more people-oriented and less machine- oriented than L1. Lets call it L2. The invention of a whole series of languages, each one more human convenient than its predecessors. Each language uses its predecessor as a basis, so we may view a computer using this technique as a series of layers or levels, one on top of another. The bottommost language or level is the simplest and the highest language or level is the most sophisticated. 10Structured Computer Organization
11
11Structured Computer Organization Virtual machine Mn, with machine language Ln Level n Level 3 Level 2 Level 1 Level 0 Programs in Ln are either interpreted by interpreter running on a lower machine, or are translated to the machine language of a lower machine Virtual machine M3, with machine language L3 Virtual machine M0, with machine language L0 Programs in L2 are either interpreted by interpreter running on M1 or M0, or are translated to L1 or L0. Programs in L1 are either interpreted by interpreter running on M0, or are translated to L0. Programs in L0 can be directly executed by the electronic circuits. Virtual machine M1, with machine language L1 Virtual machine M2, with machine language L2
12
12Structured Computer Organization An n level machine comprises n different virtual machines and n different languages. When working on a layer n, there is no need to know about the underlying interpreter or translator The machine structure insures that the upper level language instructions are converted into the lower levels and executed simultaneously.
13
Most modern computers are designed with somewhere between 2-6 layers. Level 0: Digital Logic Level Level 1: Micro-architecture level Level 2: Instruction Set Architecture level Level 3: Operating system machine level Level 4: Assembly Language level Level 5: Problem-oriented language level 13Structured Computer Organization
14
14Structured Computer Organization Problem-oriented language level Digital logic level Assembly language level Operating system machine level Instruction set architecture level Microarchitecture level Level 5 Level 4 Level 3 Level 2 Level 1 Level 0 Translation (compiler)/interpretation Translation (assembler) Partial interpretation (operating system) Interpretation (microprogram) or direct execution Hardware
15
It is a hardware level whose basic components are called gates Each gate is built up of at most a handful of transistors. Each gate has one or more digital inputs (signals representing 0 or 1) and computes as output some simple functions of these inputs, such as AND or OR. 15Structured Computer Organization
16
A number of gates can be combined to form a 1-bit memory, which can store a 0 or 1. The 1-bit memories can be combined in groups of 16, 32, or 64 to form registers. Each register can hold a single binary number up to some maximum Gates can also be combined to form the main computing engine itself. 16Structured Computer Organization
17
It is composed of local memory (a set of 8 to 32 registers) and the ALU It performs simple arithmetic operations such as addition, OR, AND ….. The registers are connected to the ALU to form a data path, over which the data flow. The basic operation of the data path consists of selection one or two registers having the ALU operate on them. But how is this data path controlled ? 17Structured Computer Organization
18
The operation of the data path is controlled by Control Unit: Control unit can have two organizations: CU controlled directly by hardware CU controlled by Software through a program called the micro-program The micro-program is an interpreter for the instructions at level 2. It fetches, examines, and executes instructions one by one, using data path to do so. For Hardwired control of the data path, the same steps for executing an instruction are followed, but without the explicit stored program to control the interpretation 18Structured Computer Organization
19
The machines instruction set is designated by the H/W manufacture. Every computer manufacturer publishes a manual for each of its computer it sells, entitled “Machine Language Reference Manual” These manuals are really about the ISA level. The set describes the instructions carried out interpretively by the micro-program or H/W execution circuits. 19Structured Computer Organization
20
It is a hybrid level with instructions overlapping with the ISA level. Some of the level 3 instructions are interpreted by the operating system and some are interpreted directly by micro program ( or hardwired control). It constitutes of: Instructions identical to level 2 Various other features: A set of new instructions Different memory organization The ability to run two or more programs concurrently ( carried out by an interpreter called operating system) 20Structured Computer Organization
21
21Structured Computer Organization Level 1,2, & 3 Levels 4 & 5 Intended for system programmers who Intended for application programmers specialize in designing and with a problem to solve implementing new virtual machines The machine languages of these levels Languages of these levels contain are numeric (long series of numbers) words and abbreviations meaningful to people Level 2 and 3 are always interpreted Usually (not always) supported by translation
22
22Course Introduction Assembly Language Program (e.g. MIPS) High Level Language Program (e.g. Java) Machine Language Program (i.e. bits) Compiler Assembler Machine Interpretation s[i] = temp s[i] = s[i+1] s[i+1] = temp lw $t0, 0($2) lw $t1, 4($2) sw $t1, 0($2) sw $t0, 4($2) 0000 1010 1000 0100 1110 1111 1010 1111 1001 1010 1101 0010 0100 0010 1011 0110 1100 0001 1011 1101 1100 0011 1011 1110
23
A symbolic form for one of the underlying languages. This level provides a method for people to write programs for levels 1, 2, and 3 in a form that is not unpleasant as the virtual machine languages themselves. Programs in assembly language are first translated (by the assembler) to level 1,2, or 3 language and then interpreted by the appropriate virtual or actual machine. 23Structured Computer Organization
24
Usually consists of languages designed to be used by application programmers. Such languages are often called high-level languages, ex. Pascal, FORTRAN, JAVA, C++, …etc. Programs written in these languages are generally translated to level 3 or level 4 by translators known as compilers (although occasionally they are interpreted, ex. JAVA). 24Structured Computer Organization
25
The set of data types, operations, and features of each level is called its architecture. The architecture deals with those aspects that are visible to the user of that level (ex. How much memory is available). Implementation aspects, such as what kind of chip technology is used to implement the memory, are not part of the architecture. The study of how to design those parts of a computer system that are visible to the programmers is called computer architecture. Computer architecture = computer organization 25Structured Computer Organization
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.