C Programming Note (Chapter 1)

Only available on StudyMode
  • Download(s) : 77
  • Published : December 14, 2012
Open Document
Text Preview
Learning Objectives:
1. Describe the major components of a computer system and how they work together to solve problems and manipulate data. 2. Define the major categories of software and the kinds of languages in which they are implemented. 3. Explain the process of writing, compiling, and executing high-level language programs 4. Introduce C programming language

1. Introduction

A computer is a system made of 2 major components:

2. Computer Software

Computer hardware consists of the following components:
• Input devices (keyboards, mouse, scanner, etc.)
• Output devices (monitors, printers, and speakers)
• Storage devices (hard disks, floppy disks, etc.)

• Central processing unit
The central processing unit (CPU) has two roles: coordinating computer operations and performing arithmetic and logical operations on data.

• Memory (RAM & ROM)

Imagine the memory of a computer is an ordered sequence of storage locations called memory cells. To store and access these memory cells, the computer must have some ways of identifying each memory cell. Therefore each memory cell has a unique address that indicates its relative position in memory.

Figure 1.4 shows a computer memory consisting of 1000 memory cells with addresses 0 through 999. Most computers however have millions of individual memory cells, each with its own address.

The contents of a memory cell are either a program instruction or data.

• Example of data: the contents of memory cell 3 are the number -26 and the contents of memory cell 4 are the letter H.

• A program’s instructions must be stored in main memory before they can be executed.

A memory cell is actually a grouping of smaller units called bytes. The number of bytes required to form a memory varies from computer to computer.

A byte is composed of even smaller units called bits.

A bit (or binary digit) is the smallest element a computer can deal with. It refers to a number system based on two digits, 0 and 1.

Generally there are eight bits in one byte.

Figure 1.6 below illustrates the flow of information during the execution of a program

Review Question

1. List all components of computer hardware.

2. Fill in the blanks in the sentence below:
Imagine the memory of a computer is an ordered sequence of storage locations called ___________.

Each memory cell has a unique ___________ that indicates its relative position in memory.

3. Identify the contents of a memory cell

4. Where are program instructions stored before they can be executed?

3. Computer Software

• System software
• System software consists of programs that manage the hardware resources of a computer and perform required information processing tasks. • Divided into 3 classes:
▪ Operating System
o The software that controls interaction of the user and the computer hardware. o Responsible for directing all computer operations and managing computer resources. o Provides services such as a user interface, file and database access, and interfaces to communication systems such as Internet protocols ▪ System Support Software

o Provides system utilities and other operating services. o Example: sort programs, disk format programs, security monitors. ▪ System Development Software

o Includes language translators that convert programs into machine language for execution, debugging tools to ensure that the programs are error-free, and computer-assisted software engineering (CASE) systems.

• Application Software
Application software is divided into 2 classes:...
tracking img