© by Pearson Education, Inc. All Rights Reserved.

Slides:



Advertisements
Similar presentations
EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
Advertisements

Three types of computer languages
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Introduction to Computers Essential Understanding of Computers and Computer Operations.
 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Computers and C Programming Outline Introduction What Is a Computer? Computer Organization.
Using C Programming Language.  The programs that run on a computer are referred to as software.  You’ll learn key programming methodology that are enhancing.
Using C Programming Language.  The programs that run on a computer are referred to as software.  You’ll learn key programming methodology that are enhancing.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers, the Internet, and the Web Outline 1.1 Introduction 1.2 What Is a.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Introduction to Computers and Python. What is a Computer? Computer- a device capable of performing computations and making logical decisions at speeds.
Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 1 Introduction.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI CSCI.
Introduction to Computers, the Internet and the by Pedernal Jemerson G by Pedernal.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
INTRODUCTION TO COMPUTER PROGRAMMING itc-314 LECTURE 01.
INTRODUCTION TO COMPUTING
COMPSCI 174- Introduction to C++ Class hour Section 01: MWF 9:55am – 10:45am. Hyer Hall 210.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introduction to Computers Outline 1.1Introduction.
 2006 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 1 February 8, 2005.
Module 2 : Part 1 INTRODUCTION TO HARDWARE & SOFTWARE INTRODUCTION TO HARDWARE & SOFTWARE.
COMPUTER PROGRAMMING. Computer programming the objective of the module to gain the necessary skills to develop a computer program using one of the high.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1.1 INTRODUCTION TO COMPUTERS AND C++ Dr. Shady Yehia Elmashad.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
Structured programming 1 st stage By Heba.A Raheem Assist Lecturer College of Sciences/Computer Sciences Department.
برمجه حاسبات 2 أ. بيان غزلان الفصل الدراسي هـ.
Introduction to Computers - Hardware
Chapter 1: Introduction to Computers and Programming
Chapter 1 Introduction 2nd Semester H
Computer Architecture and Number Systems
Introduction to Computers
OPERATING SYSTEM CONCEPT AND PRACTISE
BASIC PROGRAMMING C SCP1103 (02)
 2001 Prentice Hall, Inc. All rights reserved.
Introduction to Computers, the Internet and the Web
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: Introduction to computers and C++ Programming
CSC201: Computer Programming
Chapter 1 – Introduction to Computers, the Internet, and the Web
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Visual Basic 2008 Programming
Lecture 1: Introduction to JAVA
BASIC PROGRAMMING C SCP1103 (02)
Introduction to Programming
Chapter 1 – Introduction to Computers and C++ Programming
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Intro to Programming Week # 1 Hardware / Software Lecture # 2
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Chapter 1: Introduction to Computers and Programming
Computer Science I CSC 135.
Topics Introduction Hardware and Software How Computers Store Data
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction to Computers, the Internet and the Web
Chapter 1 – Introduction to Computers and C++ Programming
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Introduction to Computer Programming
Chapter 1 – Introduction to Computers and C++ Programming
Computer components is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format. Computer The computer.
Introduction to Computers, Internet and the World Wide Web
Chapter 1 – Introduction to Computers and C++ Programming
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

©1992-2010 by Pearson Education, Inc. All Rights Reserved. نمره تاریخ عنوان 2 نمره در طول ترم 4 آزمونک (quiz) 4 نمره 4 تمرین +1 نمره فعالیت کلاسی، حضور و غیاب 3 نمره تحویل روز بعد از امتحان پروژه مسابقه برنامه نویسی 5 نمره چهارشنبه 96/09/22 میان ترم 6 نمره یک شنبه 96/10/24 پایان ترم ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Introduction to Computers and Programming Language C How to Program, 6/e ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Computer Organization

1.2 Computers: Hardware and Software the physical parts or components of computer (e.g., the keyboard, screen, mouse, hard disk, memory, DVDs and processing units). Software The programs that run on a computer are referred to as software. instructions you write to command computers to perform actions on hardware ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.2 Computers: Hardware and Software A computer is a device that can perform computations and make logical decisions billions of times faster than human beings can. Computers process data under the control of sets of instructions called computer programs ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.2 Computers: Hardware and Software programmable general purpose machine can not do anything without a Program receives input letters, numbers, images processes and stores input Provides output in a useful format Input Process Output ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization Every computer may be envisioned as divided into six logical units or sections Computer Operating System CPU input output Control unit Keyboard Mouse Scanner etc. Monitor Printer etc. Arithmetic and logic unit Memory unit storage

1.3 Computer Organization (cont.) ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization (cont.) Input unit This “ receiving” section obtains information (data and computer programs) from input devices and places it at the disposal of the other units so that it can be processed. Humans typically enter information into computers through keyboards and mouse devices. Information also can be entered in many other ways, including by speaking to your computer, scanning images and barcodes, reading from secondary storage devices (like hard drives, CD drives, DVD drives and USB drives) and having your computer receive information from the Internet. … ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization (cont.) Output unit This “ shipping” section takes information that the computer has processed and places it on various output devices to make it available for use outside the computer. Most information that is output from computers today is displayed on screens, printed on paper, played on audio players (such as Apple’s popular iPods), or used to control other devices. Computers also can output their information to networks, such as the Internet. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization (cont.) Memory unit This rapid-access, relatively low-capacity “warehouse” section retains information that has been entered through the input unit, making it immediately available for processing when needed. The memory unit also retains processed information until it can be placed on output devices by the output unit. Information in the memory unit is volatile—it’s typically lost when the computer’s power is turned off. The memory unit is often called either memory or primary memory. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization (cont.) Central processing unit (CPU) This “ administrative” section coordinates and supervises the operation of the other sections. The CPU tells the input unit when to read information into the memory unit, tells the ALU when information from the memory unit should be used in calculations and tells the output unit when to send information from the memory unit to certain output devices. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization (cont.) Arithmetic and logic unit (ALU) This “ manufacturing” section performs calculations, such as addition, subtraction, multiplication and division. It also contains the decision mechanisms that allow the computer, for example, to compare two items from the memory unit to determine whether they’re equal. In today’s systems, the ALU is usually implemented as part of the next logical unit, the CPU. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization (cont.) Many of today’s computers have multiple CPUs and, hence, can perform many operations simultaneously— such computers are called multiprocessors. A multi-core processor implements multiprocessing on a single integrated circuit chip for example a dual-core processor has two CPUs and a quad- core processor has four CPUs. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization (cont.) Secondary storage unit. This is the long-term, high-capacity “warehousing” section. Programs or data not actively being used by the other units normally are placed on secondary storage devices (e.g., your hard drive) until they’re again needed, possibly hours, days, months or even years later. Therefore, information on secondary storage devices is said to be persistent—it is preserved even when the computer’s power is turned off. Secondary storage information takes much longer to access than information in primary memory, but the cost per unit of secondary storage is much less than that of primary memory. Examples of secondary storage devices include CDs, DVDs and flash drives, which can hold hundreds of millions to billions of characters. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.3 Computer Organization (cont.) Operating System (OS) the collection of computer programs that control the interaction of the user and the computer hardware. E.g. Windows, Unix Application Software Programs developed to assist a computer user in accomplishing specific tasks. E.g. Microsoft Word In order to create new application software, we need to write lists of instruction (program) to the computer to execute ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.4 Personal, Distributed and Client/Server Computing In 1977, Apple Computer popularized personal computing. In 1981, IBM, the world’s largest computer vendor, introduced the IBM Personal Computer (PC). ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.4 Personal, Distributed and Client/Server Computing(Cont.) This quickly legitimized personal computing in business, industry and government organizations, where IBM mainframes were heavily used. These computers were “stand-alone” units—people transported disks back and forth between them to share information (this was often called “sneakernet”). ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.4 Personal, Distributed and Client/Server Computing(Cont.) Personal machines could be linked together in computer networks, sometimes over telephone lines and sometimes in local area networks (LANs) within an organization. This led to the phenomenon of distributed computing. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.4 Personal, Distributed and Client/Server Computing(Cont.) Information is shared easily across computer networks, where computers called servers (file servers, database servers, web servers, etc.) offer capabilities that may be used by client computers distributed throughout the network, hence the term client/server computing. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.5 The Internet and the World Wide Web With the introduction of the World Wide Web—which allows computer users to locate and view multimedia-based documents on almost any subject over the Internet—the Internet has exploded into the world’s premier communication mechanism. Today’s applications can be written to communicate among the world’s computers. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Programming Language

1.6 Machine Languages, Assembly Languages and High-Level Languages Programmers write instructions in various programming languages, some directly understandable by computers and others requiring intermediate translation steps. Computer languages may be divided into three general types: Machine languages Assembly languages High-level languages ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.6 Machine Languages, Assembly Languages and High-Level Languages ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

