The Aussie Pinball Arcade

Aussie Pinball Forums => Technical Matters => Pinball Training 101 => Topic started by: Marty Machine on April 20, 2009, 11:41:34 PM

Title: Beginners guide to Computer Logic...
Post by: Marty Machine 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).
(http://www.oztoytech.com/pinball/electronics/asimple_off.gif)

Now the switch is CLOSED, so the lamp is ON (YELLOW colour).
(http://www.oztoytech.com/pinball/electronics/asimple_on.gif)

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.
(http://www.oztoytech.com/pinball/electronics/aandboff1.gif)

Switch A is ON, but Switch B is OFF - Lamp is still OFF.
(http://www.oztoytech.com/pinball/electronics/aandboff2.gif)

Switch A is OFF, but Switch B is ON - Lamp is still OFF.
(http://www.oztoytech.com/pinball/electronics/aandboff3.gif)

Finally, Switch A and Switch B are both ON - Lamp is ON.
(http://www.oztoytech.com/pinball/electronics/aandbon.gif)

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).
(http://www.oztoytech.com/pinball/electronics/and_inside.gif)
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.
(http://www.oztoytech.com/pinball/electronics/and_car.gif)

"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:
(http://www.oztoytech.com/pinball/electronics/and_many.gif)

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 :
(http://www.oztoytech.com/pinball/electronics/and8.gif)



This is called a "Truth Table" and shows us a sort of 'Map' (table) of what each gate will do.
(http://www.oztoytech.com/pinball/electronics/andnand_truth.gif)

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?
(http://www.oztoytech.com/pinball/electronics/buffnot_truth.gif)

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).
(http://www.oztoytech.com/pinball/electronics/andnand_add.gif)

Here's an example of an "AND array" now inverted to become a "NAND" function:
(http://www.oztoytech.com/pinball/electronics/nand_many_invert.gif)

Of course "NAND gates" are also have as many as 8 inputs in 1 chip.
(http://www.oztoytech.com/pinball/electronics/nand8.gif)



....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).
(http://www.oztoytech.com/pinball/electronics/aorboff.gif)

Now switch 'A' is CLOSED, and switch 'B' is OPEN, so the lamp is ON, (YELLOW colour).
(http://www.oztoytech.com/pinball/electronics/aorbon1.gif)

Now switch 'A' is OPEN, and switch 'B' is CLOSED, so the lamp is still ON, (YELLOW colour).
(http://www.oztoytech.com/pinball/electronics/aorbon2.gif)

Now switch 'A' is CLOSED, and switch 'B' is CLOSED, so the lamp is still ON, (YELLOW colour).
(http://www.oztoytech.com/pinball/electronics/aorbon3.gif)

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" :
(http://www.oztoytech.com/pinball/electronics/ornor_truth.gif)

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).
(http://www.oztoytech.com/pinball/electronics/or_car.gif)


I tried to keep this a simple and easy as possible, hopefully the diagrams and examples in your car help understand the logic.
MM.
Title: Re: Beginners guide to Computer Logic...
Post by: robm on April 21, 2009, 06:29:34 AM
Excellent article thanks Marty!
Title: Re: Beginners guide to Computer Logic...
Post by: Extra Ball on April 21, 2009, 08:30:41 AM
Ty, techy stuff like this I like to process slowly.
 *%*
Title: Re: Beginners guide to Computer Logic...
Post by: pinnies4me on April 21, 2009, 10:15:19 AM
Enjoyable read there.

Armed with all that, I'm off to build a super-computer.   :lol
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on April 21, 2009, 11:20:35 AM
Hey, you could build a pinball with that info  !*!
Title: Re: Beginners guide to Computer Logic...
Post by: RaMpAgE 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.
Title: Re: Beginners guide to Computer Logic...
Post by: ddstoys on April 21, 2009, 03:16:51 PM
Great Post Marty      Explains it nice and simple keep up the great work
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine 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.
Title: Re: Beginners guide to Computer Logic...
Post by: RaMpAgE 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)
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine 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.
Title: Re: Beginners guide to Computer Logic...
Post by: Strangeways 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 !
Title: Re: Beginners guide to Computer Logic...
Post by: ajlaird on April 22, 2009, 12:08:43 AM
Remember 'Talking Electronics'? Reminds me a bit of that publication.
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on April 22, 2009, 12:53:53 AM
Yep, it's very "TE" hehehehe, and NO, i didn't/don't work for TE  <.>

Title: Re: Beginners guide to Computer Logic...
Post by: ajlaird 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.
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine 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.
Title: Re: Beginners guide to Computer Logic...
Post by: studley67 on April 26, 2009, 11:09:12 PM
 $#$shit,i`m starting to learn logic.ummm.do i need to???
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on April 26, 2009, 11:14:09 PM
hahaha only if you *NEED TO*  :lol
Title: Re: Beginners guide to Computer Logic...
Post by: millsy on April 26, 2009, 11:22:46 PM
When are you starting on the READING SCHEMATICS FOR DUMMIES   !@#
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on April 26, 2009, 11:29:23 PM
Millsy:

To get me started, is there anything particular you don't understand on schematics?

I posted a small piece in here about "wiring diagrams" to clear up wiring issues some people had, other than that i'm not sure what/which things to tackle next.

Always looking for users to ask what they're struggling with, then i can create some info based on that....

MM.
Title: Re: Beginners guide to Computer Logic...
Post by: millsy on April 26, 2009, 11:57:40 PM
Being an old motor mechanic - found reading wiring diagrams in auto applications easier as there was a + & - and only used a test light (only started using multimeter since working on the pins) as well the wiring colours in the auto  stood out like dogs b....(cant rely on reading the colours in ems as they all look the same to me - Im a bit colour blind) - I feel more comfortable using continuity checking but I miss that main black earth wire.
This probably doesnt make sense as Im no electrician.Need to spend more time reading and working on schematics. *!@
Title: Re: Beginners guide to Computer Logic...
Post by: pinballist on June 07, 2009, 10:25:00 AM
Wow Marty reading this tutorial took me back to the days when Dick Smith was selling heated toilet seats - anyone remember those?

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.

What a great idea!!  #*#

[attachment deleted by admin]
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on June 07, 2009, 11:02:03 AM
Something about "Toilet seat + 240v mains + Water " makes me nervous......
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on June 07, 2009, 11:27:51 AM
You should look over the page, it's right "up there" with the Solar Cooker  :lol :lol :lol :lol

Title: Re: Beginners guide to Computer Logic...
Post by: pinballist on June 07, 2009, 11:35:16 AM
Ha ha ha, you're absolutely right!!  With $6 nationwide freight they must have been flying out the door :D

[attachment deleted by admin]
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on June 07, 2009, 12:12:01 PM
I wonder how many people got sunburnt while turning their eggs or flipping a steak, and wondering "why is it so hot here"  :lol
Title: Re: Beginners guide to Computer Logic...
Post by: ajlaird on June 07, 2009, 06:41:17 PM
Something about "Toilet seat + 240v mains + Water " makes me nervous......

Nah, all good - guaranteed unbreakable for 'normal' usage.
Title: Re: Beginners guide to Computer Logic...
Post by: aircm on August 24, 2010, 10:28:44 PM
I built a tec 1 b in yr12 electronics back in 1987 still think i have it sitting in an old box up stairs lol.
Title: Re: Beginners guide to Computer Logic...
Post by: Mr Pinbologist on August 24, 2010, 11:42:57 PM
Hey, you could build a pinball with that info  !*!

I did exactly that, using pretty much the same info and LOTS of CMOS logic ICs... about 14 yrs ago, theres a thread on here somewhere for that game  :D
Title: Re: Beginners guide to Computer Logic...
Post by: ajlaird on August 25, 2010, 12:15:11 AM
I built a tec 1 b in yr12 electronics back in 1987 still think i have it sitting in an old box up stairs lol.

Got my dad's one sitting out in the shed - will have to fire it up again one day!
Title: Re: Beginners guide to Computer Logic...
Post by: ktm450 on August 25, 2010, 10:38:03 AM
(http://aussiepinball.com/index.php?action=dlattach;topic=1305.0;attach=4752;image)

Don't laugh, we might all be cooking on these soon with electricity prices shooting skyward  :lol
Title: Re: Beginners guide to Computer Logic...
Post by: Homepin on August 25, 2010, 11:34:44 AM
I have TE issues 10,11,12,13,14 & 15 - 15 I think was the last, after that Colin Mitchell produced specific books such as "FM Bugs", "Mini Frequency Counter" and "Security Devices" etc.

If you want any of those issues Marty let me know (some I have doubles of for some reason?).


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.
Title: Re: Beginners guide to Computer Logic...
Post by: ajlaird on August 25, 2010, 11:25:10 PM
I have TE issues 10,11,12,13,14 & 15 - 15 I think was the last, after that Colin Mitchell produced specific books such as "FM Bugs", "Mini Frequency Counter" and "Security Devices" etc.

If you want any of those issues Marty let me know (some I have doubles of for some reason?).


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.

My Dad handed over a bunch of TE's - I will have to check what I have as well but I can't get into the shed at the moment.
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on August 25, 2010, 11:37:08 PM
I have TE issues 10,11,12,13,14 & 15 - 15 I think was the last, after that Colin Mitchell produced specific books such as "FM Bugs", "Mini Frequency Counter" and "Security Devices" etc.
If you want any of those issues Marty let me know (some I have doubles of for some reason?).
Thanx for the offer mate, but since my old post, i've aquired the entire TE collection from various sources.....

Here's a link to my ongoing "Electronics Magazines" collection project.....
http://www.retro-riders.com/tech/magz/ (http://www.retro-riders.com/tech/magz/)

MM.
Title: Re: Beginners guide to Computer Logic...
Post by: Homepin on August 26, 2010, 07:03:59 AM
WOW - that is a serious collection!!!!
Title: Re: Beginners guide to Computer Logic...
Post by: ajlaird on August 26, 2010, 08:00:47 AM
I have TE issues 10,11,12,13,14 & 15 - 15 I think was the last, after that Colin Mitchell produced specific books such as "FM Bugs", "Mini Frequency Counter" and "Security Devices" etc.
If you want any of those issues Marty let me know (some I have doubles of for some reason?).
Thanx for the offer mate, but since my old post, i've aquired the entire TE collection from various sources.....

Here's a link to my ongoing "Electronics Magazines" collection project.....
http://www.retro-riders.com/tech/magz/ (http://www.retro-riders.com/tech/magz/)

MM.


Excellent! I have been collecting magazines from the VZ era to complement my VZ collection; it is not quite complete so I may eventually bother you for some scans!
Title: Re: Beginners guide to Computer Logic...
Post by: Marty Machine on August 26, 2010, 10:06:33 AM
No probs at all....

The site is being re-done as we type, as i've expanded the mags into their own areas, with covers and indexes of contents etc...

Enjoy!
MM.
Title: Re: Beginners guide to Computer Logic...
Post by: 4_amusement_only on February 18, 2013, 07:12:41 AM
Could we please get those pictures back up pertaining to the first post if possible.
They are no longer showing up.