12 May 2012

Memory


Memory consists of electronic components that store instructions waiting to be executed by the processor, data needed by those instructions, and the results of processing the data (information). Memory usually consists of one or more chips on the motherboard or some other circuit board in the computer.
 Memory stores three basic categories of items: (1)the operating system and other system software that control or maintain the computer and its devices; (2) application programs that carry out a specific task such as word processing; and (3) the data being processed by the application programs and resulting information. This role of memory to store both data and programs is known as the stored program concept.

Bytes and Addressable Memory
 A byte (character) is the basic storage unit in memory. When application program instructions and data are transferred to memory from storage devices, the instructions and data exist as bytes. Each byte resides temporarily in a location in memory that has an address. An address simply is a unique number that identifies the location of a byte in memory. To access data or instructions in memory, the computer references the addresses that contain bytes of data.

Memory Sizes
 Manufacturers state the size of memory and storage devices in terms of the number of bytes the chip or device has available for storage. Recall that storage devices hold data, instructions, and formation for future use, while most memory holds these items temporarily. A kilobyte (KB or K) is equal to exactly 1,024 bytes. To simplify memory and storage definitions, computer users often round a kilobyte down to 1,000 bytes. For example, if a memory chip can store 100 KB, it can hold approximately 100,000 bytes (characters). A megabyte (MB) is equal to approximately 1 million bytes. A gigabyte (GB) equals approximately 1 billion bytes. A terabyte (TB) is equal to approximately 1 trillion bytes.

Types of Memory
 The system unit contains two types of memory: volatile and nonvolatile. When the computer's power is turned off, volatile memory loses its contents. Nonvolatile memory, by contrast, does not lose its contents when power is removed from the computer. Thus, volatile memory is temporary and nonvolatile memory is permanent. RAM is the most common type of volatile memory. Examples of nonvolatile memory include ROM, flash memory, and CMOS. The following sections discuss these types of memory.

RAM
 Users typically are referring to RAM when discussing computer memory. RAM (random access memory), also called main memory, consists of memory chips that can be read from and written to by the processor and other devices. When you turn on power tro a computer, certain operating system files (such as the files that determine how the desktop appears) load into RAM from a storage device such as a hard disk. These files remain ion RAM as long as the computer has continuous power. As additional programs and data are requested, they also load into RAM from storage.
 The processor interprets and executes a program's instructions while the program is in RAM. During this time, the contents of RAM may change. RAM can accommodate multiple programs simultaneously.
 Most RAM is volatile, which means it loses its contents when the power is removed from the computer. For this reason, you must save any data, instructions, and information you may need in the future. Saving is the process of copying data, instructions, and information from RAM to a storage device such as a hard disk.
 Three basic types of Ram chips exist: dynamic RAM, static RAM, and magnetoresistive RAM.
  • Dynamic RAM (DRAM pronounced DEE-ram) chips must be re-energized constantly or they lose their contents. Many variations of DRAM chips exist, most of which are faster than the basic DRAM. Most personal computers today use some form of SDRAM chips or RDRAM chips.
  • Static RAM (SRAM pronounced ESS-ram) chips are faster and more reliable than any variation of DRAM chips. These chips do not have to be re-energized as often as DRAM chips, thus the term static. SRAM chips, however, are much more expensive than DRAM chips. Special applications such as cache use SRAM chips. A later section in this chapter discusses cache.
  • A newer type of RAM, called magnetoresistive RAM (MRAM pronounced EM-ram), stores data using magnetic charges instead of electrical charges. Manufacturers claim that MRAM has greater storage capacity, consumes less power, and has faster access times than electronic RAM. Also, MRAM retains its contents after power is removed from the computer, which could prevent loss of data for users. As the cost of MRAM declines, experts predict MRAM could replace both DRAM and SRAM.
 Ram chips usually reside on a memory module, which is a small circuit board. Memory slots on the motherboard hold memory modules. Three types of memory modules are SIMMs, DIMMs, and RIMMs. A SIMM (single inline memory module) has pins on oppositesides of the circuit board that connect together to form a single set of contacts. With a DIMM (dual inline memory module), by contrast, the pins on opposite sides of the circuit board do not connect and thus form two sets of contacts. SIMMs and DIMMs typically hold SDRAM chips. A RIMM (Rambus inline memory module) houses RDRAM chips.

