Author Topic: Beginners guide to Computer Logic...  (Read 22481 times)

0 Members and 1 Guest are viewing this topic.

Marty Machine

  • Guest
  • Trade Count: (0)
Beginners guide to Computer Logic...
« on: April 20, 2009, 11:41:34 PM »
Beginners guide to Computer Logic...

Ok, sooner or later you're going to see lots of logic 'gates' all over your pinball diagrams.
Here's a simple overview of some very basic logic gates, and how signals turn them ON & OFF.
This will help you later when fault finding if you know HOW the chip should be working.

A logic gate (or a chip full of gates) is nothing more than a bunch of tiny switches.

Let's go thru some REALLY SIMPLY analogies to get the ball rolling.

Before getting into the logic chips, let's first understand simple switching ON & OFF of a small Lamp.

Here's a 12volt battery on the left, wired via a switch, which then provides a supply voltage onto the lamp.
Currently the switch is OPEN, so the lamp is OFF (GREY colour).


Now the switch is CLOSED, so the lamp is ON (YELLOW colour).


At this stage, i'll refer to signals being ON or OFF, although later in the logic gates, they're called "HIGH" and "LOW".

To clarify, These are all mean the same thing :
Switch OPEN = OFF = No Voltage = Digital "LOW" or "0" (zero).
Switch CLOSED = ON = Voltage present = Digital "HIGH" or "1" (one).

Now that we can turn a lamp ON & off, lets add more switches....
By adding 2 switches inline (often termed "in series") we now need BOTH switches to be ON for the lamp to turn ON.
Switch A and Switch B are both OFF - Lamp is OFF.


Switch A is ON, but Switch B is OFF - Lamp is still OFF.


Switch A is OFF, but Switch B is ON - Lamp is still OFF.


Finally, Switch A and Switch B are both ON - Lamp is ON.


What this illustrates is that you need Switch A "AND" B to be switched ON for the lamp to turn ON.

This is referred to as "ANDing" and the equivelant method is to use a chip called an "AND gate":
The "AND gate" is similar to the diagrams above, like tiny switches inside the chip, waiting to be controlled
by the 2 external switching pins (inputs).

If both inputs pins (A and B) are turned ON, then the ouput pin (X) will turn on, just like the lamp previously did.

Here's a real-Life example:
Your car ignition (the X output) will only turn ON when you turn on the ignition switch (input A) "AND" have the seatbelt
buckled into place (input B) - most modern cars do something like this.


"AND gates" can have more than 2 inputs, you can join several "2 input" chips together to create an 'AND array'.
Eventually the 8 inputs all make there way thru all the gates, resulting in 1 final output pin turning OFF or ON:


Some "AND gates" also have as many as 8 inputs in 1 chip, which is a more compact way of getting the same result as above :




This is called a "Truth Table" and shows us a sort of 'Map' (table) of what each gate will do.


We see on the left that the "AND" gate will provide a certain 'X' output, based on what is presented onto the inputs A and B.

if A is 0(off), "AND" B is 0 (off), then X(output) is also OFF.
if A is 0(off), "AND" B is 1 (on), then X(output) is also OFF.
if A is 1(on), "AND" B is 0 (off), then X(output) is also OFF.
if A is 1(on), "AND" B is 1 (on), then X(output) is also ON.

This table proves what we saw above with the 2 switches and the lamp.

Also in the table is a "NAND" gate, what the hell is a "NAND" anyway ??

Before getting into "NAND" lets first get into the "NOT gate" more popular known as "The Invertor" as it simply
"inverts" whatever passes through it.

The invertor Truth table is simple and self explanatory?


Switch ON the input to the invertor, and the ouput turns OFF, and vica-verca:
Switch OFF the input to the invertor, and the ouput turns ON,


