Moving Data Around

Much of the work done by computers is simply moving data from one place to another. Before a program starts running, it must be loaded into the RAM (memory). This might involve copying several megabytes of data from the hard-disk into the RAM. When you visit a web-site, a web page (HTML page) is transmitted to your computer. This might be 100 kilobytes of data or more. If you watch an animation (a video), several frames per second must be displayed on the monitor. This could involve copying something like half a megabyte from the disk to the screen, repeated several times per second.

Units for Measuring Speed

Speed is measured in many different ways for different devices. Here is some basic vocabulary:

Fractions Storage Frequency
ms = milli-second
= 10^-3 (1/thousandth)
bit = 0 or 1 Hz = Hertz
=
1 repitition per second
µs = micro-second
= 10^-6 (1/millionth)
Byte = 8 bits
= 1 character (ASCII code)
= 1 pixel (dot) at 256 colors
KHz = kilohertz
= 1000 repetitions/sec
ns = nano-second
= 10^-9 (1/billionth)

K = kilo =
2^10 (thousand)
KB
= kilobyte = 1024 bytes
MHz = megahertz
=
1 million reps/sec
  M = mega = 2^20 (million)
MB =
megabyte
Mb = megabit
RPM = revolutions per minute
used to measure speed that
a disk drive spins
  G = giga = 2^30 (billion)
GB =
gigabyte
 
  T = tera = 2^40 (trillion)
TB =
terabyte
 

A Picture is Worth 1000 Words

Imagine you have seen a nice picture of an automobile on the Internet, and you want to download it into your computer, and then use it in an essay.

A typical full-screen VGA picture is 640x480 pixels, using 256 colors. This means 1 byte is used to store each pixel, so the storage requirement for the picture is 640x480x1 byte = 307 200 bytes, or about 300 KB. Many pictures in the Internet are stored as .GIF files, which compress the data into a smaller space - perhaps 80 KB.

Perhaps you own a 33.6 K modem. What does this mean? This K is kilobits, not kilobytes. Your modem can transfer 33.6 Kbps (kilobits per second), but there are 8 bits in a byte, so this is approximately 4 KBps (kiloBytes per second). If there is no interference, and the Internet is not busy, you could download the picture in about 20 seconds (80/4). But modems don't always run at their maximum speed. More likely, you will only get 1 or 2 KB/sec, so it will take longer.

The picture travels across the Internet to your modem, then into your computer through the COM port (communications port), and arrives in the RAM. Now the picture must still be transferred to the graphics card VRAM (video RAM), before it can be transmitted to the monitor and displayed. If your computer has a PCI motherboard, then the RAM-video card transfer occurs directly over the data-bus, which is running at 66 MHz (megahertz). If it is a 32-bit data bus, then 4 bytes can be transferred at a time, at a speed of 66 MHz, so a total of 264 MB per second (66x4). Thus, the transfer of 80 KB requires only 80 K / 264 M = 0.0003 sec, which is less than a millisecond. However, the RAM chips probably have a response time of 60 ns (nanoseconds), which means that 1 byte can be transferred in 60 ns, which is only 16 MB/sec, so actually the picture takes 80 KB / 16 MB = 5 ms (milliseconds). Well, still a lot faster than the Internet!

Ah, but lets be careful. Remember that the 80 KB .GIF file was compressed, and the picture actually requires 300 KB storage. When the picture arrives in your computer, it must be uncompressed by the microprocessor before it can be displayed by the graphics card. This will take a small amount of time and result in 300 KB of data in the memory. Now the 300 KB must be tranferred to the video card, which takes 300 KB / 16 MB, which is about 19 millisecond for the transfer - still pretty fast.

Once the picture arrives in the graphics card, it is displayed on the monitor. It is actually drawn over and over again, 70 times per second (70 Hz refresh). Does this mean that 70 different pictures can be displayed each second? Well, that would be true if all 70 pictures could be stored in the VRAM (video RAM), but that would require 70x300 KB = 21 MB of VRAM, but even a very expensive video card probably has at most 4 MB. An, anyway, most video cards will only store one picture at a time. Thus, if the RAM will only transmit an image every 20 ms, then it can only transmit 50 pictures per second, not 70.