RAM Configurations  The amount of RAM necessary in a computer often depends on the types of software you plan to use. A computer executes programs that are in RAM. Think of RAM as the workplace on the top of your desk. Just as the top of your desk needs a certain amount of space to hold papers, a computer needs a certain amount of memory to store programs, data, and information. The more RAM a computer has, the faster the computer will respond.
 Retail software typically indicates the minimum amount of RAM it requires. If you want the software to perform optimally, usually you need more than the minimum specifications for the software.

Cache
 Most of today's computers improve their processing times with cache (pronounced cash). Two types of cache are memory cache and disk cache.
 Memory cache helps speed the processes of the computer because it stores frequently used instructions and data. Most personal computers today have two types of memory cache: L1 cache and L2 cache. Some also have L3 cache.
  • L1 cache is built directly in the processor chip. L1 cache usually has a very small capacity, ranging from 8 KB to 128 KB. The more common sizes for personal computers are 32 KB or 64 KB.
  • L2 cache is slightly slower than L1 cache but has a much larger capacity, ranging from 64 KB to 16 MB. When discussing cache, most users are referring to L2 cache. Current processors include advanced transfer cache (ATC), a type of L2 cache built directly on the processor chip.
  • L3 cache is a cache on the motherboard that is separate from the processor chip. L3 cache exists only on computers that L2 advanced transfer cache. Personal computers often have up to 8 MB of L3 cache; servers and workstations have from 8 MB to 24 MB of L3 cache.
 Cache speeds up processing time because it stores frequently used instructions and data. When the processor needs an instruction or data, it searches memory in this order: L1 cache, then L2 cache, then L3 cache (if it exits), then RAM – with a greater delay in processing for each level of memory it must search. If the instruction or data is not found in memory, then it must search a slower speed storage medium such as a hard disk or optical disc.
 Windows users can increase the size of cache through Windows Ready Boost, which can allocate available storage space on removable flash memory devices as additional cache. Examples of removable flash memory include USB flash drives, CompactFlash cards, and SD (Secure Digital) cards.

ROM
 Read-only memory (ROM) refers to memory chips storing permanent data and instructions. The data on most ROM chips cannot be modified – hence, the name read-only. ROM is nonvolatile, which means its contents are not lost when power is removed from the computer. In addition to computers, many devices contain ROM chips. For example, ROM chips in printers contain data for for fonts.
 Manufacturers of ROM chips often record data, instructions, or information on the chips when they manufacture the chips. These ROM chips, called firmware, contain permanently written data, instructions, or information.
 A PROM (programmable read-only memory) chip is a blank ROM chip on which a programmer can write permanently. Programmers use microcode instructions to program a PROM chip. Once a programmer writes the microcode on the PROM chip, it functions like a regular ROM chip and cannot be erased or changed.
 A variation of the PROM chip, called an EEPROM (electrically erasable programmable read-only memory) chip, allows a programmer to erase the microcode with an electric signal.

Flash Memory
 Flash memory is a type of nonvolitale memory that can be erased electronically and rewritten, similar to EEPROM. Most computers use flash memory to hold their startup intructions because it allows the computer easily to update its contents. For example, when the computer changes from standard time to daylight savings time, the contents of a flash memory chip (and the real-time clock chip) change to reflect the new time.
 Flash memory chips also store data and programs on many mobile computers and devices, such as smart phones, portable media players, PDAs, printers, digital cameras, automotive devices, digital voice recorders, and pagers.
 When you enter names and addresses in a smart phone or PDA, a flash memory chip stores the data. Some portable media players store music on flash memory chips; others store music on tiny hard disks or flash memory cards. Flash memory cards contain flash memory on a removable device instead of a chip.

CMOS
 Some RAM chips, flash memory chips, and other memory chips use complementary metal-oxide semiconductor (CMOS pronounced SEE-moss) technology because it provides high speeds and consumes little power. CMOS technology uses battery power to retain information even when the power to the computer is off. Battery-backed CMOS memory chips, for example, can keep the calendar, date, and time current even when the computer is off. The flash memory chips that store a computer's startup information often use CMOS technology.

