CHAPTER 3 — Computer Memory


Download CHAPTER 3 — Computer Memory


Preview text

revised: 01/18/99, 01/16/00, 01/09/06, 08/22/08
CHAPTER 3 — Computer Memory
Recall from chapter one that the major hardware components of a computer system are:
q Processor q Main memory q Secondary memory devices q Input/output devices This chapter looks at main and secondary memory. Chapter Topics: q Bits and Bytes q Kilobytes, megabytes, gigabytes q Main memory and addresses q Secondary memory q Files
QUESTION 1:
(Educated Guess: ) If you bought a new computer, about how much main memory would you expect it to have: 256 bytes, 256 kilobytes, or 256 megabytes?

Answer:
A new PC should have at least 256 megabytes, and more if possible. Topend PCs have several gigabytes of main memory.

Characteristics of Computer Memory
Main memory is as vital as the processor chip to a computer system. Fast computer systems have both a fast processor and a large, fast memory. Here is a list of some characteristics of computer memory. Some characteristics are true for both kinds of memory; others are true for just one.

Characteristic

True for

True for

Main Memory Secondary Memory

Very closely connected to the

processor.

?

?

Holds programs and data that the

processor is actively working with.

?

?

Used for long term storage.

?

?

The processor interacts with it

millions of times per second.

?

?

The contents is easily changed.

?

?

Relatively low capacity.

?

?

Relatively huge capacity.

?

?

Fast access.

?

?

Slow access.

?

?

Connected to main memory.

-

?

Holds programs and data.

?

?

Usually its contents are organized

into files.

?

?

QUESTION 2:
What do you remember about computer memory? In the table, decide what is true for main memory and for secondary memory. (Click on the buttons to see if you are correct.)

Answer:
Click!
Bit
In both main and secondary memory, information is stored as patterns of bits. Recall from chapter two what a bit is:
A bit is a single on/off value. Only these two values are possible.
The two values may go by different names, such as true/false, or 1/0. There are many ways in which a bit can be implemented. For example a bit could be implemented as:
q A mechanical electrical switch (like a light switch.) q Voltage on a wire. q A single transistor (used in main memory). q A tiny part of the surface of a magnetic disk. q A tiny part of the surface of a magnetic tape. q A hole punched in a card. q A tiny part of the light-reflecting surface of a CD. q Part of a radio signal. q Many, many more ways
So the particular implementation of bits is different in main memory and secondary memory, but logically, both types of memory store bits.
QUESTION 3:

Answer:
No. The different ways of storing a bit do not change the information that is being stored.
Copied Information
Information stored in binary form does not change when it is copied from one medium (storage method) to another. And an unlimited number of such copies can be made (remember the advantages of binary.) This is a very powerful combination. You may be so accustomed to this that it seems commonplace. But when you (say) download an image from the Internet, the data has been copied many dozens of times, using a variety of storage and transmission methods.
It is likely, for example, that the data starts out on magnetic disk and is then copied to main storage of the web site's computer (involving a voltage signal in between.) From main storage it is copied (again with a voltage signal in between) to a network interface card, which temporarily holds it in many transistors. From there it is sent as an electrical signal down a cable. Along the route to your computer, there may be dozens of computers that transform data from an electical signal, into main memory transistor form, then back to an electrical signal on another cable. Your data may even be transformed into a radio signal, sent to a satellite (with its own computers), and sent back to earth as another radio signal. Eventually the data ends up as data in your video card (transistors), which transforms it into a TV signal for your monitor.
The point of all of this is that the actual information (in this example the picture) does not change from one medium to the next.
QUESTION 4:

Answer:
Usually we don't want it to (and for audio data use "high fidelity" electronics to minimize the change.) But always some information is lost.

Byte

One bit of information is so little that usually computer memory is organized into groups of eight bits. Each eight bit group is called a byte. When more than eight bits are required for some data, a whole number of bytes are used. One byte is about enough memory to hold a single character.

Name byte kilobyte megabyte gigabyte terabyte

Number of Bytes 1 1024 1,048,576 1,073,741,824 1,099,511,627,776

power of 2 20 210 220 230 240

Often very much more than eight bits are required for data, and thousands, millions, or even billions of bytes are needed. These amounts have names, as seen in the table.

If you expect computers to be your career, it would be a good idea to become familiar with this table. The only number you should remember from the middle column is that a kilobyte is 1024 bytes. Often a kilobyte is called a "K", a megabyte is called a "Meg", and a gigabyte is called a "Gig".

QUESTION 5:
How many 10 Meg files would it take to fill a 500 Gig hard drive?

Answer:
(500 x 230) / (10 x 220) == 50 x 210 == 50K files
Bytes, not Bits
The previous table listed the number of bytes, not bits. So one K of memory is
1024 bytes, or 1024*8 == 8,192 bits. Usually one is not particuarly
interested in the exact number of bits. It will be very useful in your future career to be sure you know how to multiply powers of two.
2M * 2N = 2(M+N)
In the above, * means multiplication. For example:
26 * 210 = 216
QUESTION 6:
Locations in a digital image are specified by a row number and a column number (both of these are integers). Say that a particular digital image is 1024 rows by 1024 columns, and that each location holds one byte. How many megabytes are in that image?

Locations in a digital image are specified by a row number and a column number (both of them integers). A particular digital image is 1024 rows by 1024 columns, and each location holds one byte. How many megabytes are in that image?
Answer:
1024 * 1024 = 210 * 210 = 2(10+10) = 220 = one megabyte
Picture of Main Memory

Main memory consists of a very long list of bytes. In most modern computers, each byte has an address that is used to locate it. The picture shows a small part of main memory:
Each box in this picture represents a single byte. Each byte has an address. In this picture the addresses are the integers to the left of the boxes: 0, 1, 2, 3, 4, ... and so on. The addresses for most computer memory start at 0 and go up in sequence until each byte has an address.
Each byte contains a pattern of eight bits. When the computer's power is on, every byte contains some pattern or other, even those bytes not being used for anything. (Remember the nature of binary: when a binary device is working it is either "on" or "off", never inbetween.)
The address of a byte is not explicitly contained in memory. When the processor needs to access the byte at a particular address, the electronics of the computer "knows how" to find that byte in memory.
QUESTION 7:

Answer:
q Each byte of main memory has a unique address. True q If main memory is 4 megabytes large, there will be 4 * 220
addresses. True
Contents of Main Memory
Main memory (as all computer memory) stores bit patterns. That is, each memory location consists of eight bits, and each bit is either "0" or "1". For example, the picture shows the first few bytes of memory.
The only thing that can be stored at one memory location is eight bits, each with a value of "0" or "1". The bits at a memory location are called the contents of that location.
Sometimes people will say that each memory location holds an eight bit binary

Preparing to load PDF file. please wait...

0 of 0
100%
CHAPTER 3 — Computer Memory