Welcome to Tec Guide

Welcome to TecGuide, the Guru.

Thursday, October 11, 2007

PC Fundamentals

PC Fundamentals


Binary vs. Decimal Measurements

One of the most confusing problems regarding PC statistics and measurements is the fact that the computing world has two different definitions for most of its measurement terms. :^) Capacity measurements are usually expressed in kilobytes (thousands of bytes), in megabytes (millions of bytes), or gigabytes (billions of bytes). Due to a mathematical coincidence, however, there are two different meanings for each of these measures.

Computers are digital and store data using binary numbers, or powers of two, while humans normally use decimal numbers, expressed as powers of ten. As it turns out, two to the tenth power, 2^10, is 1,024, which is very close in value to 1,000 (10^3).  Similarly, 2^20 is 1,048,576, which is approximately 1,000,000 (10^6), and 2^30 is 1,073,741,824, close to 1,000,000,000 (10^9). When computers and binary numbers first began to be used regularly, computer scientists noticed this similarity, and for convenience, "hijacked" the abbreviations normally used for decimal numbers and began applying them to binary numbers. Thus, 2^10 was given the prefix "kilo", 2^20 was called "mega", and 2^30 "giga".

This shorthand worked fairly well when used only by technicians who worked regularly with computers; they knew what they were talking about, and nobody else really cared. Over the years however, computers have become mainstream, and the dual notation has led to quite a bit of confusion and inconsistency. In many areas of the PC, only binary measures are used. For example, "64 MB of system RAM" always means 64 times 1,048,576 bytes of RAM, never 64,000,000. In other areas, only decimal measures are found--a "28.8K modem" works at a maximum speed of 28,800 bits per second, not 29,491.

Storage devices however are where the real confusion comes in. Some companies and software packages use binary megabytes and gigabytes, and some use decimal megabytes and gigabytes. What's worse is that the percentage discrepancy between the decimal and binary measures increases as the numbers get larger: there is only a 2.4% difference between a decimal and a binary kilobyte, which isn't that big of a deal. However, this increases to around a 5% difference for megabytes, and around 7.5% for gigabytes, which is actually fairly significant. This is why with today's larger hard disks, more people are starting to notice the difference between the two measures. Hard disk capacities are always stated in decimal gigabytes, while most software uses binary. So, someone will buy a "30 GB hard disk", partition and format it, and then be told by Windows that the disk is "27.94 gigabytes" and wonder "where the other 2 gigabytes went". Well, the disk is 27.94 gigabytes--27.94 binary gigabytes. The 2 gigabytes didn't go anywhere.

Another thing to be careful of is converting between binary gigabytes and binary megabytes. Decimal gigabytes and megabytes differ by a factor of 1,000 but of course the binary measures differ by 1,024. So this same 30 GB hard disk is 30,000 MB in decimal terms. But its 27.94 binary gigabytes are equal to 28,610 binary megabytes (27.94 times 1,024).












Windows 95 display of the capacity of an 8 GB hard disk drive.

Note the difference between the number of bytes and the "GB"

values, which are clearly given as binary measures.



One final "gotcha" in this area is related to arithmetic done between units that have different definitions of "mega" or "giga". For example: most people would say that the PCI bus has a maximum theoretical bandwidth of 133.3 Mbytes/second, because it is 4 bytes wide and runs at 33.3 MHz. The problem here is that the "M" in "MHz" is 1,000,000; but the "M" in "Mbytes/second" is 1,048,576. So the bandwidth of the PCI bus is more properly stated as 127.2 Mbytes/second (4 times 33,333,333 divided by 1,048,576).

There's potential good news regarding this whole binary/decimal conundrum. The IEEE has proposed a new naming convention for the binary numbers, to hopefully eliminate some of the confusion. Under this proposal, for binary numbers the third and fourth letters in the prefix are changed to "bi", so "mega" becomes "mebi" for example. Thus, one megabyte would be 10^6 bytes, but one mebibyte would be 2^20 bytes. The abbreviation would become "1 MiB" instead of "1 MB". "Mebibyte" sounds goofy, but hey, I'm sure "byte" did too, 30 years ago. ;^) Here's a summary table showing the decimal and binary measurements and their abbreviations and values ("bytes" are shown as an example unit here, but the prefices could apply to any unit of measure):























































