0% found this document useful (0 votes)
30 views21 pages

Intro To Computers

Intro about computers

Uploaded by

abadinasargie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views21 pages

Intro To Computers

Intro about computers

Uploaded by

abadinasargie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Chapter 1(Part 1)

Introduction to Computers
and C++ Programming

Created by David Mann, North Idaho College

Copyright © 2003 Pearson Education, Inc. Slide 1


Overview
 Computer Systems (1.1)

 Programming and Problem Solving (1.2)

 Introduction to C++ (1.3)

 Testing and Debugging (1.4)

Copyright © 2003 Pearson Education, Inc. Slide 2


1.1
Computer Systems
 A computer program is…
 A set of instructions for a computer to follow

 Computer software is …
 The collection of programs used by a computer
 Includes:
 Editors
 Translators
 System Managers

Copyright © 2003 Pearson Education, Inc. Slide 3


Hardware
 Three main classes of computers

 PCs (Personal Computer)


 Relatively small used by one person at a time

 Workstation
 Larger and more powerful than a PC

 Mainframe
 Still larger
 Requires support staff
 Shared by multiple users

Copyright © 2003 Pearson Education, Inc. Slide 4


Networks
 A number of computers connected to
share resources
 Share printers and other devices
 Share information

Copyright © 2003 Pearson Education, Inc. Slide 5


Computer Organization
 Five main components
 Input devices
 Allows communication to the computer
 Output devices
 Allows communication to the user
 Processor (CPU)

 Main memory
 Memory locations containing the running program
 Secondary memory
 Permanent record of data often on a disk Display 1.1

Copyright © 2003 Pearson Education, Inc. Slide 6


Computer Memory
 Main Memory
 Long list of memory locations
 Each contains zeros and ones
 Can change during program execution
 Binary Digit or Bit
 A digit that can only be zero or one
 Byte
 Each memory location has eight bits
 Address
 Number that identifies a memory location

Copyright © 2003 Pearson Education, Inc. Slide 7


Larger Data Items
 Some data is too large for a single byte
 Most integers and real numbers are too large

 Address refers to the first byte

 Next few consecutive bytes can store the additional


bits for larger data

Display 1.2

Copyright © 2003 Pearson Education, Inc. Slide 8


Data or Code?
 ‘A’ may look like 01000001
 65 may look like 01000001
 An instruction may look like 01000001

 How does the computer know the meaning


of 01000001?
 Interpretation depends on the current instruction

 Programmers rarely need to be concerned with


this problem.
 Reason as if memory locations contain letters and
numbers rather than zeroes and ones

Copyright © 2003 Pearson Education, Inc. Slide 9


Secondary Memory
 Main memory stores instructions and
data while a program is running.
 Secondary memory
 Stores instructions and data between sessions
 A file stores data or instructions in
secondary memory

Copyright © 2003 Pearson Education, Inc. Slide 10


Secondary Memory Media
 A computer might have any of these
types of secondary memory
 Hard disk
 Fast
 Fixed in the computer and not normally removed
 Floppy disk
 Slow
 Easily shared with other computers
 Compact disk
 Slower than hard disks
 Easily shared with other computers
 Can be read only or re-writable

Copyright © 2003 Pearson Education, Inc. Slide 11


Memory Access
 Random Access
 Usually called RAM
 Computer can directly access any memory location

 Sequential Access
 Data is generally found by searching through
other items first
 More common in secondary memory

Copyright © 2003 Pearson Education, Inc. Slide 12


The Processor
 Typically called the CPU
 Central Processing Unit
 Follows program instructions
 Typical capabilities of CPU include:

add
subtract
multiply
divide
move data from location to location

Copyright © 2003 Pearson Education, Inc. Slide 13


Computer Software
 The operating system
 Allows us to communicate with the computer
 Is a program
 Allocates the computer’s resources
 Responds to user requests to run other programs

 Common operating systems include…


 UNIX Linux DOS
Windows Macintosh VMS

Copyright © 2003 Pearson Education, Inc. Slide 14


Computer Input
 Computer input consists of
 A program

 Some data

Display 1.3

Copyright © 2003 Pearson Education, Inc. Slide 15


High-level Languages
 Common programming languages include …
C C++ Java Pascal Visual Basic FORTRAN
COBOL Lisp Scheme Ada

 These high – level languages


 Resemble human languages
 Are designed to be easy to read and write
 Use more complicated instructions than
the CPU can follow
 Must be translated to zeros and ones for the CPU
to execute a program

Copyright © 2003 Pearson Education, Inc. Slide 16


Low-level Languages
 An assembly language command such as

ADD X Y Z

might mean add the values found at x and y


in memory, and store the result in location z.

 Assembly language must be translated to


machine language (zeros and ones)
0110 1001 1010 1011
 The CPU can follow machine language

Copyright © 2003 Pearson Education, Inc. Slide 17


Compilers
 Translate high-level language to
machine language

 Source code
 the original program in a high level language
 Object code
 the translated version in machine language

Display 1.4

Copyright © 2003 Pearson Education, Inc. Slide 18


Linkers
 Some programs we use are already compiled
 Their object code is available for us to use
 For example: Input and output routines

 A Linker combines
 The object code for the programs we write
and
 The object code for the pre-compiled routines
into
The machine language program the CPU can run
Display 1.5
Copyright © 2003 Pearson Education, Inc. Slide 19
History Note
 First programmable computer
 Designed by Charles Babbage
 Began work in 1822
 Not completed in Babbage’s life time

 First programmer
 Ada Augusta, Countess of Lovelace
 Colleague of Babbage

Copyright © 2003 Pearson Education, Inc. Slide 20


Section 1.1 Conclusion
 Can you…
 List the five main components of a computer?

 List the data for a program that adds two numbers?

 Describe the work of a compiler?

 Define source code? Define object code?

 Describe the purpose of the operating system?

Copyright © 2003 Pearson Education, Inc. Slide 21

You might also like