290 likes | 464 Views
CSC 1401 S1 Computer Programming I. Hamid Harroud School of Science and Engineering, Akhawayn University h.harroud@aui.ma http://www.aui.ma/~H.Harroud/CSC1401 Spring 2009. Overview of Computers and Programming. Lecture 1. Lecture 1: Introduction. Objectives.
E N D
CSC 1401 S1Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University h.harroud@aui.ma http://www.aui.ma/~H.Harroud/CSC1401 Spring 2009
Overview of Computers and Programming Lecture 1 Lecture 1: Introduction
Objectives Overview of the development of computers. Computer system components. Software categories and languages. Process of writing, compiling, and executing high-level language programs. 3 Lecture 1: Introduction
What Is Computing Science? Is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. 4 Lecture 1: Introduction
Fields of computing science Algorithms and data structures Programming languages and compilers Concurrent, parallel, and distributed systems Software engineering System architecture Theory of computation Communications Databases Artificial intelligence Visual rendering (or Computer graphics) Human-Computer Interaction Scientific computing 5 Lecture 1: Introduction
What Is a Computer? A machine that can be programmed to receive data, store it and process it into information. Data: raw facts representing people and events Information: data that is organized, meaningful, and useful 6 Lecture 1: Introduction
Fundamental Characteristics Speed Reliability Storage Capability 7 Lecture 1: Introduction
Computer System Components Hardware Equipment associated with the system Software Instructions that tell the hardware what to do People Computer programmer: writes software User: purchases and uses software Often called end-user 8 Lecture 1: Introduction
Computer Components Memory: Main Memory Secondary Storage CPU I/O devices 9 Lecture 1: Introduction
Central Processing Unit (CPU) The CPU has two roles: Coordinating all computer operations Performing arithmetic and logical operations in data The processor above can execute a simple instruction such as an integer addition in one six-billionth of a second. 10 Lecture 1: Introduction
The Machine Cycle • The time required to retrieve, execute, and store anoperation 11 Lecture 1: Introduction
Memory Memory cells Address Contents Main Memory Random Access Memory Read-Only access Memory Secondary Memory CD, DVD, etc. 12 Lecture 1: Introduction
Memory Units 1 Memory Cell = 1 or more Bytes 1 Byte = 8 Bits (Binary Digit) A Bit is either a 0 or a 1 Units for measuring the memory capacity: KB: Kilo Byte = 210 = 1024 1000 Byte MB: Mega Byte = 220 1 million Byte GB: Gega Byte = 230 1 billion Byte TB: Tera Byte = 240 1 trillion Byte 13 Lecture 1: Introduction
Data Representation Computers understand two things: on and off Data represented in binary form Binary (base 2) number system Contains only two digits, 0 and 1 Corresponds to two states, on and off 14 Lecture 1: Introduction
Coding Schemes Provide a common way of representing a character of data Needed so computers can exchange data Coding Scheme ASCII (American Standard Code for Information Interchange). 128 characters (256 characters in ExtendedASCII) A is encoded as 01000001 (66th character) 3 is encoded as 00110011. EBCDIC (used by IBM)-256 characters Unicode - 65536 characters. Two bytes are needed to store a character. 15 Lecture 1: Introduction
Computer Software: Operation System (OS) Command-Line Interface UNIX MS-DOS Graphical User Interface Macintosh OS Windows 18 Lecture 1: Introduction
Operating System A set of programs that lies between applications software and the hardware Manages computer’s resources (CPU, peripheral devices) Establishes a user interface Determines how user interacts with operating system Provides and executes services for applications software 19 Lecture 1: Introduction
Kernel Manages the operating system Loaded from hard drive into memory when computer is booted Booting refers to starting the computer Loads other operating system programs from disk storage as needed 20 Lecture 1: Introduction
The Language of a Computer Since inside the computer digital signals are processed, the language of a computer is a sequence of 0’s and 1’s. The computer language is called the Machine Language. A sequence of 0s and 1s is also referred as a Binary Number Code. 21 Lecture 1: Introduction
The Evolution of Programming Languages Early computers were programmed in machine language. Example: Suppose we want to represent the equation Wages = Rate X Hours to calculate the weekly wages in machine language. 100100 0000 010001 100110 0000 010010 100010 0000 010011 100100 stands for LOAD 100110 stands for MULTIPLY 100010 stands for STORE 22 Lecture 1: Introduction
Assembly languages Assembly languages: an instruction in assembly language is an easy-to-remember form called a mnemonic. Using the assembly language instructions, the equation to calculate the weekly wages can be written as follows: LOAD rate MULT hour STOR wages Assembler: An assembler is a program that translates a program written in assembly language into an equivalent program in machine language. 23 Lecture 1: Introduction
High-Level Languages: In order to calculate the weekly wages, the equation wages = rate Xhours in C, can be written as follows: wages = rate * hours; Compiler: is a program that translates a program written in a high level language to an equivalent machine language. 24 Lecture 1: Introduction
High-Level Languages 25 Lecture 1: Introduction
Computer Languages Machine Language Collection of binary numbers Not standardized Assembly Language Represented by Mnemonic codes Not standardized High-Level Language Independent of the CPU 26 Lecture 1: Introduction
High-Level Language Program 27 Lecture 1: Introduction
Flow of Information During Program Execution 28 Lecture 1: Introduction