Preview

C Programming Note (Chapter 1)

Powerful Essays
Open Document
Open Document
2577 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
C Programming Note (Chapter 1)
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

You May Also Find These Documents Helpful