Decimal Name

Decimal Abbr.

Decimal Power

Decimal Value

Binary Name

Binary Abbr.

Binary Power

Binary Value

Kilobyte

kB

10^3

1,000

Kibibyte

kiB

2^10

1,024

Megabyte

MB

10^6

1,000,000

Mebibyte

MiB

2^20

1,048,576

Gigabyte

GB

10^9

1,000,000,000

Gibibyte

GiB

2^30

1,073,741,824

Terabyte

TB

10^12

1,000,000,000,000

Tebibyte

TiB

2^40

1,099,511,627,776


Only time will tell if this standard, which you can read about here, will catch on--old habits die hard. I for one will be doing my share though. As I update various portions of the site, I will be changing places where I used terms such as "kB" and "MB" for binary numbers into "kiB" and "MiB". This may be confusing at first but I think we'll get used to it, and at least it will eliminate the current ambiguity.

Basic Electrical Components

There are several important basic electrical components that are commonly found in the circuits of virtually all PC parts and peripherals. These devices are the fundamental building blocks of electrical and electronic circuits, and can be found in great numbers on motherboards, hard disk logic boards, video cards and just about everywhere else in the PC, including places that might surprise you. They can be used and combined with each other and dozens of other devices, in so many different ways that I could not even begin to describe them all. Still, it is useful to know a bit about how they work, and this page will at least provide you with a basis for recognizing some of what you see on those boards, and perhaps understanding the fundamentals of circuit schematics. Bear in mind when reading the descriptions below that it would really take several full pages to fully describe the workings of most of these components! Fortunately, this level of detail isn't really necessary to provide the background necessary when working with PCs.

For each component, I provide a sample photo, as well as an illustration of the component's symbol in an electrical schematic (diagram showing how a circuit is designed). There are many variants of each of the components shown below; so the diagrams should only be considered examples.



  • Battery: A direct current electricity source of a specific voltage, used primarily in small circuits.













   

A battery (in this case, a button cell on a PC motherboard.)

Original photo © Kamco Services

Image used with permission.




  • Resistor: As you could probably guess from the name, a resistor increases the resistance of a circuit. The main purpose of this is to reduce the flow of electricity in a circuit. Resistors come in all different shapes and sizes. They dissipate heat as a result of their opposing electricity, and are therefore rated both in terms of their resistance (how much they oppose the flow of electrons) and their power capacity (how much power they can dissipate before becoming damaged.) Generally, bigger resistors can handle more power. There are also variable resistors, which can have their resistance adjusted by turning a knob or other device. These are sometimes called potentiometers.










   

Magnified surface-mount resistor from a motherboard.

These small resistors are now much more common on PC

electronics than the older, larger pin type.

Note the "R10" designation.




  • Capacitor: A capacitor is a component made from two (or two sets of) conductive plates with an insulator between them. The insulator prevents the plates from touching. When a DC current is applied across a capacitor, positive charge builds on one plate (or set of plates) and negative charge builds on the other. The charge will remain until the capacitor is discharged. When an AC current is applied across the capacitor, it will charge one set of plates positive and the other negative during the part of the cycle when the voltage is positive; when the voltage goes negative in the second half of the cycle, the capacitor will release what it previously charged, and then charge the opposite way. This then repeats for each cycle. Since it has the opposite charge stored in it each time the voltage changes, it tends to oppose the change in voltage. As you can tell then, if you apply a mixed DC and AC signal across a capacitor, the capacitor will tend to block the DC and let the AC flow through. The strength of a capacitor is called capacitance and is measured in farads (F). (In practical terms, usually microfarads and the like, since one farad would be a very large capacitor!) They are used in all sorts of electronic circuits, especially combined with resistors and inductors, and are commonly found in PCs.










   

Three capacitors on a motherboard.

The two large capacitors in the background are 1500 microfarads

and 2200 microfarads respectively, as you can clearly see from

their labeling. The small silver-colored capacitor in the foreground is

a 22 microfarad electrolytic capactor. Electrolytics are commonly used in

computers because they pack a relatively high capacitance into a small

package. The plus sign indicates the polarity of the capacitor, which also has its

leads  marked with "+" and "-". If you look closely you can see the "+" marking

on the motherboard, just to the left of the capacitor. Note that very small

