Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Computer Organization
A Typical Von-Neumann Architecture VonCPU Control Circuit (ex: PC: Program Counter) ALU Memor y I/O
Example:
1. 2. 3. 4. 5. 6.
Input unit Output unit Memory unit Arithmetic and logic unit (ALU) Central processing unit (CPU) Secondary storage unit
Programming Languages
1. Machine languages (machine
dependent)
Native tongue of a particular kind of computer. computer. Each instruction is a binary string. string. The code is used to indicate the operations to be performed and the memory cells to be addressed. This form is addressed. easiest form of computers to understand, but is most difficult for a person to understand. understand. Strings of numbers giving machine specific instructions
Example: +1300042774 +1400593419 +1200274027
Programming Languages
(cont.)
Example: Statement:
a= a + b
Before b
10 7
a After 17 b 7
Programming Languages
(cont.)
Structured programming
Disciplined approach to writing programs Clear, easy to test and debug and easy to modify
Multitasking
Specifying that many activities run in parallel (still timesliced)
Language Application Area Origin of Name
Formula Translation Common BusinessOriented Language Artificial Intelligence (AI) List Processing System Programming Predecessor B AI Logic Programming Real-time distributed systems Ada Augusta Byron & Charles Babbage GUI, OOP Objects talk via message Supports object & OOP C (++ is the increment operator) SupportsWeb programming Originally named Oak
Semantic Gap
A semantic gap exists between the amount of information conveyed in assembly language v high level languages. Consider the following C single statement: x = x + 3; This single statement may require many assembly language statements (operations): Load memory location 24 into accumulator Add a constant 3 to the accumulator Store accumulator in memory location 24 The number of executable statement expands greatly during the translation process from a high level language into assembly language.
C Programming Language
C
HighHigh-level general-purpose language developed in general1972 at AT&T Bell Lab. By Dennis Ritchie from two
previous programming BCPL and B
Today, virtually all new operating systems are written in C or C++. The current standard in C is ANSI C. C++ is a more advanced version of C, incorporating among other things, the objectobjectoriented constructs
Standardization
Many slight variations of C existed, and were incompatible Committee formed to create a "unambiguous, machinemachineindependent" definition Standard created in 1989, updated in 1999
C has become a popular language industry due its power and flexibility
Avoid re-inventing the wheel reIf a pre-made function exists, generally prebest to use it rather than write your own Library functions carefully written, efficient, and portable
represented as an object More understandable, better organized, and easier to maintain than procedural programming Favor modularity
1. Program is created in the editor and stored on disk 2. Preprocessor program processes the code 3. Compiler creates object code and stores it on disk. 4. Linker links the object code with the libraries
Primary Memory CP U
6. CPU takes each instruction and executes it, possibly storing new data values as the program executes
Revised Compiler attempts to Failure source file translate the program into machine code List of errors Success
The linker links the new object file with other object files
Input data
Welcome to CSCI230
Results
Constructs in C Language
Type Declarations: ex: int, float, I/O: ex: printf(), scanf() Arithmetic and Logical Operations: ex: +,,*,/,%,>,<,==,
Control Mechanisms:
while, for,
Application Software
Developed to assist a computer user in accomplishing special tasks
ex: word processing applications: MSMS-word or Word-perfect Wordex: Spreadsheet applications: Lotus1Lotus1-2-3, Excel ex: Database: Oracle, MS-Access MS-