Also to note is the "BUFFER gate".
A Buffer provides some isolation between 2 different sections of a circuit, it basically passes whatever comes into it
straight on to the output, however, it naturally wont allow any circuitry opn the output pin to interfere with circuitry
on the input pin.
BUFFERs are used to 'drive' into several other gates at a time without loading (interfering) with the logic on the input side.
(probably getting too deep now, i'll stop).


Ok, now back to the "NAND gate" finally...

A "NAND gate" is just an "AND gate", with a "NOT gate"(invertor) added inside the chip, on it's ouput pin.
That's all.
Look at the Truth Table, you now see the "NAND" works exactly opposite to the "AND".


You can basically make ANY logic gate the exact opposite by adding a "NOT gate"(Invertor) onto the output pin.
This table shows that a "NAND" is the addition of an "AND" & a "NOT".
(also shown is a "NOR gate"...more about them shortly).


Here's an example of an "AND array" now inverted to become a "NAND" function:


Of course "NAND gates" are also have as many as 8 inputs in 1 chip.




....and moving onto the "OR gate"...

But first, Here's a 12volt battery on the left, wired via 2 switches, which then provides
a supply voltage onto the lamp.
Currently, both switches are OPEN, so the lamp is OFF (GREY colour).


Now switch 'A' is CLOSED, and switch 'B' is OPEN, so the lamp is ON, (YELLOW colour).


Now switch 'A' is OPEN, and switch 'B' is CLOSED, so the lamp is still ON, (YELLOW colour).


Now switch 'A' is CLOSED, and switch 'B' is CLOSED, so the lamp is still ON, (YELLOW colour).


What this illustrates is that you turn Switch A "OR" B ON (closed) for the lamp to turn ON.
(you could almost call this an "Either gate" where EITHER input will turn ON the lamp).



This is referred to as "ORing" and the equivelant method is to use a chip called an "OR gate":
If EITHER inputs pins (A or B) are turned ON, then the ouput pin (X) will turn on, just like the lamp previously did.

This is the "Truth Table" :


We see on the left that the 'OR' gate will provide a certain 'X' output, based on what is presented onto the inputs A and B.

Basically, if A is 0(off) and B is 0 (off), then X(output) is also OFF.
if A "OR" B is 1(on), then X(output) is also ON.
Also, if A is 1(on), and B is 1(on), then X(output) is also ON.

This table proves what we saw above with the 2 switches and the lamp.

Also in the table is a "NOR gate", and i'm sure you now know that it is an "OR" with a "NOT" fitted onto it.


Here's a real-Life example:
Your car interior light (the lamp) will only turn when you Open the Front-LEFT door "OR" the Front-Right door (or both doors).



I tried to keep this a simple and easy as possible, hopefully the diagrams and examples in your car help understand the logic.
MM.
« Last Edit: April 23, 2014, 11:21:45 PM by Marty Machine »

Offline robm

  • Trade Count: (+1)
  • ******
  • Forum Posts:
  • Townsville
Re: Beginners guide to Computer Logic...
« Reply #1 on: April 21, 2009, 06:29:34 AM »
Excellent article thanks Marty!

Offline Extra Ball

  • Read-Only
  • Trade Count: (0)
  • *
  • Forum Posts:
  • Newcastle
Re: Beginners guide to Computer Logic...
« Reply #2 on: April 21, 2009, 08:30:41 AM »
Ty, techy stuff like this I like to process slowly.
 *%*

Offline pinnies4me

  • Administrator
  • Trade Count: (+5)
  • *****
  • High Score Initials:
  • Forum Posts:
  • Victoria
Re: Beginners guide to Computer Logic...
« Reply #3 on: April 21, 2009, 10:15:19 AM »
Enjoyable read there.

Armed with all that, I'm off to build a super-computer.   :lol
“If you wanna escape, go up to a pinball machine. There’s a magic button on the front that takes you to a world under the glass and makes the the rest of the universe disappear.”

Marty Machine

  • Guest
  • Trade Count: (0)
Re: Beginners guide to Computer Logic...
« Reply #4 on: April 21, 2009, 11:20:35 AM »
Hey, you could build a pinball with that info  !*!

Offline RaMpAgE

  • Trade Count: (0)
  • ****
  • Forum Posts:
  • Bendigo, Vic
Re: Beginners guide to Computer Logic...
« Reply #5 on: April 21, 2009, 02:37:12 PM »
Nice work Marty, have you ever thought to maybe write a refernce book with ttl's, LS series chips as I would buy it and I am some others would too.  Saves me having to waste time on the pc looking them all up and printing etc.

Offline ddstoys

  • Trade Count: (+23)
  • ******
  • High Score Initials:
  • Forum Posts:
  • Geelong
Re: Beginners guide to Computer Logic...
« Reply #6 on: April 21, 2009, 03:16:51 PM »
Great Post Marty      Explains it nice and simple keep up the great work

Marty Machine

  • Guest
  • Trade Count: (0)
Re: Beginners guide to Computer Logic...
« Reply #7 on: April 21, 2009, 04:13:27 PM »
ZEDX:
Did you mean that i write up something only for the TTL chips used mainly in pinball machines? or ALL ttl's (big job).

I like to try and keep the info as simple and easy as possible so anyone off the street would understand it.

So far, so good  &&
MM.

Offline RaMpAgE

  • Trade Count: (0)
  • ****
  • Forum Posts:
  • Bendigo, Vic
Re: Beginners guide to Computer Logic...
« Reply #8 on: April 21, 2009, 06:24:20 PM »
ZEDX:
Did you mean that i write up something only for the TTL chips used mainly in pinball machines? or ALL ttl's (big job).

I like to try and keep the info as simple and easy as possible so anyone off the street would understand it.

So far, so good  &&
MM.

the whole lot lad &&, don't need to go into vast detail as above, but a small handbook or such with IC, pinouts, function, small diagram etc. then you could branch out into rams,roms  ^&(  (lot of work hey)

Marty Machine

  • Guest
  • Trade Count: (0)
Re: Beginners guide to Computer Logic...
« Reply #9 on: April 21, 2009, 06:47:39 PM »
But there's already books out there, like the cmos cookbook, ttl cookbook, and an array of ttl/cmos manufacturers data books for pinouts.

I usually download everything from alldatasheet.com these days as a central supply of pinout info, they seem to have every chip i try.

I am however toying with the idea of compiling a databook for pinball chips & semis (trannies etc), since there's probably less than 50 chips across ALL pinballs, it might be a handy booklet to keep in the toolbox, rather than 10 differnet refbooks

MM.

Offline Strangeways

  • Pinball Restoration is my passion
  • Administrator
  • Trade Count: (+9)
  • *****
  • High Score Initials:
  • Forum Posts:
  • Melbourne
  • ABN 68 283 634 461
    • Ride The Boney Beast
Re: Beginners guide to Computer Logic...
« Reply #10 on: April 21, 2009, 11:29:57 PM »

Ahhh yes - reminds me of the "Basic Electronics Certificate" I did all those years ago.

good stuff Marty !
Aussie Pinball - Proud to be Australia's Premier Pinball Forum

http://www.australianpinballrestorations.com.au/

http://www.rtbb.com.au/catalog/

We carry the largest range of NEW Ramps in Australia

Offline ajlaird

  • Trade Count: (0)
  • ******
  • Forum Posts:
  • Greensborough, Melbourne
  • Go Ahead, Make My Day
Re: Beginners guide to Computer Logic...
« Reply #11 on: April 22, 2009, 12:08:43 AM »
Remember 'Talking Electronics'? Reminds me a bit of that publication.

Marty Machine

  • Guest
  • Trade Count: (0)
Re: Beginners guide to Computer Logic...
« Reply #12 on: April 22, 2009, 12:53:53 AM »
Yep, it's very "TE" hehehehe, and NO, i didn't/don't work for TE  <.>


Offline ajlaird

  • Trade Count: (0)
  • ******
  • Forum Posts:
  • Greensborough, Melbourne
  • Go Ahead, Make My Day
Re: Beginners guide to Computer Logic...
« Reply #13 on: April 22, 2009, 12:59:14 AM »
Dad gave me his TEC-1B last year; I haven't fired it up yet but he said it was working.

Marty Machine

  • Guest
  • Trade Count: (0)
Re: Beginners guide to Computer Logic...
« Reply #14 on: April 22, 2009, 01:18:10 AM »
ooooh, i was just reading up on the TEC-1 article just last week, i found the colour-covered "TE" issue that features how to build & program the TEC-1 kit, i was toying with building one up for nostalgia's sake...
A guy i was emailing about it, has already sent me the TEC-1 "bios"(for lack of a better word) rom.

What's different about the TEC-1"B"...did you have the mags/articles about any further TEC-1 info?
My TE mag with the TEC-1 feature is issue #10, not sure how much further TE went with it.

MM.