Cosc1557 introduction to computing
Download
1 / 46

cosc1557: introduction to computing - PowerPoint PPT Presentation


  • 257 Views
  • Updated On :

COSC1557: Introduction to Computing. Haibin Zhu, PhD. AssistProfessor Department of Computer Science Nipissing University (C) 2002. Instructor. Haibin Zhu, Ph. D. Assistant Professor, Department of CS and Math, Nipissing University Room: A124A Ext.: 4434 Email: [email protected]

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'cosc1557: introduction to computing' - Patman


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Cosc1557 introduction to computing l.jpg

COSC1557: Introduction to Computing

Haibin Zhu, PhD.

AssistProfessor

Department of Computer Science

Nipissing University

(C) 2002


Instructor l.jpg
Instructor

  • Haibin Zhu, Ph. D.

  • Assistant Professor, Department of CS and Math, Nipissing University

  • Room: A124A Ext.: 4434

  • Email: [email protected]

  • URL: http://www.nipissingu.ca/faculty/haibinz

  • Office Hour: Mon.–Fri. 2:30pm-4:30pm, and by appointment


Course description l.jpg

Nature and uses of the computer-, algorithms-, number systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Course Description


Textbook and references l.jpg
Textbook and references systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Textbook:Joel Adams and Larry Nyhoff, C++: An Introduction to Computing, 3/e. Prentice Hall, © 2003 ISBN: 0-13-091426-6

  • Lecture Notes on http://cs.calvin.edu/books/c++/intro/3e/PPSlides/

  • Student Supplements: CD-Lab Manual (ISBN: 013080648X)

  • Some Lab: http://cs.calvin.edu/books/c++/intro/3e/HandsOnC++/


Beginning snapshots l.jpg

Beginning Snapshots systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Chapter 0


Objectives l.jpg
Objectives systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Give an overview of computer science

    • Show its breadth

  • Provide context for computer science concepts

    • Events from the past

  • Describe basic components, organization of a computer


Areas of computer science l.jpg

Algorithms and Data Structures systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Architecture

Artificial Intelligence and Robotics

Database and Information Retrieval

Human-Computer Communication

Numerical and Symbolic Computation

Operating Systems

Programming Languages

Software Methodology and Engineering

Social and Professional Context

Areas of Computer Science


Important concepts in computer history l.jpg
Important Concepts in Computer History systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • The mechanism of arithmetic

  • The stored program

  • The graphical user interface

  • The computer network


First generation computers l.jpg
First-Generation Computers systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Vacuum tube computers 1945-1956

    • ENIAC 1943-1946

    • John Von Neumann's"First Draft of a Report onthe EDVAC" 1945

    • First bug in a computer 1945

    • UNIVAC 1951


Second generation computers l.jpg
Second Generation Computers systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Used transistors 1956-1963

  • FORTRAN 1957

  • IBM 7090 1958

    LISP

  • COBOL 1960

    ALGOL 60


Third generation computers l.jpg
Third-Generation Computers systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Chips and Integrated Circuits 1964-1971

  • The IBM System/360 1964

  • The PDP-8 1965

  • Douglas Englebart: the mouse, Two-D display, editing, hypermedia, 1968

    Pascal

  • Ken Thompson: UNIX 1969

    ARPANET – The beginning of the Internet


Fourth generation computers l.jpg
Fourth-Generation Computers systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Intel 4004 Chip 1971

  • Dennis Richie: C 1973

  • Ethernet

  • Court rules Atanasoff was legal inventor of first electronic digital computer

  • Altair, BASIC, Apple 1 1974

  • Apple II, Cray 1, Apple Corp.Microsoft Corp. 1976

  • IBM PC 1981


Fourth generation computers13 l.jpg
Fourth-Generation Computers systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Bjarne Stroustrup: C++ 1983

    Novell announces NetwareTCP/IP

  • Macintosh 1984

  • Windows 1985

  • Intel 386 Chip 1986

  • Tim Berners—Lee: WWW 1991

  • Linux 1992


Fourth generation computers14 l.jpg
Fourth-Generation Computers systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Pentium chips, Power PC chip 1993

    MOSAIC, Apple Newton

  • Netscape Navigator 1.0, Yahoo! 1994Palm computing

  • James Gosling: JAVA 1995Windows 95, Internet Explorer,Internet goes commercial

  • Windows 98, Apple's IMAC 1998Microsoft's court case


