Table Of ContentThe Things You Should Know Series
This series is a littledifferent from our usual books. The Things You
Should Know series highlightsinteresting topics in technology and sci-
ence that you should know about. Maybe you took these courses in
school, and promptly forgot about them. Or maybe you’ve always been
curious but never had the opportunity to learn more.
Now you can. With these titles, you can quickly become familiar with
(or remind yourself of) an interestingtopic area. We hope it gives you
something to talk about at the next cocktail party, or brown-bag lunch
at work, or user’s group meeting. It might even further inspire you to
delve into the topic more deeply.
In either case, we sincerely hope you enjoy the show. Thanks,
Andy Hunt
Things You Should Know
A Peek at Computer Electronics
Caleb Tennis
The Pragmatic Bookshelf
Raleigh,NorthCarolina Dallas,Texas
Many of the designations used by manufacturers and sellers to distinguish their prod-
uctsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andThe
Pragmatic Programmers, LLC was aware of a trademark claim, the designations have
been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The
PragmaticProgrammer,PragmaticProgramming,PragmaticBookshelfandthelinkingg
devicearetrademarksofThePragmaticProgrammers,LLC.
Every precaution was taken in the preparation of this book. However, the publisher
assumesnoresponsibility for errorsor omissions,or for damagesthatmay result from
theuseofinformation(includingprogramlistings)containedherein.
Our Pragmatic courses, workshops, and other products can help you and your team
create better software and have more fun. For more information, as well as the latest
Pragmatictitles,pleasevisitusat
http://www.pragmaticprogrammer.com
Copyright©2009ThePragmaticProgrammersLLC.
Allrightsreserved.
Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmit-
ted, in any form, or by any means, electronic,mechanical,photocopying, recording, or
otherwise,withoutthepriorconsentofthepublisher.
P1.2printing,November2007
Version:2009-9-21
Contents
1 Introduction 8
1.1 The disclaimer . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 Organization . . . . . . . . . . . . . . . . . . . . . . . . . 10
Part I—Electronic Fundamentals 13
2 Basic Electricity 14
2.1 What is electricity? . . . . . . . . . . . . . . . . . . . . . 14
2.2 Conductors and Insulators . . . . . . . . . . . . . . . . 17
2.3 Understanding Current Flow . . . . . . . . . . . . . . . 18
2.4 Making use of electricity . . . . . . . . . . . . . . . . . . 19
2.5 Electrical Components . . . . . . . . . . . . . . . . . . . 28
3 Electrical Power 34
3.1 Some History . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2 AC versus DC . . . . . . . . . . . . . . . . . . . . . . . . 38
3.3 And the winner is.... . . . . . . . . . . . . . . . . . . . . 43
3.4 AC Power Fundamentals . . . . . . . . . . . . . . . . . . 47
3.5 AC Power Distribution . . . . . . . . . . . . . . . . . . . 49
3.6 What is Ground? . . . . . . . . . . . . . . . . . . . . . . 55
3.7 AC Power Safety. . . . . . . . . . . . . . . . . . . . . . . 59
3.8 Taking Measurements . . . . . . . . . . . . . . . . . . . 60
4 Making Waves 66
4.1 Electrical Waves . . . . . . . . . . . . . . . . . . . . . . . 66
4.2 Analog and Digital . . . . . . . . . . . . . . . . . . . . . 78
CONTENTS 6
5 The Power Supply 84
5.1 Rectification . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.2 Switching Power Supply . . . . . . . . . . . . . . . . . . 90
5.3 Bus Voltages . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.4 Power Consumption . . . . . . . . . . . . . . . . . . . . 95
5.5 Power Management . . . . . . . . . . . . . . . . . . . . . 96
Part II—Microprocessor Technology 98
6 Semiconductors 99
6.1 Electrons through a Vacuum . . . . . . . . . . . . . . . 99
6.2 Semiconductors . . . . . . . . . . . . . . . . . . . . . . . 102
6.3 Doping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6.4 The PN Junction . . . . . . . . . . . . . . . . . . . . . . 106
6.5 P-N Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7 Transistors 109
7.1 The History . . . . . . . . . . . . . . . . . . . . . . . . . 109
7.2 The use of transistors . . . . . . . . . . . . . . . . . . . 109
7.3 Bipolar Junction Transistor . . . . . . . . . . . . . . . . 111
7.4 Field Effect Transistor . . . . . . . . . . . . . . . . . . . 114
7.5 The Use of Transistor . . . . . . . . . . . . . . . . . . . 116
7.6 Transistor Logic . . . . . . . . . . . . . . . . . . . . . . . 117
7.7 CMOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
7.8 Transistor circuits . . . . . . . . . . . . . . . . . . . . . 120
8 The Processor 126
8.1 The history of the processor . . . . . . . . . . . . . . . . 126
8.2 Processor Fundamentals. . . . . . . . . . . . . . . . . . 128
8.3 Processor Packaging . . . . . . . . . . . . . . . . . . . . 130
8.4 Processor Cooling . . . . . . . . . . . . . . . . . . . . . . 132
Reporterratum
thiscopyis(P1.2printing,November2007)
CONTENTS 7
9 The Motherboard 134
9.1 Circuit Connections . . . . . . . . . . . . . . . . . . . . 134
9.2 Bus Types . . . . . . . . . . . . . . . . . . . . . . . . . . 138
9.3 RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
9.4 System Clock . . . . . . . . . . . . . . . . . . . . . . . . 143
9.5 BIOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
9.6 Other Devices . . . . . . . . . . . . . . . . . . . . . . . . 149
Part III—Peripheral Technology 151
10 Data Storage 152
10.1 Hard Disk Drives . . . . . . . . . . . . . . . . . . . . . . 153
10.2 Optical Disk Drives . . . . . . . . . . . . . . . . . . . . . 155
10.3 Flash Drives . . . . . . . . . . . . . . . . . . . . . . . . . 161
11 Networking 165
11.1 Modems . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
11.2 Local Area Networks . . . . . . . . . . . . . . . . . . . . 174
11.3 The OSI Model . . . . . . . . . . . . . . . . . . . . . . . . 178
11.4 Cabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
11.5 Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
12 External Devices 190
12.1 Display Devices . . . . . . . . . . . . . . . . . . . . . . . 190
12.2 Input Devices . . . . . . . . . . . . . . . . . . . . . . . . 194
12.3 Connections . . . . . . . . . . . . . . . . . . . . . . . . . 197
13 Wireless 205
13.1 Wireless Fundamentals . . . . . . . . . . . . . . . . . . 205
13.2 Wireless Fundamentals . . . . . . . . . . . . . . . . . . 210
13.3 Wireless Technologies . . . . . . . . . . . . . . . . . . . 213
A The Low Level 217
A.1 The Atomic Level . . . . . . . . . . . . . . . . . . . . . . 217
A.2 Elementary Education . . . . . . . . . . . . . . . . . . . 220
A.3 Materials and Bonding . . . . . . . . . . . . . . . . . . . 223
A.4 Just a little spark . . . . . . . . . . . . . . . . . . . . . . 225
A.5 Electric Fields . . . . . . . . . . . . . . . . . . . . . . . . 227
A.6 Magnetism . . . . . . . . . . . . . . . . . . . . . . . . . . 229
A.7 Sources of Electricity . . . . . . . . . . . . . . . . . . . . 230
Reporterratum
thiscopyis(P1.2printing,November2007)
Chapter 1
Introduction
Let’s face it—we take electronics for granted. All of our modern conve-
niences, from dishwashers to MP3 players, have some internal elec-
tronic components. These electronics are created with the intent to
make our everyday lives easier.
Somanyofthethingswetakeforgrantedeverydayreliesonsomeform
of electronics. Without electronics, it would be impossible to enjoy so
many of the modern conveniences we have come to rely on. Of course,
they don’t always work correctly 100% of the time. When your cell
phone gets no signal or when your portable music player locks up in
the middle of a song, the enamor for electronics goes away completely.
However, their ubiquity cannot be overlooked.
And yet, with all of the conveniences and frustrations that electronics
provide us, very few of us have any understanding as to what exactly
makethewholethingwork.Certainly,we’reall awareof thetermsvolt-
age, current, electrons, and things like AC and DC, but for many of us
the understanding of what those things really are stops short of just
somevaguenotions. Thevacuum tube,oneof themoreimportantelec-
tronics inventions, is shown on the cover of this book. And while most
of us may know of the term “vacuum tube”, very few of us know what
it does or how it works.
This book is designed to help explain the core concepts of electronics,
specifically targeted towards readers interested in computer technol-
ogy.Themainfocusofthisbookistogiveyouanunderstandingwhat’s
really going on behind the scenes and how this makes the computer
work. The idea is to give an inside view to people who already have an
appreciation for computers. This isn’t an introductory look at comput-
ers, but instead a look at how they tick. Of course, to get there a good
THE DISCLAIMER 9
portion of the book focuses just on basic electronics and electricity,
from how it gets to your house to how it works within the computer
itself.
Of course, trying to tackle every topic in great detail is simply impos-
sible, and it was not the goal in writing this book. There are many
othergood books whichspecializeinexplaining variousaspectsof elec-
tronics and computer electronics. This book was meant to give some
insight into the various aspects of the computer that most of us work
witheveryday, whiletryingtostayfreshandinterestingasthematerial
movesalong.Unfortunatelythedetailsinsomeareasarenotcoveredas
wellassomereadersmaylike.Iencourageyoutogivefeedbackthrough
the publisher’s website to tell what areas you would like to see covered
in more detail. They may be included in future revisions of the book.
I hope you enjoy it. Furthermore, I hope you come away with a greater
understanding and appreciation for all thingselectronic.
1.1 The disclaimer
Throughout the book, I make reference to values that are convention-
ally used throughout the United States. For example, I may refer to
electrical power being distributed at 60 Hertz. This is not the case in
many other parts of the world, where electrical standards differ. I tried
mybesttoexplainothercommonscenariosthatareusedinotherparts
of the world. In some cases, however, it’s not easy to generalize these
things.
Similarly, the nomenclature for electrical standards used in the book
aretheonescommonly usedintheUS.Thesamenamingschemesand
conventions may not be used in the same way throughout the rest of
the world.
You may find terminology in this book that, if you already know about
the concept, may seem illogical. For example, when talking about AC
waveforms I sometimes refer to it as an AC Voltage. The direct mean-
ing of Alternating Current Voltage doesn’t make sense, but the logical
concept of an alternating voltage does. I consider this notation similar
to referring to an ATM as an ATM Machine. It’s simply the convention
that is used most commonly when teaching about the concepts.
Sometimes in order to help explain a concept I use an example and
a picture that help to describe what’s going on. On the surface the
Reporterratum
thiscopyis(P1.2printing,November2007)
NOTATION 10
description is logical, but the underlying physics may actually explain
something different. For example, the description of electron flow is
described somewhat in terms of atom-to-atom jumping by electrons
though the actual physics is a bit different. My goal is to use the more
simplified approach in the explanation. After reading the text, I highly
recommend a visit to the website http://amasci.com/miscon/eleca.html
which has a list of popular misconceptions about electricity.
In some instances the dates of historic events are different based on
the source. When unable to find multiple reliable sources, I tried gen-
eralizing the date to a time period. Even in the case of multiple source
verification, sometimes it’s still possible to be incorrect at pin-pointing
an exact date.
I welcome your errata and suggestions as to making the book a better
resource for people wanting to learn about the topics contained inside.
1.2 Notation
In dealing with very large and very small numbers, we sometimes use
theconceptofscientificnotationthroughoutthebook. Thismeansthat
instead of writing a number like 5000000, we would write it as 5 x
∧
10 6, or simply 5e6. Similarly, 2.4e-7 would be scientific notation for
0.00000024.
Sometimes to deal with large and small values, we use SI prefixes,
which come from the International System of Units1. For example,
instead of writing 0.003 amps we write3 milliamps, or simply 3 mA.
1.3 Organization
This book is divided into threemajor sections:
ElectronicFundamentals
Inthefirst section ofthebook,Basic Electricity, wetaketheatomicfun-
damentals and expand them into the concepts needed to understand
electricity at its basic level.
1. seehttp://en.wikipedia.org/wiki/SI_prefixforthelistofprefixes
Reporterratum
thiscopyis(P1.2printing,November2007)