Memory

From CDS 130

Jump to: navigation, search

Contents

  1. Objectives
  2. Motivation
  3. Priming questions
  4. Notes
    1. Types of Memory
    2. Primitive Memory Stick
    3. CD or DVD
    4. Hard Disk
    5. RAM
    6. Computer Specs
    7. Computer Specs
    8. Memory types comparison
    9. Computer Specs
  5. Questions
    1. Gigabytes
    2. Bytes per dollar
    3. Bytes per dollar
    4. Estimate
    5. 32-bit SSN
    6. Bit SSN
    7. OS Memory
  6. Activities
    1. Human RAM
    2. Memory
    3. Computer Specs
    4. Better choice
  7. Resources

1. Objectives

  • To have an understanding about the meaning terms such as gigabytes, megabytes, etc.
  • To have an understanding of the relationship between these terms and computer-related terminology encountered in everyday life.

2. Motivation

In scientific computing, the two biggest constraints on the types of problems that you can solve are

  1. how much memory is needed and
  2. how fast a computation can be performed.

3. Priming questions

  • Write down the various ways in which you have heard memory described as it relates to computers.
  • Suppose that you were given the choice of doubling your long term memory or doubling your short term memory. Which would you choose and why?
  • Every person U.S. citizen is assigned a Social Security Number (SSN) composed of 9 decimal digits. Why isn't the number 5 digits? Why isn't the number 100 digits?

4. Notes

4.1. Types of Memory

There are many ways to store bits. Previously we discussed

  • Storing bits and bytes on a piece of paper
  • A primitive memory stick
  • A DVD or CD
  • A hard drive

4.2. Primitive Memory Stick

A simple memory stick.  If the person holding the large magnet sees the stick move toward him, he records a 1.  If it moves away from him, he records a 0.
A simple memory stick. If the person holding the large magnet sees the stick move toward him, he records a 1. If it moves away from him, he records a 0.


4.3. CD or DVD

A CD or a DVD has small pits in it. In locations where there is a pit, the sensor stops receiving a reflected signal and this is interpreted as "zero". In locations where there is not a pit (a "land"), there is a reflected signal and this is interpreted as "one". What factors do you think control how many bits can be stored per unit area? What factors do you think control how quickly the bits can be read/written?

From img.tfd.com on June 25 2017 14:25:48.

4.4. Hard Disk

A hard disk has one or more spinning metal plates. A sensor arm moves to different positions along the radius of the plate. The sensor moves up or down depending on if the plate has a magnetic field pointing up or down in a given location. Below is a hard drive with its cover removed.

From upload.wikimedia.org on June 25 2017 17:33:04.


A laptop with the hard drive enclosure pulled out.
A laptop with the hard drive enclosure pulled out.


4.5. RAM

RAM ("Random Access Memory") does not require any moving parts to work. It is based on many tiny electrical switches (made of transistors) packed into a small volume.

The bottom of a laptop computer showing the RAM sticks.
The bottom of a laptop computer showing the RAM sticks.


4.6. Computer Specs

When we talk about computer specs, we mostly talk about memory:

  • 300 GB Hard Drive - How much data you can store after the power is off ("slow" memory)
  • 1 GB RAM - How much data you can store when the power is on ("fast" memory)

The human brain has a similar feature - the information in short-term memory is generally recalled more quickly. The information in long term memory often takes longer to recall, but we have more information in our long-term memory.

Informally we say "The desktop computer has a 300 GB of disk space and 1 GB of memory." (That is, the word "memory" is assumed to mean RAM or "fast" memory even though the hard drive is used for memory.)

Note:

  • 1 TB = 1 trillion bytes (or 8 trillion bits).
  • 1 GB = 1 billion bytes.
  • 1 MB = 1 million bytes.

4.7. Computer Specs

There are broadly two categories of memory: "fast" and "slow".

  • Slow memory usually requires moving parts. Examples include a hard drive and a CD or DVD. In both cases a sensor reads bits off of a spinning plate.
  • Fast memory usually does not require moving parts and requires less power. Examples include the RAM memory used inside of a desktop computer and a USB thumb drive.

In terms of bits that can be stored per dollar of cost,

  • Slow memory is usually less expensive.
  • Fast memory is usually more expensive.

A 300 GB hard drive costed about $100 dollars when 1 GB of RAM costed $20 dollars. This translates to

  • 300,000,000 bytes/$100 dollars = 3,000,000 bytes per dollar for the hard drive
  • 1,000,000 bytes/$20 dollars = 50,000 bytes per dollar for the RAM

