Theo Verelst Diary Page

Latest: 27 december 2000

I've decided after good example to write some diary pages with toughts and events.

Oh, in case anybody fails to understand, I'd like to remind them that these pages are copyrighted, and that everything found here may not be redistributed in any other way then over this direct link without my prior consent. That includes familiy, christianity, and othercheats. The simple reason is that it may well by that some people have been ill informed because they've spread illegal 'copies' of mymaterials even with modifications. Apart from my moral judgement, that is illegal, and will be treated as such by me. Make as many references to these pages as you like, make hardcopies, but only of the whole page, including the html-references, and without changing a iota or tittel...

And if not? I won't hesitate to use legal means to correct wrong that may be done otherwise. And I am serious. I usually am. I'm not sure I could get 'attempt to grave emotional assault' out of it, but infrigement on copyright rules is serious enough. And Jesus called upon us to respect the authorities of state, so christians would of course never do such a thing. Lying, imagine that.
 

Previous Diary Entries
 

Dec 27, 2000

A peak in my diary page concentration appearently is coming up, I'm awaiting employment possibilities, hopefully on short enough term, though I prefer not to be all to specific at this point, because much has gone on, and I don't want to be in my own way at this point.

I think the writing about subjects I don't always find pleasurable at least makes clear what has happened and what I have perceived, and thus may clarify things, be of interest to others, and in some cases be of general value. Today I dare and truth my thinking about the elevated and potentially dangerous subject, the Holy Spirit.

The body the soul and the spirit

The three major constituents of man, I think, where the soul is the mind, the heart as center of our feelings, memory, etc. The body is clear, and the spirit is, well the spirit, containing spiritual faculties, being by nature dead, that is separated from God.

Supposing that God is for real, and that "God is spirit", an important question is: can we be in touch somehow, spiritually, with God? Primarily, this would seem up to Him. If He is indeed God, it seems logical He can do what He wants, and if He then chooses to make Himself know to man or a man / woman in some way, He doubtlessly can. In fact, in the old testament, that is what he did.

As an aside: I write capital letters for God, in normal language this is non-essential completely. I sometimes add 'in my opinion', because I'm aware of the weight of the subject and the amount of teaching that is done in many names that claims all kinds of things of great effect without even starting to challenge their own authority and the truthfullness of what they teach, and I, though not at all affraid of or against authority, would like to stay down to earth when called for, and make clear I'm aware of the fact that some things in religeous areas are hard to prove, and that it can be of significant value to test thouroughly what is true and what is to be considered apert error. Finally, I do essentially and practically believe (think) there is a God, and that Heis almighty and good even, and various other properties, and even that He made and makes Himself known, also personally, but I am all to aware of it that that makes me a limited human being in comparison, and that on the other hand it makes me responsable for such knowledge, also in dealing with Him and his words as a subject that requires care and seriousness.

As I pointed out, the old testament is full of God making himself known to mankind, and of people that claim to have received words, visions, and attention from God. And I mean God, as in to distinguish from some deamon or impersonator that also may claim to be even the mother of God themselves, which of course is complete and often evident nonsense. In the OT, it appears that mostly the spirit of god sort of 'came over' a person, who then would either communicate with Him, or prophesy, such a Isaia.

