Ch1 Introduction 2
Ch1 Introduction 2
Ch1 Introduction 2
Acknowledgment
The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
OBJECTIVES
1
What is a Computer?
Computer
Device capable of performing computations and making logical
decisions (hardware)
Computers process data under the control of sets of instructions called
Computer Organization
Six logical units in every computer:
Input unit
Output unit
Outputs information (to screen, to printer, to control other devices)
Memory unit
Rapid access, low capacity, stores input information
Arithmetic and logic unit (ALU)
Performs arithmetic calculations and logic decisions
Central processing unit (CPU)
Supervises and coordinates the other sections of the computer
ALU is now a fundamental building block of the CPU
Secondary storage unit
Cheap, long-term, high-capacity storage
Stores inactive programs
2
Hardware
Operating systems
Manage transitions between jobs
Increased throughput
Timesharing
Computer runs a small portion of one user’s job then moves
on to service the next user
3
Operating Systems
Macintosh
Distributed computing
Computing distributed over networks
Client/server computing
Sharing of information across computer networks between
file servers and clients (personal computers)
4
Personal Computing, Distributed Computing, and
Client/Server Computing
5
Fortran, COBOL, Pascal and Ada
FORTRAN
Developed by IBM Corporation in the 1950s
Ada
Developed under the sponsorship of the U.S. Department of Defense
(DOD) during the 1970s and early 1980s
Able to perform multitasking
History of C
C
Evolved by Ritchie from two previous programming
languages, BCPL and B
Used to develop UNIX
Standardization
Many slight variations of C existed, and were incompatible
6
C Standard Library
C programs consist of pieces/modules called functions
A programmer can create his own functions
7
C++
C++
Superset of C developed by Bjarne Stroustrup at Bell Labs
Java
Java is used to
Create Web pages with dynamic and interactive content
8
BASIC, Visual Basic, Visual C++, Visual C# and .NET
BASIC
Developed in the mid-1960s by Professors John Kemeny
and Thomas Kurtz of Dartmouth College as a language for
writing simple programs
Visual Basic
Introduced by Microsoft in 1991 to simplify the process of
making Windows applications
Visual Basic, Visual C++, and Visual C#
Designed for Microsoft’s .NET programming platform
Phases of C Programs:
Edit (C program file names
should end with the .c
extension)
Preprocess
Compile
Link
Load
Execute
9
A Typical C Program Development Environment
Phase 1: Create your program with an editor program
Phase 2: A preprocessor find some preprocessor directives
(#include <stdio.h>) to include other files and perform various
text replacements
Phase 3: Compiler compiles the program into machine
languages (object code != object-oriented programming).
Phase 4: A linker links the object code with the code in library
or other places to produce an executable image.
Phase 5: A loader loads the executable image into memory
(RAM).
Phase 6: CPU executes the program one instruction at a time.
The load process in Windows OS is just input the name of the
executable file (for example, lab01.exe).
Packet switching
The transfer of digital data via small packets
TCP/IP
Bandwidth
Information carrying capacity of communications lines
10
History of the World Wide Web (WWW)
World Wide Web
Locate and view multimedia-based documents on almost
any subject
Makes information instantly and conveniently accessible
worldwide
Possible for individuals and small businesses to get
worldwide exposure
Changing the way business is done
VIP in Computing
11
VIP in Communication
Computer Organization
Hardware: Input/Output; RAM (Random-access memory);
Hard disk (secondary storage unit); ALU/CPU; Motherboard;
Computer Case (power); CD or DVD-ROM (peripheral
components).
Moore’ Law: the same price for the double of computing
power approximately every one or two years
Software: Operating systems (OS); Application Software. (A
hierarchical structure)
OS manages and coordinates activities and the sharing of the
limited resources of the computer. Applications use
application programming interface (API) provided by
libraries and OS to handle computer resources.
12
Languages
Machine languages (a numerical representation
+1300042774) are hardware or platform dependent. They
are understood directly by ALU/CPU and thus efficient to
computers. Every CPU model has its own machine code,
or instruction sets.
Assembly languages (a symbolic representation LOAD
BASEPAY) are also architecture dependent. It is difficult to
portable to other systems or machines. Today, it is used
primarily for direct hardware manipulation. Typical uses
are device drivers, low-level embedded systems, and real-
time systems.
High-level languages like C are more potable to other
platforms and easy to understand by programmers in an
everyday English format (grossPay = basePay +
overTimePay).
C
C standard library contains of modules called functions
(building-block approach). We do not need to re-invent the
wheel and can directly use functions in library. The first part is
to learn how to write C programs, and the second part is to
learn how to use functions in C standard library.
Object-oriented programming (C++ or Java) focuses on
objects (nouns) rather than actions (verbs) (C or Pascal). Its
basic entity is called class. The reusability has been greatly
enhanced, which is beneficial for large software projects.
C Programs typically go through six phases to be executed:
edit, preprocess, compile, link, load and execute.
Integrated Developing Environment (IDE) such as Microsoft
Visual C++ 2005 Express Edition Software provides edit,
preprocess, compile and link in an integrated environment.
13
Web Resources for Self-learning
Google: http://www.google.com/
Wikipedia: http://en.wikipedia.org/wiki/Main_Page
C programming: http://www.cprogramming.com/
….
14