capacitors are also found in surface-mount packages just like the resistor above.




  • Inductor: An inductor is essentially a coil of wire. When current flows through an inductor, a magnetic field is created, and the inductor will store this magnetic energy until it is released. In some ways, an inductor is the opposite of a capacitor. While a capacitor stores voltage as electrical energy, an inductor stores current as magnetic energy. Thus, a capacitor opposes a change in the voltage of a circuit, while an inductor opposes a change in its current. Therefore, capacitors block DC current and let AC current pass, while inductors do the opposite. The strength of an inductor is called--take a wild guess--its inductance, and is measured in henrys (H). Inductors can have a core of air in the middle of their coils, or a ferrous (iron) core. Being a magnetic material, the iron core increases the inductance value, which is also affected by the material used in the wire, and the number of turns in the coil. Some inductor cores are straight in shape, and others are closed circles called toroids. The latter type of inductor is highly efficient because the closed shape is conducive to creating a stronger magnetic field. Inductors are used in all sorts of electronic circuits, particularly in combination with resistors and capacitors, and are commonly found in PCs.










   

A toroidal core inductor from a PC motherboard.

The two bars in the symbol represent the iron core;

an air-core inductor would not have the bars.

Note that very small inductors are also found in

surface-mount packages just like the resistor above.




  • Transformer: A transformer is an inductor, usually with an iron core, that has two lengths of wire wrapped around it instead of one. The two coils of wire do not electrically connect, and are normally attached to different circuits. One of the most important components in the world of power, it is used to change one AC voltage into another. As described above, when a coil has a current passed through it, a magnetic field is set up proportional to the number of turns in the coil. This principle also works in reverse: if you create a magnetic field in a coil, a current will be induced in it, proportional to the number of turns of the coil. Thus, if you create a transformer with say, 100 turns in the first or primary coil, and 50 turns in the second or secondary coil, and you apply 240 VAC to the first coil, a current of 120 VAC will be induced in the second coil (approximately; some energy is always lost during the transformation). A transformer with more turns in its primary than its secondary coil will reduce voltage and is called a step-down transformer. One with more turns in the secondary than the primary is called a step-up transformer. Transformers are one of the main reasons we use AC electricity in our homes and not DC: DC voltages cannot be changed using transformers. They come in sizes ranging from small ones an inch across, to large ones that weigh hundreds of pounds or more, depending on the voltage and current they must handle.










   

A transformer from the interior of a PC power supply.

Note the large heat sink fins above and below it.




  • Diode / LED: A diode is a device, typically made from semiconductor material, that restricts the flow of current in a circuit to only one direction; it will block the bulk of any current that tries to go "against the flow" in a wire. Diodes have a multitude of uses. For example, they are often used in circuits that convert alternating current to direct current, since they can block half the alternating current from passing through. A variant of the common diode is the light-emitting diode or LED; these are the most well-known and commonly-encountered kind of diode, since they are used on everything from keyboards to hard disks to television remote controls. An LED is a diode that is designed to emit light of a particular frequency when current is applied to it. They are very useful as status indicators in computers and battery-operated electronics; they can be left on for hours or days at a time because they run on DC, require little power to operate, generate very little heat and last for many years even if run continuously. They are now even being made into low-powered, long-operating flashlights.


















A diode (top) and a light-emitting diode (bottom). Note the

symbol on the circuit board above the diode, and the "CR3"

designation. The LED shown is an older, large diode from a

system case. LEDs are now more often round and usually smaller.




  • Fuse: A fuse is a device designed to protect other components from accidental damage due to excessive current flowing through them. Each type of fuse is designed for a specific amount of current. As long as the current in the circuit is kept below this value, the fuse passes the current with little opposition. If the current rises above the rating of the fuse--due to a malfunction of some sort or an accidental short-circuit--the fuse will "blow" and disconnect the circuit. Fuses are the "heroes" of the electronics world, literally burning up or melting from the high current, causing a physical gap in the circuit and saving other devices from the high current. They can then be replaced when the problem condition has been corrected.  All fuses are rated in amps for the amount of current they can tolerate before blowing; they are also rated for the maximum voltage they can tolerate. Always replace a blown fuse only with another of the same current and voltage rating.










   

A fuse, sitting in its fuse holder,

from the interior of a PC power supply.


No comments: