Computer Basics
Bash Shell Scripting

Computer Basics

Overview

Today, personal computers are ubiquious in business and the home. Yet people are often confused as to basic concepts of which parts do what. Is it important to know these things? At a basic level, yes. Anyone that drives a car should understand the basics of gas mileage, how controls such as the steering wheel and transmission affect the function of the vehicle, airbags, seatbelts, and engine fluids. Not everyone will be a mechanic, but an informed driver can make smarter car purchases and be a safer and more effective behind the wheel. The same deal applies to computers, and so this tutorial will attempt to explain some of the same basic concepts for your desktop computer.

The article attempts to be as vendor-neutral as possible, meaning that it applies equally to Macintoshes, IBM PC-compatibles, and other desktop and laptop computers equally.

The Big Box

The primary component of your computer is the large box that sits either on your desk or beneath it. This box usually makes the most noise, has several disk drives in it where you can insert CD-ROMs or floppy disks, and has many cables coming out of it. This box contains most of the core components for your computer, so we'll go over each of them in turn.

  • CPU - CPU stands for Centeral Processing Unit. It's the computer's "brain", which does all the "thinking" for the computer. When speaking about the computer's speed, it is usually a megahertz (abbreviated mHz) rating which indicates how many operations the CPU can execute per second. Macintosh computers contain PowerPC CPUs created by Motorla; IBM PCs usually contain CPUs made by AMD or Intel. The CPU is small, no larger than your hand, but it generates a lot of heat, and usually has a large heatsink or fan attached to it to help keep it from overheating.
  • Storage - Storage devices store data, which is what computers are really all about. There is a separate section in this document devoted to storage, so reference that for more.
  • Case - The case is the metal (or sometimes plastic) box which houses all of the components. Sometimes they are brightly colored and stylized, but more often they are square white or beige boxes. There are two types of cases, "tower" cases which stand upright and are about the size of two toolboxes stacked on top of one another, and "desktop" cases which are the size and shape of several pizza boxes stacked on top of one another. Desktop cases are designed to go under your monitor, while towers either sit beside it or on the floor under your desk.
  • Motherboard - The motherboard fills most of the case. It is a large circuitboard which holds the CPU and connects it to all the other devices. The motherboard serves as glue that ties together all the components and allows them to talk to one another.
  • Expansion cards - Extra expansion cards, sometimes called expansion boards, can be purchased and plugged into the motherboard by opening the case. Most desktop machines use a standard called "PCI", with the exception of video cards which are often "AGP". The terms are not terribly relevant, except that they dictate the shape of the slot that the cards plug into, which is important to know if you plan to install one yourself. One exception is laptop computers which use a type of expansion card called PCMCIA, and can usually be plugged in without opening the case (since laptops can't usually be opened easily).

Video

Video refers to the visual output of the computer. There are only two components involved: the monitor (the TV-like screen that your computer uses to show things to you) and the video card. The video card is usually an expansion card that plugs into a slot on your motherboard, as described in the previous section. The card has a plug that is then exposed through the back of the case. Most desktops use VGA plugs, which are in the shape of a rectangle with two of the corners drawn inwards slightly. (This shape keeps you from plugging it in the wrong way!) Your monitor plugs into the plug on the back of the video card.

The computer displays images by what we call pixels. Pixels are small colored dots that the video card can cause to be displayed from behind the monitor's glass. Colored dots by themselves don't look like much, but they are very small and arranged in a grid. By displaying colors at certain positions, someone sitting at a normal distance will see a cohesive picture and (hopefully) not notice the individual pixels.

You can see how pixels work by looking at a newspaper. (Newspapers don't use pixels, but they use a similar concept - small dots of ink on a page.) Look extremely closely at a photograph on a newspaper page, possibly with a magnifying glass. You'll see many small dots that, up close, don't look like much. Sit back a bit, though, and they form into a picture, with the dots not very noticeable.

The image quality of your monitor is controlled primarily by the resolution and color depth of the video card, and the size of your monitor. The monitor's size is measured on a diagonal across the face of the glass; most monitors today are 17", but many are 19", 20", 21", or larger. Some older monitors are 15" or 14". (Note that the advertised size of the monitor doesn't alway match directly with the actual size; many 17" monitors actually measure 16" or 16.5" across.)

Resolution refers to the number of pixels on the screen. A common resolution is 1024x768, which means 1024 pixels horizontally, and 768 pixels vertically. (Your monitor is shorter top-to-bottom, so there are correspondingly fewer pixels.) Note that the total number of pixels can be calculated by multiplying these two numbers together; 1024x768 resolution is a total of 786,432 pixels!

Color depth reflects the number of possible colors that each pixel can display. This value is usually shown in something called a "bit depth". Common values are 16 bit and 24 bit. 16 bit is 65,536 possible colors, and 24 bit is 16,777,216 possible colors. Both are very large, and the difference is only discernible to a fairly close observer. Some older computers may run in 8 bit mode, which is only 256 colors - generally not enough colors to display photo-quality images at good quality.

Storage

There are two types of storage: RAM, which only stays around as long as your computer is turned on, and disks, which keep the data written to them indefinitely. Why would you ever use RAM when you could use a disk? Simple: RAM is many thousands of times faster than disks. If your computer had to access everything from a disk, it would be incredibly slow.

The distinction is very important for computer users, because often a time will come that you run out of one or the other, and need to buy more. If you don't know which one you're out of, you may buy the wrong thing, which will waste your money and not fix your problem.

RAM - RAM stands for Random Access Memory, though that's not terribly important to remember. What is important is that it starts blank each time your computer turns on, and is filled up with data from the disk as it boots. When you run programs or load web pages, they get loaded into RAM. As you close programs or leave those web pages, they get purged from RAM to make room for more stuff. If you open too many programs at once, you will eventually run out of RAM, at which point you won't be able to run any new programs.

RAM is measured in megabytes, which is over a million bytes. A byte stores a single character (such as a letter of the alphabet or a digit), so one megabyte can store all the letters contained in a thick novel. Images and programs tend to take up much more space than letters, however, so you will need many megabytes on a modern computer. Typically they are sold in increments of 64, 128, or 256 megabytes. A typical desktop computer purchased today will have 128 or 256 megabytes of RAM, often written 128M and 256M, respectively.

Hard Drive - The hard drive (sometimes called the hard disk) is a small metal box the size of a camera which hides inside your case. It contains most of of the information that your computer has access to, including all of your programs. When you install a piece of software, it is transfered from the media you purchased it on (usually a CD-ROM) and placed on the hard drive. Hard drives are vastly slower than RAM, but they come in correspondingly larger sizes. Hard drives are usually measured in gigabytes. A gigabyte (sometimes abbreviated GB) is over 1000 megabytes. That means it's over one billion bytes! Hard drives usually come in sizes of 20GB or 30GB, but can get much larger.

CD-ROM - The CD-ROM drive is in your case, but its face is exposed out the front so that you may open the CD tray and insert CD-ROMs, which look just like audio CDs. (Some computers may have a DVD-ROM drive in place of a CD-ROM, but don't worry: they still read regular CD-ROMs.) In fact, your computer can probably play audio CDs, but that's not the primary reason it has a CD drive. Instead, programs usually come on CDs, and in order to install the program, you'll need to put its CD into your drive. CD-ROMs are read-only, meaning that you can't modify their contents as you can RAM or your own hard drive. (In fact, the "ROM" in CD-ROM stands for Read Only Memory.) Some people have CD "burners" which allow you to write data to special blank CDs, called CD-R (the R stands for Recordable). Also available are CD-RW (RW is for Read-Write) which allow you to read and write from the multiple times. Reading and writing from a CD is even slower than your hard drive, and they don't hold as much: usually only 640MB (megabytes). Their primary advantage is that they are portable, unlike your hard drive or RAM.

Removable media - There exist many types of removable media besides CDs including floppy disks, ZIP disks, and JAZZ drives. These all hold a varying amount of data (1.44MB for floppys to several hundred MB for ZIP or JAZZ disks) and are readable and writable. Usually these mediums are used for moving files between computers, but the rise of the high-bandwidth Internet and CD writers has lowered the popularity of these types of removable media.

Input Devices

Input refers to any information that you send to the computer yourself (that is, not from a disk or a network). The two primary input devices in use today are the keyboard and the mouse. Mice usually have one, two, or three buttons (although sometimes more) and can be moved around on your physical desktop, producing a corresponding motion by the "mouse pointer" on your monitor. The keyboard features an array of 102 (or more) keys which can be used to issue commands and type text such as email.