If you want to save the picture on your hard-disk, this will take a bit longer. A typical hard-disk can save about 1 MB (megabyte) per second. So it will take 1/3 second to store the picture.

Animation and Video

To display animation, the computer must display several different pictures each second. This presents both a storage and a speed problem.

A typical movie is about 90 minutes long. It is displayed at 24 frames per second - that means 24 different pictures each second. If a film is to be stored on a CD-ROM or other disk, it will require 24x60x90 = 129 600 frames. If each frame requires 300 KB, then the entire film requires
129 600 x 300 KB = 38800 MB = 38800 gigabytes. A normal CD-ROM can store only
650 MB, so this requires 50 CD-ROMS to store the movie. If you wanted to watch a movie this way, you would be swapping CD-ROMs every 2 minutes.

DVD

The new DVD (digital video disk) standard attempts to provide more storage by writing pits (little holes, one for each bit) closer together to fit more on the disk, then storing on both sides of the disk, and writing two layers on each side of the disk. Such a quad-density disk would store up to 17 GB (gigabytes). This is still not enough for a movie, but if the movie is compressed, it will fit. (Amazingly, the drives are being designed with only one laser, so the user must physically turn the disk over to use the second side.)

Nevertheless, speed remains an issue. Displaying 24 frames per second at normal VGA resolution requires 300 KB x 24 = 7.2 MB per second to be transmitted to the graphics card. If the images are sitting in the RAM, they can be transferred at speeds of several hundred megabytes per second. However, there is not nearly enough RAM to store an entire movie - a very expensive PC might contain 64 MB of RAM, but certainly not 17 GB! No, the movie will have to be read from the DVD drive and displayed in real-time - this means that the data transfer must be just as fast as the display. How fast is DVD? That remains unclear. The original CD-ROM drives (single speed) could transfer data at 150 KB/sec. A double speed CD-ROM drive transfers 300 KB/sec. A 24 speed drive transfers 150 x 24 KB / sec = 3.6 MB per second. This is only half the speed required for proper video. So the DVD drive needs to run at 48x times the standard CD-ROM speed.

Ah, but don't forget the compression. It is not necessary to transfer that much data that fast. If the compression method achieves 50% compression, then only a 24x speed data-transfer rate is required. Unfortunately, the data must also be decompressed fast enough to keep up with the display. Decompression is not instantaneous. This is one of the most crucial problems at present. There are lots of ideas about the "best" compression method, and this has led to a variety of incompatible DVD standards being marketed. As a result, DVD is not really becoming popular. Everyone is waiting for a standard that really works and is supported by a lot of manufacturers. It's close, but not quite there. And even if it worked, the video would still be poor quality, because "real" video has a lot more than 256 colors.

Cheap Tricks

Video-conferencing refers to transmitting live video to create a video-telephone, where the people at both ends can watch each other. This is already possible, but how? The fastest modems manage 8 KB per second. This is nowhere close to the 7 MB/sec required for video. Compression can help, but not at a factor of 1000 to 1. Other tricks are more effective. Existing video conferencing systems transmit small images - for example, 200x150 = 30000 pixels, instead of the 300000 pixels required for an entire screen image. Then the frame-rate is also reduced - down to 1 or 2 frames per second. Indeed, 30000 x 2 = 60000 bytes per second which must be transmitted. This is still 8 times more than a fast modem can transmit, but compression can help a lot. Yes, real time video-conferencing is possible, but only with very small, poor quality, jerky images. And any ideas of transmitting entire movies across the Internet are nothing more than fantasies.

Real Improvements

Showing a jerky, tiny, poor quality video is not actually an improvement - it simply uses the existing technology to its logical limit. Computer designers are constantly (and rapidly!) designing better hardware which is actually faster than the old equipment. The next chapter outlines common methods for speeding things up, including: