Professional Documents
Culture Documents
• Hardware
• Software
Hardware
• CPU
• Main memory: RAM
• Input/output devices
• Secondary storage
CPU
• The central processing unit is the ‘‘brain’’ of the computer .
• The more powerful the CPU, the faster the computer .
• Arithmetic and logical operations are carried out inside the CPU.
Main Memory
• Directly connected to the CPU
• All programs must be loaded into main memory before they can be
executed
• All data must be brought into main memory before it can be
manipulated
• When computer power is turned off, everything in main memory is
lost
Main Memory (continued)
• Main memory is an ordered sequence of cells, called memory cells.
• Each cell has a unique location in main memory, called the address
of the cell.
• These addresses help you access the information stored in the cell.
Secondary Storage
• Secondary storage: device that stores information permanently
• Examples of secondary storage:
Hard disks
Flash drives
Floppy disks
Solid state drives
CD-ROMs
Tapes
Input/Output Devices
• Input devices feed data and programs into computers; they include:
❑ Keyboard
❑ Mouse
❑ Scanner
• Output devices display results; they include:
❑ Monitor
❑ Printer
❑ speaker
Software
• Software: programs that do specific tasks
Sample Run:
My first C++ program.
The sum of 2 and 3 = 5
7 + 8 = 15
Processing a Program
• To execute a C++ program:
1. Use an editor to create a source program in C++
2. Preprocessor directives begin with # and are processed by the
preprocessor
3. Use the compiler to :
✓ Check that the program obeys the rules
✓ Translate into machine language (object program)
Processing a Program
• To execute a C++ program (continued):
4. Linker:
✓ Combines object program with other programs provided by the SDK to create executable
code
5. Loader:
✓ Loads executable program into main memory
6. The last step is to execute the program