Java Reference
In-Depth Information
Hi, H e ath e r.
72
105
44
32
72
101
97
116
104
101
114
46
FIGURE 1.5
Text is stored by mapping each character to a number
Sampling is only one way to digitize information. For example, a sentence of
text is stored on a computer as a series of numbers, where each number represents
a single character in the sentence. Every letter, digit, and punctuation symbol has
been assigned a number. Even the space character is assigned a number. Consider
the following sentence:
Hi, Heather.
The characters of the sentence are represented as a series of 12 numbers, as
shown in Figure 1.5. When a character is repeated, such as the uppercase 'H' , the
same representation number is used. Note that the uppercase version of a letter is
stored as a different number from the lowercase version, such as the 'H' and 'h'
in the word Heather. They are considered separate and distinct characters.
Modern electronic computers are digital. Every kind of information, including
text, images, numbers, audio, video, and even program instructions is broken into
pieces. Each piece is represented as a number. The information is stored by storing
those numbers.
Binary Numbers
A digital computer stores information as numbers, but those numbers are not stored
as decimal values. All information in a computer is stored and managed as binary
values. Unlike the decimal system, which has 10 digits (0 through 9), the binary
number system has only two digits (0 and 1). A single binary digit is called a
bit.
All number systems work according to the same rules. The base value of a
number system dictates how many digits we have to work with and indicates the
place value of each digit in a number. The decimal number system
is base 10, whereas the binary number system is base 2. Appendix B
contains a detailed discussion of number systems.
Modern computers use binary numbers because the devices that
store and move information are less expensive and more reliable if
they have to represent only one of two possible values. Other than
this characteristic, there is nothing special about the binary number
KEY CONCEPT
Binary is used to store and move
information in a computer because
the devices that store and manipu-
late binary data are inexpensive and
reliable.
 
Search WWH ::




Custom Search