A computer system consists of hardware and software.
Hardware is the equipments used to perform the necessary computations.
Software consists of programs that control the hardware to process data.
Memory is the place where the programs and data are stored. It can be imagined as an ordered sequence of storage locations called memory cells. Each cell has a unique address, which is like a serial number of the cell in the memory.
The data stored in a memory cell are called the contents of the cell. Program is treated as a special type of data.
A memory cell contains a sequence of binary digit, or bit. Each bit is either a 0 or a 1. All kinds of data are eventually represented by sequences of bits.
A sequence of 8 bits is usually called a byte, which can represent a character, such as the ones on a keyboard.
The terms used to quantify storage capacities:
1 byte (B) is 8 bits 1 kilobyte (KB) is 1024 bytes, i.e., 210 bytes 1 megabyte (MB) is 1024 kilobytes, i.e., 220 bytes 1 gigabyte (GB) is 1024 megabytes, i.e., 230 bytes 1 terabyte (TB) is 1024 gigabytes, i.e., 240 bytes
To store a value into a certain address means to give it a new content (so the previous one is gone). To retrieve a value from a memory cell means to copy the content to another place without destroying it. These two operations are also called write and read, respectively.
In a computer, there are several types of memory. There is a distinction between main memory and secondary memory --- the former is faster and smaller, while the latter is cheaper, and often removable. At the current time, the former is usually in silicon chips, while the latter in hard disks, flash drives, CD/DVDs and so on.
There are two types of main memory: RAM (random access memory) and ROM (read-only memory). Their major difference is that the content of RAM can be modified. In the following, "main memory" means RAM.
In a computer, most of the operations are performed by a CPU (central processing unit), and there are computers with multiple CPUs. At the current time, a CPU is in a single integrated circuit (IC), or call it a chip.
The CPU follows the instructions contained in a program (written in a computer-understandable language). In each step, the CPU fetches (i.e., retrieves) an instruction, interprets its content to decide what to do, and then do it, which may mean to move data from one place to another, or change data in a certain way. Other common operations include addition, subtraction, multiplication, division, comparison, and so on.
CPU usually executes instructions one after another, but can also jump to another memory cell according to an instruction.
A computer uses its input/output (I/O) devices to communicate with human users and other computers.
For a human user, the usual input device is a keyboard and a mouse, and the usual output device is a monitor (display screen), and a printer. The human-computer interaction (HCI) can either happen in a command-line user interface, or a graphical user interface (GUI).
A computer network carries out communications among computer systems. There are different types of networks: local area network (LAN) and wide area network (WAN). The Internet connects computers all over the world, which supports the World Wide Web (WWW), among many of its usages.
To connect to another computer, a computer needs a modem (modulator/demodulator), or some other network device, to translate between its internal language and the language used in the network communication. The communications can go through all kinds of cables, or wireless.
Every software is eventually executed by the CPU, in a machine language, in which each line in a program is an instruction to the hardware. Since programs in this language are not easily understandable by a human user, the same program is usually also described in other, more human-readable languages.
One type of them is assembly language, in which the instructions are represented by symbols and numbers.
Another type of language are more human-oriented, called "high-level languages", which are closer to mathematical languages and natural languages (such as English), as well as machine-independent.
Typical examples of high-level language include FORTRAN, ALGOL, COBOL, BASIC, Pascal, LISP, Prolog, Perl, C, C++, and Java.
The translation from high-level languages and assembly languages into machine languages is accomplished by special programs: compilers, interpreters, and assemblers. A compiler translates a source program in a high-level language into an object program in the machine language. An interpreter interprets and executes a program in a high-level language line by line. An assembler translates a source program in an assembly language into an object program in the machine language.
A high-level language usually comes with many ready-made common programs, so the user can include them in programs, rather than rewrite them. The program responsible for this is called a "linker". It links user object programs and related "library programs", and produces executable programs.
There are software packages called "integrated development environment" (IDE) which organize all the related software (e.g., editor, compiler, linker, loader, debugger) together to support the development of a software.
When a program in machine language runs, it typically gets some input data from the memory, process them according to the predetermined procedure, then store some output data into the memory, and display some information to the user.
In a computer, there is a software product that occupies a special position: the operating system (OS). Most of other software products are application software, which are managed and supported by the OS.When a computer is turned on, it starts by executing part of the OS that is stored in a ROM, which then loads the rest of the OS from hard disk and starts it. This process is called "booting".
When running, an OS has the following main responsibility:
At the current time, the most often used OS include Unix/Linux, Microsoft Windows, and Macintosh OS. It is possible for a computer to have more than one OS stored in its memory, but usually only one can be used at a time.
An application software uses the computer to accomplish a specific task. They are usually purchased on CD or DVD, or downloaded from the Internet, and installed into the computer (so it is stored in memory and known to the OS), before they can be used in the computer.