©1992-2010 by Pearson Education, Inc. All Rights Reserved. 1.6  Machine Languages, Assembly Languages and High-Level Languages (Cont.) Machine language is the “natural language” of a computer and as such is defined by its hardware design. Machine language is often referred to as object code. Machine languages are machine dependent (i.e., a particular machine language can be used on only one type of computer). Any computer can directly understand only its own machine language. Processor and Architecture dependent (different machine language for different type of CPU) – not portable. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.6 Machine Languages, Assembly Languages and High-Level Languages Machine languages generally consist of strings of numbers (ultimately reduced to 1s and 0s) that instruct computers to perform their most elementary operations one at a time. Example: 00010101 11010001 01001100 Each of the lines above corresponds to a specific task to be done by the processor Such languages are cumbersome for humans. Instead of using the strings of numbers that computers could directly understand, programmers began using English-like abbreviations to represent elementary operations. These abbreviations formed the basis of assembly languages. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.6 Machine Languages, Assembly Languages and High-Level Languages Enables machine code to be represented in words and numbers Translator programs called assemblers were developed to convert early assembly-language programs to machine language at computer speeds. Example of a program in assembly language: LOAD A, 9999 LOAD B, 8282 SUB B MOV C, A Although such code is clearer to humans, it’s incomprehensible to computers until translated to machine language. Processor and Architecture dependent – not portable ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.6 Machine Languages, Assembly Languages and High-Level Languages Computer usage increased rapidly with the advent of assembly languages, but programmers still had to use many instructions to accomplish even the simplest tasks. To speed the programming process, high-level languages were developed in which single statements could be written to accomplish substantial tasks. Translator programs called compilers convert high-level language programs into machine language. Processor independent - the same code can be run on different processors. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.6 Machine Languages, Assembly Languages and High-Level Languages High-level languages allow programmers to write instructions that look almost like everyday English and contain commonly used mathematical notations. Examples: Basic, Fortran, Pascal, C, C++ and Java Interpreter programs were developed to execute high-level language programs directly (without the delay of compilation), although slower than compiled programs run. C is widely used for writing software for operating systems, for computer networking and for distributed client/server applications. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

©1992-2010 by Pearson Education, Inc. All Rights Reserved. 1.7  History of C BCPL ,1967, Martin Richards as a language for writing operating-systems software and compiler B, 1969, Ken Thomson based on BCPL C, 1972, Dennis Ritchie based on BCPL and B C initially became widely known as the development language of the UNIX operating system. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.15 Typical C Program Development Environment C systems generally consist of several parts: A program development environment (IDE) The language The C Standard Library. C programs typically go through six phases to be executed: edit, preprocess, compile, link, load and execute. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.15 Typical C Program Development Environment (Cont.) Phase 1 consists of editing a file. This is accomplished with an editor program. You type a C program with the editor, make corrections if necessary, then store the program on a secondary storage device such as a hard disk. C program file names should end with the .c extension. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.15 Typical C Program Development Environment (Cont.) Editing a file with an editor program ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.15 Typical C Program Development Environment (Cont.) In Phase 2, the you give the command to compile the program. The compiler translates the C program into machine language-code (also referred to as object code). In a C system, a preprocessor program executes automatically before the compiler’s translation phase begins. The C preprocessor obeys special commands called preprocessor directives, which indicate that certain manipulations are to be performed on the program before compilation. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.15 Typical C Program Development Environment (Cont.) These manipulations usually consist of including other files in the file to be compiled and performing various text replacements. In Phase 3, the compiler translates the C program into machine- language code. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.15 Typical C Program Development Environment (Cont.) The next phase is called linking. C programs typically contain references to functions defined elsewhere, such as in the standard libraries or in the private libraries of groups of programmers working on a particular project. The object code produced by the C compiler typically contains “holes” due to these missing parts. A linker links the object code with the code for the missing functions to produce an executable image (with no missing pieces). ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.15 Typical C Program Development Environment (Cont.) The next phase is called loading. Before a program can be executed, the program must first be placed in memory. This is done by the loader, which takes the executable image from disk and transfers it to memory. Additional components from shared libraries that support the program are also loaded. Finally, the computer, under the control of its CPU, executes the program one instruction at a time. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

©1992-2010 by Pearson Education, Inc. All Rights Reserved.

1.15 Typical C Program Development Environment (Cont.) Programs do not always work on the first try. Each of the preceding phases can fail because of various errors that we’ll discuss. For example, an executing program might attempt to divide by zero. This would cause the computer to display an error message. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

©1992-2010 by Pearson Education, Inc. All Rights Reserved. Summary Computer Components Hardware Logical Computer Organization: Input unit, Output unit, Memory unit, ALU, CPU, Secondary storage unit Generations Of Computer Hardware: vacuum tube, transistor, IC, LSI , V LSI Software Operating System Application Software Programming Languages Machine Languages: language of processor; represented by 0 and 1 Assembly Languages: represented in words and numbers High-Level Languages: machine independent History Of C/C++ : based on BCPL, B; imperative language Typical C Program Development Environment Compilation Process : edit, preprocess, compile, link, load and execute ©1992-2010 by Pearson Education, Inc. All Rights Reserved.