or, RAM memory is 3,000,000/50,000 = 60 times more expensive per byte.

4.8. Memory types comparison

  • Slow memory is cheaper than fast memory.
  • Slow memory usually takes up more space. (Smart phones and iPads don't have a DVD player or hard drive.)
  • Slow memory is not lost when the power is turned off. Most types of fast memory lose their memory when the power is off (such memory is called "volatile"). An exception is the memory used in a USB thumb drive, which does not lose its memory when unplugged [1].

4.9. Computer Specs

You may have also heard of 32-bit or 64-bit "operating systems". A 32-bit operating system means that the fundamental size of a memory slot used by the software that makes up the operating system is 32-bits. That is, roughly speaking, memory retrieved from the hard disk or in RAM is read, interpreted, communicated in chunks of 32-bits. (To see why having a fixed size is important, consider how the mail system works. Standard U.S. letters are very easy for the mail system to handle because very efficient machines exist that can quickly process letters of this size. Although the mail system can handle odd-sized objects, they require more time and effort to process.)

Examples of operating systems with both 32 and 64-bit versions include:

Image:windows_masthead_ltr.gif Image:product_title_20090824.png             
From upload.wikimedia.org on June 07 2016 19:03:42.

Many 32-bit operating systems will not allow you to use more than about 4 GB of RAM. The reason is that each memory slot in RAM requires an address that has a length of 32 bits. With 32 bits, you can create 232=4,294,967,296 unique patterns (addresses).

5. Questions

5.1. Gigabytes

A gigabyte is roughly equal to one billion bytes. How many bits are contained in one billion bytes?

A. 1 billion bits
B. 2 billion bits
C. 4 billion bits
D. 8 billion bits
E. None of the above

5.2. Bytes per dollar

If a 300 GB hard drive costs $100 dollars and a 4.7 GB DVD disk costs $2 dollars, which is a better deal in terms of bytes per dollar?

5.3. Bytes per dollar

If a 2 TB hard drive costs $300 dollars and a 4.7 GB DVD disk costs $3 dollars, which is a better deal in terms of bytes per dollar?

5.4. Estimate

How many hard drives could you fit in a shoebox? How many USB thumb drives could you fit in a shoebox? Use rough estimates for the size of a hard drive, USB thumb drive, and shoebox.

Show your work at state your assumptions.

How many bytes are stored in the shoebox full of hard drives? How much does it weigh?

How many bytes are stored in the shoebox full of USB thumb drives? How much does it weigh?

What is the storage capacity of a human brain? How much does the average human brain weigh? Cite your sources.

5.5. 32-bit SSN

Suppose that the government decided to assign every person in the U.S. a 32-bit number (a binary number of length 32) instead of assigning each person a 10-digit decimal number. Would any two people be associated with the same number?

5.6. Bit SSN

If we wanted to assign a unique binary number of length N to each person in the world, what is the minimum value of N that would be needed so that no two people had the same number assigned to them?

5.7. OS Memory

If you install a 32-bit operating system twice, do you have a 64-bit operating system?

Answer: No. Reference [2].

6. Activities

6.1. Human RAM

When the instructor says "go" memorize as many digits as possible (in sequence) of the list of decimal digits written on the board. When the instructor says "stop" (after about 30 seconds), write down as many numbers as possible without looking at the board. When you are done, look at the board and compute the number of digits you were able to memorize and write this value on the notecard. The instructor will collect the notecards at the end of class and enter the numbers in the "Numbers Remembered" column Spreadsheet. As a follow-up question, the instructor will ask you how many bits per second that you were able to memorize.

How does this compare to how many bits per second a computer can store? (Hint: Think about how long it takes you to copy a file from a thumb drive to a computer.)






6.2. Memory

Every person U.S. citizen is assigned a Social Security Number (SSN) composed of 9 decimal digits. Why isn't the number 5 digits? Why isn't the number 100 digits?





6.3. Computer Specs

Look up the details about your smart phone, laptop, or desktop computer. Which of the specifications listed correspond to memory? Which correspond to fast versus slow memory?

6.4. Better choice

Which is a better deal, a computer with a hard drive that can store

  • 50,000 images or
  • has a capacity of 100 GB?

Explain your answer.

7. Resources

Articles about how computer memory works:

Retrieved from "http://cds130.org//Memory"
Personal tools