Previous: 1.1 Computer System Organization
Up: 1 Introduction
Next: 1.3 Designing Programs and the C Language
Previous Page: 1.1.4 User Programs and Applications
Next Page: 1.2.1 Representing Data
In a computer, it is the hardware discussed in the previous section that stores data items and programs and that performs operations on these items. This hardware is implemented using electronic circuits called gates which, because we are talking about digital computers, represent information using only two values: True and False. In most machines, these two values are represented by two different voltages with in the circuit; for example 0 Volts representing a False value, and +5 Volts representing a True value. One such value is called a binary digit or bit and each such bit can be considered to be a symbol for a piece of information. However, in computer applications we need to represent information that can have more than just two values, i.e. we have more than 2 symbols. So bits are grouped together and the pattern of values on the group is used to represent a symbol. For example, a group of 8 bits, called a byte can have 256 different patterns (we will see how below) and therefore represent 256 different symbols. In modern computers, groupings of bytes (usually 2 or 4), called words can represent larger ``chunks'' of information.
Simply representing symbols in a computer, however, is not sufficient. We also need to process the information, i.e. perform operations on it. The designers of the hardware make use of an algebra, called Boolean Algebra, which uses two values, 0 and 1, and logical operations (AND, OR and NOT) to design the circuits that perform more complex operations on bytes and words of data. These complex operations are the instruction set of the computer and are the basic tools the programmer has to write software for the computer. All executable programs must be sequences of instructions from this set which includes basic arithmetic, logical, store and retrieve, and program control instructions. The instructions themselves can also be represented in the machine as patterns of bits.
This section first discusses how different types of data are represented using patterns of bits, then describes how data, as well as instructions, are stored in memory, and finally gives a short example of how instructions are represented.