Many years ago, I learned that, as made clear in for instance Romans, man spirit is dead from God when we are born, that means something has to change (if we're lucky in that sense) to restore our capability of communicating with God. I'm sure He is still perfectly capable of being aware of someones' thinking, but it is not until through Jesus a person is given a new heart that he or she is capable of communicating with their then heavenly Father, that is after a person is what the bible calls born again. Also I learned, which is directly from that same book, that such an event is a 'sovereign' act of God, that is He makes that happens when He want, needs to consult with no man or other being to do so, and in fact it only happens when He has planned so, and made it happen. A priviledge not given to every person, and in line with His eternal plans, because in various places it is made clear, "whom He (pre)destined, He also called, who He called he justified (in HIs son), ...", that indeed God has an eternal plan, which He carries out the way He wants.

On itself, that is a strong thing to say, but then again the principle of an almighty God is, too, and these subjects are clearly covered in biblical sense, and thus far I don't have reason to think such doctrines cause inconsistencies when I read all bible books, on the contrary, a quite clear, repeated image seems to emerge.

After a person has the capability to in their own spirit be in touch with God, he or she (so at least there is no misunderstanding, there is hardly a difference in all these and related subjects between men and women in these biblical senses) may also ask for the Holy Spirit to live in them, so that they invite Him to fill them, and enable spiritual gifts, primarily the speaking as tongs as proof, as on pentecost day, see acts.

Acts 2:16-, quoting the old testament prophet Joel "But this is that which has been spoken by the prophet Joel 'And it shall happen in the last days, God says, I will poor out of My Spirit on all flesh; and your sons and your daughters shall prophesy; and your young men shall see visions, and your old men shall dream dreams; and also I will pour out my spirit on My slaves and slave-girls in those days and they shall prophesy...'"

In old testament thinking that must have been quite something, no special prophets who occasionally hear or speak Gods words, but all His own with those possibilities.

Logic

At a time I thought I would have opportunity, I sort of promised to continue the pages on logic or basic computer circuits.

Some time ago I in organized form though about the circuits that make computers tick, as in explanantion to intelligent enough people with serious interest to in some detail understand what those machines are made of.

I'll do a short version as it feels right. First: logic. Suppose we have something, a variable, a statement, a signal, that can be either true or false. Then we could some that up by saying true equals one (1) and false equals zero (0). Now lets assume that we can say something using only this binary logic, binary being only two possible logic values are distinguished, i.e. no 'maybe' or 'often', and such, just true or false.

The simplest operation we can do with this type of logic is probably inversion. Inverting true is false, while the complement (another term to indicate logic inverse) of false is true. Lets make another logical function, that is a formula with logical values, the AND function. Suppose the AND function takes two input values, and has one output value, then we could specify it by putting all possibilities in a table:

  in1 in2   |  out = in1 AND in2
  -----------------              |------|
   0    0   |   0         in1 -->|      |
   0    1   |   0                | AND  |--> out
   1    0   |   0         in2 -->|      |
   1    1   |   1                |------|
We start with taking both input values as false, or '0', then the table says that the result of the and function is also false, '0'. The same happens when only one input is true, the result remains untrue, or 0. Only when both input values are true, or '1', the value after applying the AND function becomes true. Another way to look at this is having a unit, a building block, with two signals going in, and the and-ed combination of these signals coming out.

As an alternative, lets take a NOR funtions, which is an OR follwed by an inversion, or 'NOT':

  in1 in2   |   or  |  out = NOT (in1 OR in2)
  -------------------------              |------|
   0    0   |   0   |   1        in1 --->|      |
   0    1   |   1   |   0                |  OR  |o--> out
   1    0   |   1   |   0        in2 --->|      |
   1    1   |   1   |   0                |------|
Now the result of all 4 possible input values is first that the OR function is satisfied to have at least one of its input as true to give a true result. That means only when both input lets say 'signals' are 0, the output 'signal' of the OR is 0, otherwise it is 1. The output signal is then inverted, i.e. 1-->0, 0-->1, so that it finally is only 1 when the two inputs are zero.

Now whats the point? Two things. First: these building blocks exist, you can buy then even, they operate on voltages of 0 and 5 Volt for false and true signals, respectively, they are mighty fast, and your pentium, electronic wrist watch, probably your microwave, wireless telephone, and all other digital machines use them. Second, it makes sense to think in such functions. For instance a microwave must operate only when the door is closed AND there is food in it AND the operator button is pushed. Alternatively, an alarm must cease lighting an 'ok' signal light when the doors closed forced OR the window is broken. Clear enough, an extra signal 'arm alarm' is desirable. Also, a time delay may be desirable, which is outside the scope of plain logic circuits, though of course possible.

Digital circuits like this were available per 4 in a case already at least 25 years ago. They were called TTL for transistor transistor logic, and became very popular, every electronics store would have them, and that is still so. Little black plastics with 7 or 8 pins on each side, $.50 or so a piece. The TTL series can be recognized by their type number, which always starts with '74'. So a 7400 has 4 2 input NAND gates, a 74HCT04 is a contemporary 'High speed CMOS Ttl compatible' version of the same chips range, with 6 inverters. There are easily hundreds of numbers in use for various types of functions, of which we'll see some others, they all work similar: voltages of either 0 Volt or 5 Volt are applied to inputs, and after a humanly negligable time theoutput will adjust itself to the result of the logical function of the inputs, also speaking binary language of either a low or a high voltage of roughly 0 respectively roughly 5 volt.

And fast is fast, already 20 years ago, these chips would respond to changing inputs fast enough to accomodate up to 10 million changes per second and higher. Current chips at least run up to 200.000.000 changes per second, still keeping its output correct as the result of the logical function it is suppose to apply to the input signals.

Because the signals are so simple, there is nothing against using any combination of these circuits, to any size and dept almost. A simpel example is to put 6 inverters in a line, which evidently would do nothing to the signal, except a tiny delay! More usefull generally is to combine for instance to 2 input AND gates together to arrive at AND functions with more inputs, for instance like this:

  in1 --->|-----|
          | AND |--| in1 AND in2
  in2 --->|-----|  |
                   |--->|-----|
                        | AND |---> in1 AND in2 AND in3
  in3 ----------------->|-----|
The principle can be repeated, and any logical function can be made this way.

Numbers

Just to cover an important subject for certain types of inportant logical building blocks. We all know what a hectometer, a car distance meter, works like: little wheels are connected with the wheels, and as they turn, the most right wheel with digits from zero to 9 start 'counting', and as it does full circle, it increments the wheel on its left by one, etc. The interesting point of course being where there are 5 9's on a row, but hten the same principle applies: digits go from 0 to 9, and when they flip back, the next stage goes up one.

Binary counting goes the same:

   0 0 0 0    0
   0 0 0 1    1
   0 0 1 0    2
   0 0 1 1    3
   0 1 0 0    4
   0 1 0 1    5
   0 1 1 0    6
   0 1 1 1    7
   1 0 0 0    8
   1 0 0 1    9
   1 0 1 0   10
   1 0 1 1   11
   1 1 0 0   12
   1 1 0 1   13
   1 1 1 0   14
   1 1 1 1   15
except the wheels have only two numbers, 0 and 1, so they turn a lot more often. As most know without realizing, a numbers value is made by multiplying the weight of a digit with its value, and adding the results for all digits. 1999 means 1 times a thousand plus 9 times a hundred plus 9 times ten plus nine times 1. Digitally, this is the same: 101 means 1 times 4 plus 0 times 2 plus 1 times 1 (equals 5). The weights are based on the number of values per digit: 10 for normal numbers, 2 for binary numbers. Powers can easily give the right weight for each digit in a number: the base of the number system to the power of the digit starting to count with zero at the right is the weight. For instance the 4 in 6643392 has a weight of ten to the power of 4 equals 10.000 . The weight of the 1 in 1000 is two to the power of 3 equals 8.

Note that the patterns of the bits in the table are regular, just like one would expect from writing normal numbers in a table. The most righthand one changes all the time, 0 1 0 1 0 1 0..., the next one to the left does 0 0 1 1 0 0 1 1, then 000011111, etc.

Adding numbers

It can be imagined that it is possible to go from one number system to another, using the table for instance, and that computations can be done in binary form, and then the results put back in decimal form. This is essential for computers, who work with binary numbers.

As a clarifying example, we'll look at an overseeable logic function, which can be made with what we've found above, to do additions. It is actually possible to make a design for this function with the and / or / not blocks we've seen above, which can actually add numbers of arbitrary size at amazing rates (many millions per second) as long as we keep our head together.

Lets first see how we do additions:

carry:         1      1
      357     357     357     357
      258     258     258     258
      ---+    --++    -+-+    +--+
sum:            5      15     615
we apply the same operation on each combination of corresponding digits, we generate a sum digit and a carry digit from the previous carry and the two digits above eachother.

Now lets do the same with two digital numbers:

carry:           0      1      1
       0010    0010    0010    0010    0010    = 0x8+0x4+1x2+0x1 = 2
       0111    0111    0111    0111    0111    = 0x8+1x4+1x2+1x1 = 7
       ----+   ---++   --+-+   -+--+   +---+                      --+
sum:              1      01     001    1001    = 1x8+0x4+0x2+1x1 = 9
Appearently, the same logic works, which can be formally proven in number theory, and understood by thinking about an phone ticker for instance.

Without wanting to push complication, we'll go straight to the binary functions needed for the binary addition, by simply making a table for all possibilities, which for two decimal digits would take a table of 10x10 equals a hundred long for both the sum and the carry, but for digital numbers is only four long:

  a  b  |  sum  carry
  -------------------
  0  0  |   0    0   
  0  1  |   1    0
  1  0  |   1    0
  1  1  |   0    1
If we make what is called a 'half adder' because it doesn't do the whole job of also adding up the 'incoming' carry from the previous stage, this diagram is sufficient, and immedeately shows that we can use a AND function for the carry signal. The other signal, the 'sum' signal, is only high when either of its inputs high, not both, which is called an exclusive or function, or EXOR block. We'll find a way to make such a logic function block by using the 'standard' functions AND, OR and INVERT.

AND OR planes?

It is interesting to look at this problem from a generalistic point of view, lets say we want to make a recepy to in principle turn any truthtable into a logical function made out of the basic logical function blocks. Suppose we take the view where we say that the result is always zero, except when it is one, and we are going to make it automatically zero, unless we detect a combination of input signals where it should be one.

Now suppose that we have a way to detect a certain combination of input signals in general. Then we would make a circuit for each input combination that gives a 1 at the output, and combine them all into an OR gate (another word for logic circuit) with enough inputs, which will then make the output high when one of the desired input combinations is present. That should work, but how can we detect a certain combination of inputs, said differently, how do we detect exactly one binary number. If we see this as finding a compbination where all bits, or binary input digits, must fullfill a certain criterion, the logical function that comes to mind is that the 0th bit, AND the 1st bit AND the second bit, AND the 3d bit, ... etc. must all be as specified for the target number. So if we look at for instance a circuit that is capable of detecting lets say the pattern for 'five' out of a four bit (binary digit) number, it would require a certain operation per bit to see wether it has the specified value, and then a 4 input AND to make sure all conditions are fullfilled.

  5 -->  0101   ( 0 x 8  + 1 x 4  + 0 x 2  + 1 x 1  )
    bit: 3210    b3       b2       b1       b0

  b3  --  ?  -->|-----|
  b2  --  ?  -->| AND |---> 'this number is five'
  b1  --  ?  -->|     |
  b0  --  ?  -->|-----|
In the figure we assume we can check wether the bits 0 through 3 have the required value, and when hey all check right, the AND function will output a 1, otherwise a 0. Itis not hard to see that if we want this to work for just five, or some other fixed number, it suffices to invert the zeros in the 5 bit pattern, so that for the right number the AND receives all ones, and just feed through the ones!

Now suppose we make this work for every line in the table with all 16 (2x2x2x2, or 2 pow 4) four bit numbers , then it would be most convenient to make the four bit lines run for instance run vertically, and then provide the inverted signals, too, and then feed the right signals to the and ports of each line in the table, selecting exactly one number combination. For a 2 bit digital number this would look like:

   __      __
   b1  b1  b0  b0                          -- OR ----> out
   |   |   |   |                           |
   V   V   V   V                           ^
   *       *         AND --> out0    -->     
   *           *     AND --> out1    -->   *
       *   *         AND --> out2    -->   *
       *       *     AND --> out3    -->
As example, lets say we make the first bit high, and the second low, then we have 10b (the b for binary), which of course is 2 decimal, then only one AND gate in the diagram will have both inputs high, which is the one where bit 1 is not inverted, and bit 0 is. The line above the binary signals on top means inversion.

Now we could take any of the out0 .. out3 signals together into a OR gate, to make a signal that respons to any desired input combination. In the figure I've indicated that the out1 and out2 signal are put into an OR gate, that will make the overall output go high with the combinations 10 and 01, but not for 00 and 11, just like we needed for the adder circuit. We could use another OR circuit to generate another signal, such as the carry signal, for which only a one input OR would be enough, which is of course not needed. Also, the first output line isn't needed, it is never used.

From this exercise, which works just the same for 8 bit numbers for instance, except that there would be 2x2x....x2 = 2 pow 8 = 256 lines in the diagram, and we'd need 8 input AND circuits per line, we can also extract the logic gate diagram that now remains. The advantage of this general method being that is always works, but it may give too big a circuit. In fact for the sum signal, we've selected the input combinations for 10b and 01b with inverters and ANDs, and made an ouput signal by OR-ing the AND output signals together.

Without drawing the diagrams (kind of unnice in ascii symbols), we now have the circuits to generate sum and carry for binary numbers. One more problem remains: what happens if we have incoming carry? The simplest, working, solution is to combine two of the 'half' adders together, to arrive at what is called a 'full adder' circuit. Which we can now built from actual logic circuit, repeat for each binary digit (bit) of the two numbers to be added, and we have a binary adder! Such circuits are prepared already in the 74 series, where one chip contains a number of them. Circuits of similar nature (possibly in logica sense the same) have a place in a pentium chip, except that special provisions are made to make the carry signal faster.

These AND-OR plane type of circuits are used and offered as products, for instance I recently found some Xilinx chips, that can be programmed with similar behaviour.

Flip Flop

Without making this into a full fledged course, we seen the major combinatory circuit thought underlying digital designs, and it is time to proceed with a major new concept: memory. Logical circuits like the above don't remember what is in them, so we need a circuit that somehow remembers what we tell it.

  a  >------>|------|
             | NAND |------->  Q
        |--->|------|   |
        |               |
        |------\ /------|
                X
        |------/ \------|
        |               |
        |--->|------|   |     _
             | NAND |------->  Q
  b  >------>|------|

The above circuit has two AND-INVERT gates in it, which is an AND gate followed by an inverter. Without going into all the background information, which can be considerable, this circuit, which can easily be built from a cheap and easily available 7400 circuit, can remember one bit of information.

When both a and b are high (1), both NANDs have at least one input high, so that the and will give a one when the other bit is also high, and a zero when the other input is 0. That means that the NANDs are made to invert their other input bit, when the a and b signal are kept high. Furthermore, it is clear that two inverters on a row don't change a signal, 1-->0-->1, and 0-->1-->0, when we put them in a circle, as in the circuit, they can then be thought to remember a signal that started 'running around' through them. By shortly making a or b zero, the 'state' of the two NANDs feeding eachother is forced into a known one. When a is made zero, the top NAND will output a 1 (because when one of the inputs of the AND is zero, its output is zero, and is inverted to 1), the bottom one still simply inverts the signal from the top output, which makes its output zero, and after a is made high again, this pattern remains.

When b is shortly made low, the inverse happens, so the Q output becomes zero. The 'truth table' for the whole circuit now looks like:

         _
  b a  Q Q

  0 0  1 1
  0 1  0 1
  1 0  1 0
  1 1  X X  'memorize'
Normally, Q and not Q (with the dash) are eachothers inverse. Either an a or b signal force the circuit in a known state, which is remembered when both are high. When a and b are both low, a normally not used state results, which should not be directly followed by a 11 input pattern, because then the result is unknown, it depends on which gate is just a bit faster. The X's mean 'undefined', it depends on wether 11 on ab followed 10 or 01.

Sampling a bit

The above circuit is fun enough, but a bit unhandy, because it requires juggling two signals in a not too natural way. We'll add a gate-ing circuit to make it more usefull. A 'gating' circuit either blocks a signal, or feeds it through:
  a   >---------------->|------|          _
        |               | NAND |------->  Q
        |          |--->|------|   
        |          |               
        \          |
 Gate >--|---------|
        /          |
        |          |--->|------|          
        |  |-----|      | NAND |------->  Q
        |--| NOT |----->|------|
           |-----|

Lets see what this circuit does. Suppose the gate signal is low, than both NANDs have one input low, that means their ouput is always high, regardless of what the a signal does. Now when the Gate signal is made high, both NANDs have one input high, meaning they will invert the other input, the upper one then feeds through the inverse of the a signal, the lower one the double inverse of the a signal, thus a itself. So we can either feed through the a signal (and have its inverse), or block it and have fixed ones on both outputs.

That will make an interesting combination with the memory circuit, suppose that the inputs of the memory circuit, which is called a 'flip flop' are connected to the q's (a letter often associated with outputs, as a habit) of this gating circuit, what would happen? Looking at the combination of truth tables, it would seem that if the gate input signal is high, the signal from the a input appears at the outputs of the gating circuit, both inverted and non-inverted, and we know that when either input is low, the memory circuit simply follows the input in an inverted manner. Thus, after two inversions, the a input simply appears at the flip flops' output, and also inverted at its not-q output.

The interesting part is now to make the gate signal low, so that as we have seen the outputs of the gating circuit become both high (1). We know that then the flip flop behaves as a memory cell! That means the signal at input a at the moment the gate signal is made low is remembered at the output of the flip flop, either 0 or 1. Presto, a memory device that can sample and store a digital signal.

Of course, the circuit is not very simple, although 5 gates is not complicated, and there are some pitfalls, mainly in the timing department, but its realy not a bad circuit, and it can be used as a computer memory cell, just like it is in these diagrams and actually work. It is not hard to imagine making a number of these circuits in parallel, which each remember one bit of information, so that more bits can be remembered at on time, to make a memory word of some width, for instance to remember a byte = 8 bits, inputs a b c d e f g h would all be remembered by their own memory cell, and probably have all the gates connected together to control the memory or pass through function of the whole word memory.

These kinds of memories are called latches, or pulse triggered memory cells, because they feed data through all the time, until the gate is shut. That is it doesn't just remember the data at the moment the gate is 'closed', it copies the input all the time when the gate signal is high. An example of a TTL series circuit that has 8 of these cells with a common gate is the 74573 of which I use 8 or so in my current synthsesizer microprocessor system.

In the next section we'll look at a more refined way of storing bits without the continuous feed-through of this gated memory cell, which we can also use for making the important counter and shifting building blocks.

The master slave flip flop and its raison d'etre

Suppose that we would like to make a circuit that with each pulse (high low or low high sequence, depending where we start) changes state. That is the output is first a zero, then we let the gating signal go from 0 to 1 and back to 0, then the output must be a one, then we cycle te gate from 0 to 1 and back to 0 again, and we want a 0 again on the output.

Why we may want that will be clear furter on. It looks like moving a bit around, and we may be tempted to simply connect the output of a flip flip back to its input, with an inverter. That would not work, because when the gate is open, the bit would continuously be inverted, fed back, inverted again, etc. The brilliant enough and straightforward solution is to but two of the flip flops of the previous section (as a whole) in series.

       |-------------------------------------------------|
       |   |----------| Q       a2 |----------| Q        |
(a1) >---->|  Flip    |----------->|  Flip    |----->    |
           |  Flop 1  |      gate2 |  Flop 2  |          |
gate >---->|          |-      |--->|          |----->----|
       |   |----------|       |    |----------| _
       |                      |                 Q
       |      |-----|         |
       |----->| INV |---------|
              |-----| 

         ______     ______      _______
 gate  __|    |_____|    |______|     |__

              V          V            V
              ____________            ___
  a1   _______|          |____________|
This diagram shows the idea, where a Flip Flop unit is a gating circuit connected with a set reset flip flop consisting of two cross coupled NANDs. The gate signal for the first circuit is inverted for the second, the first ouput signal is fed two the second flip flop, and the inverted output of the second flip flop is fed back into the first input.

Below the circuit diagram, the input signal (or inverted output signal) is plotted as a result of the gate signal being toggled. Basically what happens is that when the gate goes high, the first cell will read the inverted output signal of the second cell, which will not change, because when the gate is high, the second gate is low. Then when the gate goes low, the first cell remembers its bit, and the second cell feeds it though, which is the opposite value of the previous state. Then the whole cycle starts over again.

The main trick is that the second cell is switched from signal follow to store operation at the same time (minus the small delay in the inverter) the reverse happens for the first cel, so the bit that is stored never 'races' through the whole circuit. This can also be achieved by making a very narrow gate signal, just long enough to make one bit flow through, but that is very tricky, temperature dependent, and not theoretically pleasing, while this circuit works fine, understandably well.

It is called a master slave or edge triggered flip flop or memory cell. This memory cell is not just commongood as memory cell, but also, as it is connected up here with the inverted output back to the input, as divide by two circuit. Remembering the phone ticker counter or other examples, we now that a 0 to 1 and back circuit may be used to count binary, from 0 to one and back. Now lets make another MS FF, and connect the gate to the output of the first, then we have made a count to four circuit! Adding more section can give us count to 16 or 256 or more. In a pentium for instance, the program counter can count from 0 to 4 billion or so by having 32 bits that can count this way.

This very relevant circuit can also be put to other uses, and then we have mastered the main circuits to start making atually usefull computer circuits. No kiddin'.

Running lights

When I was in 5 grade or so in primary school, I was handy enough with wires and some electronics parts, and I found it absolutely mind boggling how it was possible to make a running light. You know, a line of lights, and first the leftmost one lights up, then the second, then the third, than the fourth, then the first again, etc. As if the light spot is walking over the lights. Fascinating I found that, how would that work? I thought at first I missed something trivial, I knew I cound make something like it with capacitors as delay elements, but the didn't make it as nice and in the way t was desirable.

It wasn't until I read books on digital circuits that I understood it was not at all trivial, but than considerable amounts of digital gates were needed to make such a running light. Also, quick as I would learn when I liked it, pretty soon I made my own and didn;t think much of such a relatively simple circuit anymore...

There are two ways to go about this problem, I start with the easiest one to understand. Suppose we take a row of Master Slave Flip Flops, and we simply connect the input of the next to the output of the previous, and we connect what is called a 'clock' signal to all the gate inputs at the same time. A clock is simply a regularly changing 0 1 0 1 0 1 pattern. Now suppose a certain pattern is contained in the flip flop chain, the after the clock has gone from high to low (of the flip flops respond to what is called the negative going edge), each section reads the value of the previous one, so the pattern is shifted by one! The first one could read the output of the last, so the circle retains the pattern, or the first could be a switch to feed the chain, which is called a shift register, with a new pattern.

Note that this works because master slave flip flops prevent the data from racing through the chain, at every clock pulse, the pattern is shifted only exactly one position. Again, pentiums to contain such circuits, they have machine level instructions to make a register of 32 bits shift all bits right or left, the effect being a divide by two or multiply by two (the same as adding a zero or removing one at the right side of a decimal number: the number goes times ten (the base) or is divided by ten).

The disadvantage of this way of making a running light is that the freedom of choosing a pattern in the cells that is shifted, the type of unit as a whole is called a 'shift register', has as disadvantage that the shift register must be filled with the right pattern. That is possible by loading the desired pattern in the register in parallel with some signal, I'll not draw it out here how this is possible, but it can be elegantly built this way, or by first connecting the first cell to a pattern generator, and then to the last cell when the pattern is loaded.

Alternatively, we can make use of the circuit we found that can count binary numbers, i.e. that produces the bit patterns on a row that for instance are used in the truth tables I presented. Then we could connect the outputs of such a counter to the selection circuits we used to select one specific input combination, and again voila: they would be activated one at a time as the counter ticks through all possible binary numbers. This way, there is always one output active, no matter what happens, because the counter always has some value, which always makes one decoded output active at the time.

Bear in mind that those flip flops are made with gates that easily can change value 10 or 100 million times a second, and that thus these shift registers and counters are also that fast. So if we take 20 divide by two circuits on a row, to be able to count to circa a million, we could go over all possible numbers in that million (1 2 3 4.... 1000000) 10 or maybe a hunderd or even more times per second. Not 10 numbers per second, but 10 million per second. Chips to count 4 or 8 bits cost maybe half a dollar. A counter with 20 bits can be made for a few dollars, realy, with parts offered by most electronic stores. Thats what got me interested, too, 25 years ago.

Are there more issues

Oh yes. Many. For instance, can we also count decimal (yes) ? What happens if we want to count the number of times a switch is operated (bouncing makes many counts happen) ? How hard is it to connect these parts up, give them supply voltage, and make them work. What about little lights and displays (they two are easy to get, cheap, and not too hard to use) ? What is a bus (a computer structure where outputs may be connected together and activated only one at the time to 'drive' the bus)? Are there more basic circuits (many: selectors, monoflops, various register architectures, memories, computer/processor units, analog to digital and vv converters, debounce units, counters and shift registers with preset, reset, load, asynchronous or synchronous control lines, synchronous counters and finite state machines in many variations, tri state buffers, multiplexers, JK flip flops, priority encoders, parity generators, multiplier units)?

One thing to be aware of is that it is in principle possible to use unly two input NAND gates to make almost any logic circuit, including a computer, except for some special connections. That is because a NAND can be made into the logical equivalent of a inverter (simply tie the two inputs together), a AND (make an inverter and put it behand a NAND), an OR (invert both the inputs and outputs of a NAND), a NOR (extra inverter, or loose the donble output inverters), and EXOR (see above), and all the circuits mentioned above.

A very major issue is timing. Can be very tricky business when thousands or millions of gates change state all time in a chip or other digital circuit. Worth considerable attention.

Then there are many standard or more exotic/specialistic structures and circuit ideas, for various functions. Clock generators and programmable dividers, memory addressing circuits, arithmetic and logic units, control logic, sequencers, decoder and encoder circuits, parallel to serial and vice versa conversions, various trigger methods, and of course (micro) computer units. Enough for today.

Micro

Just some thoughts I wrote down on possible uses of the microprocessor system described on several of my pages. It may be a calculator, an intelligent measument device, a timer, an interface processor for instance to guard and drive the function of an amplifier system, and it could be used in a radio controlled model (such as the zeppelin described on my pages) as autopilot, navigator, route controller, those are the main obvious purposes for this kind of processor, though many more exist. The calculator could be quite good enough, there are TI calculators with a lot of extras such as graph drawing, integral computation, function approximations, and even programming, that also have a Z80 in them, even at roughly the same speed. I saw schools they are used to also run special programs that can be prepared on a PC and loaded into the calculator, and there are all kinds of libraries and example programs on the internet.

As a measurment device, it would need an analog to digital converter, and then it could use its big display to do voltage, current, resistance, transistor, capacitance and such measurements, and then do computations with them, present them in a handy way, such as a fast response bar graph on the display, or multiple measurement values at the same time. It may be used to record measurements, possible as a logging meter, and with a ad converter up to it it could be applied as an oscilloscope, though waveforms are hard on the led display. A logic analyzer is a good possibility, even with the current printer port interface, that could DMA a logic pattern right into the memory to be analyzed, and the display can display bit patterns good enough.

In fact, that might be a good use for the machine, with some software to analyze the patterns and do nice display scrolling, time marker and such.