Fourth generation computers15 l.jpg
Fourth-Generation Computers systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Y2K Problem, Powermac G4 1999

  • Windows 2000 20001 GHZ processors

  • Mac OS X 2001Windows XP

  • Quantum Computer 2002


Graphical user interface l.jpg
Graphical User Interface systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Command line interface required precise and cryptic commands

  • Xerox PARK had developed GUI prototype in 1972

    • Steve Jobs saw it several years later and used new hardware capabilities to implement

  • GUI makes computer easy to use


Network l.jpg
Network systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Defn: Two or more computers connect to exchange resources

    • Processing power

    • Storage

    • Access to a printer

    • Software resources

    • Messages


Network18 l.jpg
Network systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

  • Time sharing in early 1960s

    • Users communicate with host computer

  • ARPANET connected research center computers in 1969

    • Eventually developed into Internet

  • Local Area Network hardware and operating systems developed late 1970s

  • ISPs now affordable, widely available for even home computers


Computer organization l.jpg

Computer Organization systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Hardware and Software

Calvin College


Computing systems l.jpg
Computing Systems systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Computers have two kinds of components:

  • Hardware, consisting of its physical devices (CPU, memory, bus, storage devices, ...)

  • Software, consisting of the programs it has (Operating system, applications, utilities, ...)


Hardware cpu l.jpg
Hardware: CPU systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Central Processing Unit (CPU):

  • the “brain” of the machine(?)

  • location of circuitry that performs arithmetic and logical ML statements

  • measurement: speed (roughly) in megahertz (millions of clock-ticks per second)

  • examples: Intel Pentium(PI, PII, PIII, P4), AMD K6, Motorola PowerPC, Sun SPARC,


Hardware ram l.jpg
Hardware: RAM systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Random Access Memory (RAM)

  • “main” memory, which is fast, but volatile...

  • analogous to a person’s short-term memory.

  • many tiny “on-off” switches: for convenience

    • “on” is represented by 1, “off” by 0.

  • each switch is called a binary digit, or bit.

    • 8 bits is called a byte.

    • 210 bytes =1024 bytes is called a kilobyte (1K)

    • 220 bytes is called a megabyte (1M).


Hardware disk l.jpg
Hardware (Disk) systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Secondary Memory (Disk):

  • Stable storage using magnetic or optical media.

  • Analogous to a person’s long-term memory.

  • Slower to access than RAM.

  • Examples:

    • floppy disk (measured in kilobytes)

    • hard disk (measured in gigabytes (230 bytes))

    • CD-ROM (measured in megabytes), ...


Hardware the bus l.jpg
Hardware: the Bus systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

The Bus:

  • Connects CPU to other hardware devices.

  • Analogous to a person’s spinal cord.

  • Speed measured in megahertz (like the CPU), but typically much slower than the CPU...

  • The bottleneck in most of today’s PCs.


Hardware cache l.jpg
Hardware: Cache systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

While accessing RAM is faster than accessing secondary memory, it is still quite slow, relative to the rate at which the CPU runs.

To circumvent this problem, most systems add a fast cache memory to the CPU, to store recently used instructions and data.

(Assumption: Since such instructions/data were needed recently, they will be needed again in the near future.)


Hardware summary l.jpg

CPU systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Main

Memory

Secondary

Memory

cache

Bus

Hardware: Summary

Putting the pieces together:

Programs are stored (long-term) in secondary memory, and loaded into main memory to run, from which the CPU retrieves and executes their statements.


Software os l.jpg

Disk systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

CPU

RAM

Cache

OS

Bus

Software: OS

The operating system (OS) is loaded from secondary memory into main memory when the computer is turned on, and remains in memory until the computer is turned off.


Software os28 l.jpg
Software: OS systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

The OS acts as the “manager” of the system, making sure that each hardware device interacts smoothly with the others.

It also provides the interface by which the user interacts with the computer, and awaits user input if no application is running.

Examples: Windows 2000, Windows XP, Windows-NT, UNIX, Linux, Solaris, MacOS, ...


Software applications l.jpg
Software: Applications systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Applications are non-OS programs that perform some useful task, including word processors, spreadsheets, databases, web browsers, C++ compilers, ...

