Java Reference
In-Depth Information
Chapter 3
How Computers Store Information
Storing Text and Numbers
A program's work consists mostly of storing, manipulating, and processing
computer data. In this chapter we look at how this data is stored in a com-
puter system. To a beginner, some of the topics could be intimidating. Bi-
nary and hexadecimal numbers sometimes appear to be a profound and
arcane mystery that can only be understood by the gurus of computing.
Nothing could be further from the truth. As you will see, binary and hex
numbers are used in computers because they are more reasonable and eas-
ier to apply than conventional decimal numbers. Furthermore, you cannot
be a programmer without a working knowledge of the number systems
used by computers. A related topic is how text and numbers are encoded so
that they can be stored in a computer, and how these data storage codes are
used in Java programming.
Number Systems
A number system is a collection of rules and symbols that we use for count-
ing and doing arithmetic. The Hindu-Arabic or decimal system has gained
worldwide acceptance. We are all familiar with the symbols:
0123456789
It has often been said that the decimal system of numbers resulted
from the practice of counting with our fingers, and that if humans had six
fingers instead, our number system would have six symbols.
The first and most important use of a system of numbers is in counting.
The simplest form of counting is called tallying . We all occasionally re-
sort to the tally system by drawing a vertical line for each object we wish
Search WWH ::




Custom Search