Theo Verelst Digistuff Page

Or how one can built one's own computer stuff

Funny enough, I've never seen textbooks like the ones I've had from the (public) library when I was 11 or so again. There are electronics do-it-yourself books, most not too instrumental at explaining all the details that are quite essential (such as soldering skills, what type of parts are available, what's a reasonable tools set, and what are the prerequisites for a succesfull hobby), though I'd say most areas of electronics are covered. I'm not sure they're not out there, but for someone that whould like to play around with very basic (but very powerful, really) digital circuits, I lately saw no starter books that built up to a practical knowledge of circuits.

To built a PC, no-one in their right mind would start using basic digital building blocks, you'd prabably hobby around with mother boards, CPU's, various disk drives, of which there is quite a variety. but it will never teach you how those things realy work, and know quite a lot of electrical engineers (not even to mention informatics students)would have few clues as to how the basic circuitry in a PC can be put together without simply plugging and playing++, let alone how one could engineer a real computer from REAL basic building blocks.

I decided to do this page in a semi-course way, so I'll even start at the transistor level, and give some examples on how standard, cheap TTL based IC's can be put to real work. Simply put, I want to explain the mechanics, understandable for a reasonably intelligent and interested layman, and end up making serious circuitry understandable to the point of building them yourself.

If I feel up to it (time and effort-wise), I might do this more full-blown, complete fashion, hell I might even make a book out of it. Some kiddos are bount to find it enjoyable, at least.
 

1. Required Electrical Knowledge

1.1 Voltages, currents, and power: a lamp and a supply

Everybody knows about  220/127/100 Volts (depending on the continent), and most will understand that a lamp can be made to burn when a circuit exists that connects the two supply wires with the two poles of the light bulb, and that a switch is a mechanical device that can break and make that circuit at will.
 
a light, a switch and power supply
When lit, the lamp consumes power, that is it extracts power from the supply through the current that runs through it. In electrical language, the voltage over the lamp (in Volts) times the current though it (In Amperes).

A valid comparison is that the voltage is the height difference between two water levels, a supply creates the height difference by 'pumping up' the water on one end, and the amount of water that is transfered between two water levels, by 'falling though' the lamp and conversely being pumped up by the supply is a measure for the current.
In mathematicians formulas:

V = I x R
==> R = V / I
==> I = V / R

Where V is the voltage measured in Volts (V), R the resistance in Ohms (*), and I the current in Amperes (A). This law is called Ohms' law, after its inventor, and it gouverns most fundamental electrical circuit behaviour.

In daily life, it is not common use to apply it, except when replacing fuses, the lamp acts as a resistor, the mains supply is the supply, and the current rating is on the fuse. The total resistance of the network 'behind' the fuse in Europe can have a resistance of R= V/I= 220 V/16 Amps = 13.75 Ohm.
To let the same current run though a resistor (the equivalent of the circuit of lights and appliances) fed by 110 Volts, a resistor of R = V/I = 110/16 = 6.875 Ohms. In other words, when the voltage is reduced to a half, the same current will be drawn when the resistance is halved as well.
How about the power that is consumed? We all know that more power requires a fuse with higher rating, and in fact a proportional relation holds: the more current, the more power, and the more voltage, the more power, in formula:

P = V x I
==> V = P / I
==> I = P / V

Where P is power in Watts (W). When A light bulb is seen as a resistor, that is that the current depends on the voltage applied in a straightforward way, it is noteworthy that when the voltage is doubled, the current automatically doubles as well, so that the amount of power quadruples!
 

1.2 Graphing

Familiarity with graphs is a good means to understand a lot of circuit measurements. An everyday example would be plotting the temperature in a room against the hours in a day. The graph could then show when the temperature is lowest, when is reaches its peak, where it is stable, where is changes the most, and what the curve is: nice and smooth, straightforward, lots of changes, or jumpy (which is hard in case of temperature, due to the slowness of heating up a whole room).

Supppose we draw a graph of the voltage over a lamp against the current through it, a simplified graph is a straight line: more voltage --> more current. When the power rating of the lamp is low, the current goes up only slow with the voltage, when the power rating is higher, the sampe voltage will draw more current, so the graph is steeper.

Actually, and this is where a graph has a clear advantage over a formula, the current through a lamp is not realy proportional to the voltage applied to it, but a low voltage is relatively high, because the resistance of the lamp is higher at low temperatures. The resistance can be seen as the slope of the graph for a certain voltage.
 
 

Voltage versus current over an idealized and actual lamp

1.3 Diff'rent Frequencies

Imagine switching a lamp on and of at a fixed rate, lets say once per second: half a second on, half a  second off. That means that the graph of 'lamp burning' in time looks like:

   Lamp
   On           _____       _____       ______
           ____|       |____|       |____|
   Off
           |<-------->|
            1 Second

           ---> Time
The lamp is then pulsed with a frequency of 1 Herz (Hz). Suppose it would flash 5 times on and off per second, that would be a flashing frequency of 5 Herz. The human eye can see about 15 Herz 'flashing' at least, higher than 25 to 50 Herz, it just sees the average, 50% of the total lamp power. Lamps themselves are slow, too. When they carry high currents, for instance halogen lamps that run at twelve volts and for instance I= P/U = 60/12 = 5 Amps, they contain thick wires are heated up, so they might glow for another second or so when turned off. Ordinary european light bulbs of 60 watts run at 220 Volts, and therefore draw a current of about I= 60W/220V = ca. 0.28 Amps, or 280 milli Amperes. Such a light bulb has a much thinner wire in it, that lights up and cools down a lot quicker, and is therefore more suitable for light-organs, for instance.

In frequencies: neon lights could show frequencies up to the sensitivity of the eye: up to about 25 Herz (Old 'flicker' movies), ordinary lights a few herz, and low voltage, high power lamps about 0.5 Herz.
 

1.4 Simplicity rules

When dealing with complex situations or structures, simplification is the rule to use. Simplifications shouldn't be confused with what 'realy' happens. This even holds for the reasoning involved, the infamous example of inverting the statement 'it rains, so the streets are wet' proofs this: it is temping to assume that the inverse can automatically be deduced: 'the streets are wet, so it rains', which on second thoughts is clearly an untrue statement!

Apart from the logic, the simplified models of parts can cause inacuracies in the behaviour of a circuit composed of it. For instance assuming that two lamps of 60 Watts will allways produce the same amount of light is not correct. A halogene lamp or TL tube has higher efficiency than an ordinary light bulb, meaning that they produce less heat and more light for the same voltage and current fed to it. But still, assuming that measuring the amount of light coming out of them is enough to accurately model them, would put a photographer of, because he (or she) would know that the colors of these types of lamps are quite different.

The same holds for the way a lamp is switched on and off.
A more accurate graph would include the heating up and cooling down curve of the lamp, and it would look a lot smoother. When switched on, the lamp first heats up quite quickly, but at first without producing light (until a few hundred degrees Celcius or so), and eventually it slowly reaches its maximum temperature and light yield (for some spotlights that may take up to minutes).
The electrical picture makes this even more complicated.
A combination of the way the lights' wire heats up against the temperature of the environment, and the amount of power per lets say milli second the lamp consumes as a result of its resistance and the supply voltage, which also depends on the current the lamp draws, determines the accurate curve of how much light is produced at each time instance.

Forgetting all this is enough for more than 99% of the times one thinks of a light, switch on: light, switch off: dark! Simple.

In other instances, it is sufficient to simply know that a lamp more or less smoothly heats up in a fraction of a second or so after the switch is operated, and for real advanced thoughts, one may want to compute exactly what happens.

The second example is the way an electronician may look at it, the third a scientist, and the first way is what a light show or digital designer likes to limit himself to, because that way a complex circuit still can be easily modeled: light on or light off !

When she (he?) wants to make a photograph of what is going on onstage or in a computer, the second and even the third way of looking at what's going on may be needed to get to the core of things. This should be remembered when following this section we'll look into the wonderfull world of digital circuits, because they too exhibit quite complicated behaviour when things get realy though.

Imagine a lamp is used as a morse signal transmitter: light on '1' or 'dash', light off '0' or blank. A fast morse operator could not use a stage light at full speed: it wouldn't turn on and off fast enough! Then again, a good morse reader might see it dim and light up as morse is fed through it, and still try to decipher the message.
A computer has tens of millions of equivalent light switches and lights in it, turned of up to billions of times a second (Giga Herz, 1,000,000,000 Herz), and each one of them can mess up the same way as I just described. Then is pays to realize that the 'switches' and 'lights' are not ideal, but models.
 

2. Basic circuits

2.1 A voltage supply

For most of the experiments in thi text, it suffices to have simple wall-wart supply, that delivers 5 Volts in a DC, stabalized fashion. That means that the output voltage doesn't alternate, as the main supply does, and  remains stable when the supply is loaded. An unstabalized supply would have a changing output voltage, that is it would be constant. A stablelized one has electronics in it that makes sure the voltage remains constant when the current is limited to for instance 0.5 Amps, its current rating. Not all of those little plug-boxes has a voltage that is adjustable to 5.0 volts, which in fact would be ideal. 4 Volts would be second choice, 3.5 may work for most circuits, but is not recommendable, 6 Volts works for the recommended 74HC digital parts and most circuits.

In case of doubt, or unavialability of a 5V stablelized wall-wart,which normally should be readily and cheaply available, electronics stores will sell dedicated 5V supplies for reasonable prices as well, and they are of course preferable.

In case of a plug-supply, be aware of the + and - of the connector, usually it is indicated on the box or on some label. Logic parts usually DO NOT SURVIVE a reverse voltage!!! Plus is + and - is minus or 'ground' or 'earth'.

2.2 A LED

A Light Emiting Diode is basically a little lamp. They come in an incredible variety of shapes and colors, but the ones we will use are very basic, around for more than 25 years in fairly unchanged fashion: two wires and a 3 or 5 mm diameter cone containing the usually Gallium Arsenide based semiconductor, that emits visible light when a current is fed through it. In this form where about 20 milli Amperes is a reasonable current, at a voltage of about 1.5 Volts, the little lights can be obtained in any electronics store for under a dime a piece, ask for a 'led' and they'll ask you what color you want out of red, green, or yellow, though blue, white and orange exist as well.

They virtually live forever when treated well, they are complety shock-proof (unless you hammer it to pieces), and are very suitable as digital indicators.

2.3 Hook up a gate circuit

2.4 And more

3. Build one yourself !

3.1 Getting the parts

3.2 The breadboard put to use

3.3 Organizing board space

3.4 A supply

3.5 LEDs and resistors: light

3.6 74HC00 and gates

4. Testing and Troubleshooting

4.1 1s and zeros

4.2 Speedof light ?

4.3 Switches