Example C++ compilers/environments:

  • CodeWarrior (MacOS, Win95, WinNT, Solaris)

  • GNU C++ (UNIX, Linux)

  • Turbo/Borland C++ (Win95, WinNT)

  • Visual C++ (Win95, WinNT)


Software user programs l.jpg
Software: User Programs systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Programs that are neither OS programs nor applications are called user programs.

User programs are what you’ll be writing in this course.


Putting it all together l.jpg

Disk systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

CPU

RAM

Cache

OS

App

Bus

Putting it all together

Programs and applications that are not running are stored on disk.


Putting it all together32 l.jpg

Disk systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

CPU

RAM

Cache

OS

OS

App

App

Bus

Putting it all together

When you launch a program, the OS controls the CPU and loads the program from disk to RAM.


Putting it all together33 l.jpg

Disk systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

CPU

RAM

Cache

OS

App

App

App

Bus

Putting it all together

The OS then relinquishes the CPU to the program, which begins to run.


The fetch execute cycle l.jpg
The Fetch-Execute Cycle systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

As the program runs, it repeatedly fetches the next instruction (from memory/cache), executes it, and stores any results back to memory.

Disk

CPU

RAM

Cache

OS

App

App

App

Bus

That’s all a computer does: fetch-execute-store, millions of times each second!


Programming l.jpg
Programming systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.


What is programming l.jpg
What is Programming? systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

A sequence of statements that instruct a computer in how to solve a problem is called a program.

The act of designing, writing and maintaining a program is called programming.

People who write programs are called programmers.


What kinds of statements do computers understand l.jpg
What kinds of statements systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++. do computers understand?

A computer only understands machine language statements.

A machine language statement is a sequence of ones and zeros that cause the computer to perform a particular action, such as add, subtract, multiply, ...


Machine language ml l.jpg
Machine Language (ML) systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

ML statements are stored in a computer’s memory, which is a sequence of switches.

For convenience of representation, an “on” switch is represented by 1, and an “off” switch is represented by 0.

ML thus appears to be binary (base-2):

0010111010110101


Early computers l.jpg
Early Computers systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

... required a programmer to write in ML...

  • Easy to make mistakes!

  • Such mistakes are hard to find!

  • Not portable -- only runs on one kind of machine!

    Programming was very difficult!


A bright idea l.jpg

Assembler systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

ADD

0010111010110101

A Bright Idea

Devise a set of abbreviations (mnemonics) corresponding to the ML statements, plus a program to translate them into ML.

The abbreviations are an assembly language, and the program is called an assembler.


Assembly languages l.jpg
Assembly Languages systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Allowed a programmer to use mnemonics, which were more natural than binary.

  • Much easier to read programs

  • Much easier to find and fix mistakes

  • Still not portable to different machines


High level languages l.jpg
High Level Languages systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

Devise a set of statements that are close to human language (if, while, do, ...), plus a program to translate them into ML.

The set of statements is called a high level language (HLL) and the program is called a compiler.


Hll compilers l.jpg

1010110011110101 systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

0000000000010000

0010111010110101

0000000000010010

0010111011111101

0000000000010100

Compiler

z = x + y;

HLL Compilers

Where an assembler translates one mnemonic into one ML statement, a HLL compiler translates one HLL statement into multiple ML statements.


Slide44 l.jpg
HLLs systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

High level languages (like C++) are

  • Much easier to read programs

  • Much easier to find and fix mistakes

  • Portable from one machine to another (so long as they keep to the language standard).


Objectives in programming l.jpg
Objectives in Programming systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

A program should solve a problem:

  • correctly (it actually solves the problem)

  • efficiently (without wasting time or space)

  • readably (understandable by another person)

  • in a user-friendly fashion (in a way that is easy for its user to use).


Summary l.jpg
Summary systems, information representation; and organization, with an overview of computer hardware and software, computing systems and major applications. Ethical and societal issues arc discussed. An introduction to high-level languages with an emphasis on writing programs in C++.

A computer has two kinds of components:

  • Hardware: its CPU, RAM, Disk(s), ...

  • Software, its OS, Applications, and User Programs.

    There are “levels” to computer languages:

  • ML consists of “low” level binary statements, that is hard to read, write, and not portable.

  • Assembly uses “medium” level mnemonics: easier to read/write, but not portable.

  • C++ is a “high” level language that is even easier to read/write, and portable.


ad