Memory Access Times
 Access time is the amount of time it takes the processor to read data, instructions, and information from memory. A computer's access time directly affects how fast the computer process data. Accessing data in memory can be more than 200,000 times faster than accessing data on a hard disk because of the mechanical motion of the hard disk.
 Today's manufacturers use a variety of terminology to state access times. Some use fractions of a second which for memory occurs in nanoseconds. A nanosecond (abbreviated ns) is one billionth of a second. A nanosecond is extremely fast. In fact, electricity travels about one foot in a nanosecond.
 Other manufacturers state access time in MHz; for example, 800 MHz DDR2 SDRAM. If a manufacturer states access time in megahertz, you can convert it to nanoseconds by dividing 1 billion ns by the megahertz number. For example, 800 MHz equals approximately 1.25 ns (1,000,000,000/800,000,000).
 The access time (speed) of memory contributes to the overall performance of the computer. Standard SDRAM chips can have access times up to 133 MHz (about 7.5 ns), and access times of DDR SDRAM chips reach 266 MHz, DDR2 chips reach 800 MHz, and DDR3 chips reach 1600 MHz. The higher the megahertz, the faster the access time; conversely, the lower the nanoseconds, the faster the access time. The faster RDRAM chips can have access times up to 1600 MHz (about 0.625 ns). ROM access times range from 25 to 250 ns.
 While access times of memory greatly affect overall computer performance, manufacturers and retailers usually list a computer's memory in terms of its size, not its access time. Thus, an advertisement might describe a computer as having 2 GB of SDRAM upgraded to 4 GB.

05 May 2012

Data Representation


To understand how a computer process data, you should know how a computer represents data, you should know how a computer represents data. People communicate through speech by combining words into sentences. Human speech is analog because it uses continuous (wave form) signals that vary in strength and quality. Most computers are digital. They recognize only two discrete states: on and off. This is because computers are electronic devices powered by electricity, which also has only two states: on and off.
 The two digit, 0 and 1, easily can represent these two states. The digit 0 represents the electronic state of off (absence of an electronic charge). The digit 1 represents the electronic state of on (presence of an electronic charge).
 When people count, they use the digits in the decimal system (0 through 9). the computer, by contrast, uses a binary system because it recognizes only two states. The binary system is a number system that has just two unique digits, 0 and 1, called bits. A bit (short for binary digit) is the smallest unit of data the computer can process. By itself, a bit is not very informative.
 When 8 bits are grouped together as a unit, they form a byte. A byte provides enough different combinations of 0s and 1s to represent 256 individual characters. These characters include numbers, uppercase and lowercase letters of the alphabet, punctuation marks, and others, such as the letters of the Greek alphabet.
 The combinations of 0s and 1s that represent characters are defined by patterns called a coding scheme. In one coding scheme, the number 4 is represented as 00110100, the number 6 as 00110110, and the capital letter E as 01000101. ASCII which stands for American Standard Code for Information Interchange is the most widely used coding scheme to represent data.
 The ASCII coding scheme is sufficient for English and Western European languages but is not large enough for Asian and other languages that use different alphabets. Unicode is a 16-bit coding scheme that has the capacity of representing more than 65,000 characters and symbols. The Unicode coding scheme is capable of representing almost all the world's current written languages, as well as classic and historical languages. To allow for expansion, Unicode reserves 30,000 codes for future use and 6,000 codes for private use. Unicode is implemented in several operating systems, including Windows, Mac Os, and Linux. Unicode-enabled programming languages and software include Java, XML, Microsoft Office, and Oracle.
 Coding schemes make it possible for humans to interact with a digital computer that processes only bit. When you press a key on a keyboard, a chip in the keyboard converts the key's electronic signal into a special code that is sent to the system unit. Then, the system unit converts the code into a binary form the computer can process and store it in memory. Every character is converted to its corresponding byte. The computer then processes the data as bytes, which actually is a series of on/off electrical states. When processing is finished, software converts the byte into a human-recognizable number, letter of the alphabet, or special character that is displayed on a screen or is printed. All of these conversions take place so quickly that you do not realize they are occurring.
 Standards, such as those defined by ASCII and Unicode, also make it possible for components in computers to communicate with each other successfully. By following these and other standards, manufacturers can produce a component and be assured that it will operate correctly in a computer.