Java Reference
In-Depth Information
into a predetermined string of bits. In the popular ASCII encoding scheme, for example, the
character C is represented as 01000011 in one byte.
A computer's storage capacity is measured in bytes and multiples of the byte, as follows:
A kilobyte (KB) is about 1,000 bytes.
kilobyte (KB)
A megabyte (MB) is about 1 million bytes.
megabyte (MB)
A gigabyte (GB) is about 1 billion bytes.
gigabyte (GB)
A terabyte (TB) is about 1 trillion bytes.
terabyte (TB)
A typical one-page word document might take 20 KB. Therefore, 1 MB can store 50 pages
of documents and 1 GB can store 50,000 pages of documents. A typical two-hour high-
resolution movie might take 8 GB, so it would require 160 GB to store 20 movies.
1.2.3 Memory
A computer's memory consists of an ordered sequence of bytes for storing programs as well as
data that the program is working with. You can think of memory as the computer's work area
for executing a program. A program and its data must be moved into the computer's memory
before they can be executed by the CPU.
Every byte in the memory has a unique address , as shown in Figure 1.2. The address is
used to locate the byte for storing and retrieving the data. Since the bytes in the memory can
be accessed in any order, the memory is also referred to as random-access memory (RAM) .
memory
unique address
RAM
Memory address
Memory content
2000
2001
2002
2003
2004
01000011
01110010
01100101
01110111
00000011
Encoding for character 'C'
Encoding for character 'r'
Encoding for character 'e'
Encoding for character 'w'
Encoding for number 3
F IGURE 1.2
Memory stores data and program instructions in uniquely addressed memory
locations.
Today's personal computers usually have at least 4 gigabyte of RAM, but they more com-
monly have 6 to 8 GB installed. Generally speaking, the more RAM a computer has, the faster
it can operate, but there are limits to this simple rule of thumb.
A memory byte is never empty, but its initial content may be meaningless to your program.
The current content of a memory byte is lost whenever new information is placed in it.
Like the CPU, memory is built on silicon semiconductor chips that have millions of transis-
tors embedded on their surface. Compared to CPU chips, memory chips are less complicated,
slower, and less expensive.
1.2.4 Storage Devices
A computer's memory (RAM) is a volatile form of data storage: any information that has
been stored in memory (i.e., saved) is lost when the system's power is turned off. Programs
and data are permanently stored on storage devices and are moved, when the computer
storage devices
 
Search WWH ::




Custom Search