Download as ppsx, pdf, or txt
Download as ppsx, pdf, or txt
You are on page 1of 31

LESSON 1

INTRODUCTION TO
COMPUTERS
AND PROGRAMMING
TOPICS

1.1 Computer Systems: Hardware and Software


1.2 Programs and Programming Languages
1.3 History of C++
1.4 Program Structure and Elements
1.5 Input, Processing, and Output
1.6 Program Development Process
Hardware
Physical components of a computer
Main Hardware Component Categories
1. Central Processing Unit
(CPU)
2. Main memory (RAM)
3. Secondary storage
devices (such as disks Figure 1.1. Main Hardware
Component Categories

and CDs)
Main Hardware Component Categories
4. Input Devices (such as the
mouse and keyboard)
5. Output Devices (such as
monitors and printers)
6. Communication devices (such
Figure 1.1. Main Hardware
as modems and network Component Categories

interface cards)
A subsystem interconnects a
computer’s components called a
bus (depicted in figure 1.2). Think
of a bus as a system of roads
running among the computer’s Figure 1.2. The Motherboard

components; data and power


travel along the bus from one part
of the computer to another.
In personal computers, the bus is
built into the computer’s
motherboard, which is a circuit
case that connects the parts of a
computer, as shown in Figure 1.2. Figure 1.2. The Motherboard
Main components of the CPU
Control Unit
Retrieves and decodes
program instructions
Figure 1.3. Parts of CPU

Coordinates computer
operations
Main components of the CPU
Arithmetic & Logic Unit
(ALU)
Performs mathematical
operations (addition, subtraction, Figure 1.3. Parts of CPU

multiplication, and division) and


logical operations (comparisons).
A program is a sequence of instructions
stored in the computer’s memory. When a
computer is running an application, the
CPU is engaged in a process known
formally as the fetch/decode/execute cycle. The
steps in the fetch/decode/execute cycle are
as follows:
FETCH

The CPU’s control unit fetches, from main


memory, the next instruction in the
sequence of program instructions. (get the
next program instruction from main
memory).
DECODE

The instruction is encoded in the form of a


number. The control unit decodes the
instruction and generates an electronic
signal. (interpret the instruction and
generate a signal).
EXECUTE
The signal is routed to the appropriate
component of the computer (such as the
ALU, a disk drive, or some other device).
The signal causes the component to operate.
(route the signal to the appropriate
component to operate).
These steps are repeated as long as there are
instructions to perform.
Main Memory
– A computer’s memory consists of an
ordered sequence of bytes for storing
programs as well as data that the program.
Main Memory
– Holds both program instructions and data

– Volatile – erased when the program


terminates or computer is turned off
Main Memory
Also called Random Access Memory
(RAM), because the CPU can access data
and instructions from any memory location.
Main Memory
Every byte in the memory has a
unique address, as shown in
Figure 1.4. The address is used
to locate the byte for storing Figure 1.4. Memory

and retrieving the data.


Main Memory Organization
Bit
o The smallest piece of o Hold an electrical
memory charge
o Stands for binary digit • A positive charge is
“on”
• A negative charge is
“off”
Main Memory Organization
Byte
o 8 consecutive bits
o Has an address in memory
o There are millions (or even billions) of bytes of
memory in a computer
Secondary Storage
o Holds data when the program is not running or when the
computer is turned off
o Several forms of secondary storage
• Disk drive: can be mounted inside the computer or
connected to an external port. Data is stored magnetically
• optical: CD or DVD drive
• flash: USB flash drive
Input Devices
o Used to send information to the computer from
outside
o Many devices can provide input, such as a
keyboard, mouse, touch screen, microphone,
scanner, digital camera, disk drive, CD/DVD
drive, and USB flash drive.
Output Devices
o Used to send information from the computer to
the outside
o Many devices can be used for output, such as
Computer screen, printer, speakers, disk drive,
CD/DVD recorder, and USB flash drive.
SOFTWARE
System software
o programs that manage the computer hardware
and the applications that run on the computer
System software
o Operating Systems
• Controls the operation of the computer
• Manages connected devices and access to storage
devices
• Allows programs to run
System software
o Software development tools
• Used by programmers to create software
• Examples: compilers, integrated development
environments (IDEs)
Application software
o Programs that make a computer useful for
everyday tasks
o These are the programs that people usually spend
most of their time running on their computers.
Application software
o Some examples of application software are
Microsoft Word, a word processing program,
Microsoft PowerPoint, a presentation program,
spreadsheet programs, e-mail programs, Web
browsers, and game programs.
QUIZ TIME

You might also like