CMOS or TTL for "messing" with logic gates - Page 1
Forum section: electronics / beginners

author: PerranOak
author_rank: Frequent Contributor
timestamp: February 20, 2020, 01:52:32 pm
content: I want to buy a load of logic gates (simple ANDs, ORs, etc.) so that I can mess about with them to understand their operation and use and how they can combine to perform various functions.Which should I get, CMOS or TTL?Obviously, efficiency is not important but they may end-up in an application once I've finished "messing", I suppose.I understand that CMOS are more vulnerable to static but I've never had a problem with this.Any advice will be gratefully received, cheers.

author: Zero999
author_rank: Super Contributor
timestamp: February 20, 2020, 02:01:28 pm
content: CMOS. The 74HCxx series is ideal. TTL is obsolete and often expensive/difficult to get nowadays.

author: PerranOak
author_rank: Frequent Contributor
timestamp: February 20, 2020, 02:11:21 pm
content: Cheers.This is a bit of a cheek but how many should I get? I want to build latches, flip-flops and so on; maybe some more complex stuff.I thought about 3 each (with four gates per chip) of: AND, NAND, OR, NOR, XOR and a couple of inverter chips (6 gates).I know it's hard to say but does this sound about right for starters?

author: mcovington
author_rank: Regular Contributor
timestamp: February 20, 2020, 02:22:48 pm
content: It's going to be a self-education exercise, because very few circuits are actually built with logic gates these days! Plan the experiments you want to do and get the chips that are used. Recall that you can make any other gate out of a combination of NOR gates or out of a combination of NAND gates. Also, you will probably want to experiment with something that has Schmitt-trigger input (for making oscillators and cleaning up input signals) and with some kind of flip-flop.

author: rdl
author_rank: Super Contributor
timestamp: February 20, 2020, 02:33:46 pm
content: Buy some CD4007 and make everything yourself.https://wiki.analog.com/university/courses/electronics/electronics-lab-28

author: nfmax
author_rank: Super Contributor
timestamp: February 20, 2020, 02:54:53 pm
content: 4000 series CMOS is a good choice. It's nice and slow, so it behaves itself on a plug-in breadboard, and it isn't fussy about supply voltage: you can use a 9V battery if that's all you have. It still seems to be fairly readily available.

author: Wallace Gasiewicz
author_rank: Super Contributor
timestamp: February 20, 2020, 03:19:29 pm
content: Order a bunch of ANDs, ORs, NORs, NANDs, up down counters and other chips and throw in some OP AMPS. and FlipFlopsCombine the order from the supplier to minimize postage cost. Buy whatever quantity the supplier is packaging (usually 5) Ask for a discount on shipping before you buy, if shipping is included in the price of one order. It costs them the same amount to ship 50 chips as it does to ship 5.If you need any diodes or resistors or other components you might want to consider ordering them at the same time.Look around for cheap supplier who has all sorts of ICs so you can order them all at once.You should find you can get more chips and less total cost even if you end up with some seldom used chips.This sort of thing is not subject to faulty production as most of these chips are new old stock so don't worry about inferior knock offs.Probably go with CMOS, if you end up repairing stuff, much of the time you can just stick in a CMOS device into a spot previously occupied by a TTL device.You are probably looking for through hole devices rather than surface mount so you can easily breadboard them.Not a lot of stuff built with these chips today but there is a lot of equipment out there that is used by hobbyists that uses these devices and there is a lot of repair going on with old equipment.Here in the USA I frequently use Thaishine, an ebay source. I am not familiar with your particular shipping and supplier issues.http://www.ebay.com/usr/thaishine?_trksid=p2053788.m1543.l2754Look at what they have.Wally KC9INK

author: Gyro
author_rank: Super Contributor
timestamp: February 20, 2020, 03:34:10 pm
content: Certainly CMOS. As mfmax points out, you can run 4000 series up to 15V so no regulation needed. 74HC (not HCT) is specified to run over a 2-6V range too and has more output current capability for driving LEDs etc. (although 4000 goes reasonably high above 9V).HC74 flip flops are very flexible, obviously plenty of HC00 NANDS, HC04 Inverters (to save pointlessly tying up gates for inversion) too. HC14 Schmitt input inverters will take care of noisy inputs. Maybe some HC138/139 3 to 8 / dual 2-4 line decoders and HC123 dual Monostables. Oh, and a couple of HC86 XOR gates and a few counters HC90/93 async and HC160/161 synchronous. Also HC47 7-Segment decoders if you want to drive displays. Don't forget decoupling caps.

author: rstofer
author_rank: Super Contributor
timestamp: February 20, 2020, 04:15:51 pm
content: I'm going to take a contrarian view. Old people do that from time to time...I see two potential goals here: Learn to play with plastic chips or learn a bit about logic and logic design. If the goal is to play with a lot of plastic, like maybe Ben Eater's CPU project, rock on. That's a great learning project. But it's a project, there's a goal. Just watching an AND gate work, well, you can pencil whip that and learn just as much. You can learn about DeMorgan's Theorem and Karnaugh Maps without ever actually seeing a piece of plastic.The thing is, chip count is limited. A couple of dozen is a lot and I would think somewhere around 100 is a logistic limit. At least it was for me when I was doing this stuff with wire-wrap. So, a hundred chips with 4 gates per chip - about 400 gates equivalent. When I buy an FPGA, I get a million gate equivalents. Maybe more! And I get memory as well as a virtual dumpster full of logic. Wire-wrap is reduced to typing. My cut-strip-wrap gun is nowhere near as fast as my keyboard.If you have any long-range purpose for learning about logic design, start with something that has a future. In my opinion, FPGA boards with lots of gadgets make sense. Switches, push-buttons, LEDs, 7-Segment displays, maybe a VGA port, etc. The gadgets make the board useful. With that in mind, I like ANY of the Digilent boards and, for the money, this is probably the best thing out there (remember, I want gadgets, bare boards are obviously cheaper):https://store.digilentinc.com/basys-3-artix-7-fpga-trainer-board-recommended-for-introductory-users/Yes, you can do the beginner AND, OR, XOR stuff usig the switches and LEDs but getting started will be a little bit of a climb. There's plenty of help around here... Once you get used to dealing with Xilinx Vivado and programming your first blinking LED (The "Hello World" of the FPGA community), you will be on your way to an education in logic design without all the anguish of actually trying to push little pieces of wire into breadboards. I've done it and I'm not going to do it again.While I'm on a tear, I going to put in a word for VHDLwhiz.com. He tends to use a really cheap Lattice IceStick:https://www.latticesemi.com/icestickI have a couple of those and they are pretty neat - but slow and kind of small. Big enough for real projects though. I have to say, $25 for a development board is fairly cheap. But it is really short on gadgets and the Lattice toolchain (IceCube2 and Diamond Programmer) isn't anything I would write home about but it works and it's free.Or just buy an assortment of chips. It doesn't matter which but I would suspect that 4000 CMOS is easiest to use. The Ben Eater project uses 74LSxx logic and that stuff is still available. The thing is, the kit of parts costs a LOT more than a decent FPGA board and, in fact, competes with my preferred board:https://store.digilentinc.com/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/So, a dozen breadboards with hundreds of connections or a couple of thousand lines of code. And the FPGA board is serially reusable. In seconds, if the project is already available as a bitmap.Somebody has to take the contrarian view, so I did. Either way, have fun!

author: jfiresto
author_rank: Frequent Contributor
timestamp: February 20, 2020, 07:41:39 pm
content: Quote from: nfmax on February 20, 2020, 02:54:53 pmI agree. The 4000-series is very designer friendly (for discrete logic) and isstill being used for new designs. You can get surface mount from multiple sources. TI still makes and sells it in DIP form, for less than it cost, adjusting for inflation, in the 1970s.

author: Wimberleytech
author_rank: Super Contributor
timestamp: February 20, 2020, 08:57:55 pm
content: Quote from: PerranOak on February 20, 2020, 01:52:32 pmIn a similar vein as what rstofer said...you should download Logisim (http://www.cburch.com/logisim/) and build your circuits there first. Then when you are ready to see something blinking in the lab, build it with CMOS (yes that is my vote). I second the motion to get some CD4007s and build logic circuits (and even ANALOG ones) at the transistor level.

author: PerranOak
author_rank: Frequent Contributor
timestamp: February 21, 2020, 01:00:28 pm
content: Thank you all for your replies, I really appreciate the time taken.I have two goals: education and entertainment.Of course, I want to experiment with the logic and (yes, I've seen the Ben Eater stuff - excellent) make a few circuits both copied (e.g. Ben) and of my own design. However, I'm a bit of a lazy bugger and I've found that if I actually build things I get more enthused to do more. If I just sit at the PC simulating, I get bored.I guess a "trip" to eBay is called for!Thank you all again.

author: Gyro
author_rank: Super Contributor
timestamp: February 21, 2020, 01:11:05 pm
content: Quote from: PerranOak on February 21, 2020, 01:00:28 pmNooo! Not unless you luck upon UK suppliers with surplus stock. Frustration lies that way!Go to CPC, Farnell, and RS and buy the cheapest.

author: Ian.M
author_rank: Super Contributor
timestamp: February 21, 2020, 02:09:28 pm
content: The *ONE* advantage of bipolar TTL for small scale breadboarding is that you can let the inputs of spare (totally unused) gates float, as they float high well enough to avoid oscillation or excessive power dissipation. In all other respects, its easy to find a CMOS logic family that is superior.If you are serious about experimenting with SSI or MSI logic chips, an Arduino or similar to generate test patterns to drive the inputs programatically, and a Salae Logic 8 clone + the open-source Sigrok logic analyser software to monitor the outputs will be very useful once you get into anything more complex than simple combinatorial logic.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: February 21, 2020, 02:23:41 pm
content: https://www.digikey.co.uk/product-detail/en/lattice-semiconductor-corporation/LCMXO3LF-6900C-S-EVN/220-2069-ND/5395903More gates than you can shake a stick at

author: PerranOak
author_rank: Frequent Contributor
timestamp: February 21, 2020, 04:33:17 pm
content: OK thanks, I'll use a proper supplier.So, with used inputs on CMOS - do they all have to be grounded? This will make a bit of a "rat's nest"?Another thing I just thought of is are CMOS OK with all the pulling and pushing of breadboard connectors while messing about?

author: jfiresto
author_rank: Frequent Contributor
timestamp: February 21, 2020, 04:54:04 pm
content: If you have not already, download a copy ofThe CMOS Cookbookfrom the author's website. It is a clear, practical text from which you can learn a lot about digital design, both the how and why.

author: nfmax
author_rank: Super Contributor
timestamp: February 21, 2020, 05:07:49 pm
content: Quote from: PerranOak on February 21, 2020, 04:33:17 pmGrounded, connected to VDD, or linked to any handy logic signal if the input is a don't care.4000 CMOS is pretty robust against breadboard pluggery, BUT do include a 10uF electrolytic across the supply rails on the breadboard, as well as a 100nF ceramic, to keep the impedance from VDD to VSS low even when not connected to your power supply.

author: rstofer
author_rank: Super Contributor
timestamp: February 21, 2020, 05:14:00 pm
content: Quote from: PerranOak on February 21, 2020, 04:33:17 pmThe inputs need to be terminated to either rail. I think it is best to use a resistor and the value isn't particularly important but I would probably use 1k or 2.2k. Others might say 10k but the higher the value, the more susceptible the input becomes to noise. I almost certainly would not use 1M. Others say to just wire it to the rail. Page 6 here:https://www.ti.com/lit/an/sdya009c/sdya009c.pdfhttps://www.electronics-notes.com/articles/digital-embedded-processing/logic-circuits-design/design-guidelines-unused-gate-input-termination.phpQuoteSome people have a grounded mat and a grounded wrist strap for this kind of work. I haven't had a problem in all these years but I can't say I have ever used much 4000 series logic. But microprocessors are CMOS and I handle those but they tend to have Schottky diodes on the input pins for protection. With reasonably high humidity and warm temperatures I wouldn't worry about it. Winter in Minneapolis would be a serious problem. I visied there twice and it's pretty easy to draw inch long arcs to file cabinets.https://www.amazon.com/Bertech-Layer-Rubber-Wrist-Grounding/dp/B00O0Q1Z1IThe bigger problem is the reality that breadboards suck. Once you reach a certain level of complexity (Ben Eater's project, for example) breadboards are darn hard to use. Wires get dislodged, things that worked a few minutes ago don't, that kind of thing. I'm not aware of any workable alternative. BTW, all breadboards are not created equally. These came highly recommended when I was working on the Ben Eater project:https://www.amazon.com/gp/product/B0040Z4QN8

author: jfiresto
author_rank: Frequent Contributor
timestamp: February 21, 2020, 05:40:27 pm
content: Quote from: rstofer on February 21, 2020, 05:14:00 pmI usually wear a wrist strap and use a grounded tip soldering iron. I never lost a 4000 A- or B-series part to ESD, save a couple that were smoked by lightning strikes, which count as acts of God.

author: SmokedComponent
author_rank: Regular Contributor
timestamp: February 21, 2020, 07:31:43 pm
content: 4093 is super useful.It is one of my favorite jellybean ICs. I always have bunch of these.They're Schmitt trigger NAND gates, so you can do funky analog stuff with them, too.Give me enough NAND gates and I'll build you the world.

author: tautech
author_rank: Super Contributor
timestamp: February 21, 2020, 08:06:19 pm
content: These interactive simulators can be very useful for those getting started with logic IC's:https://tams.informatik.uni-hamburg.de/applets/hades/webdemos/10-gates/00-gates/chapter.html

author: Teti
author_rank: Regular Contributor
timestamp: February 22, 2020, 09:59:17 pm
content: Another option is to start with discrete NPN and PNP transistors such as BC547, 2N2222, 2N3906. This should give you quite in depth of construction.

author: coldfiremc
author_rank: Regular Contributor
timestamp: February 23, 2020, 01:40:28 am
content: Use 4000 cmos. There's some assorting kits out there. Cmos has good noise margins, so noise will not make your circuit behave strange (aka protoboard proof). Try to interface to the analog world with comparators, VCO and schmitt triggers. Some CMOS gates also work as analog amplifiers with "funny" connections. You can make it run with clocks using a 555 or using some types of VCO. Cmos gates will run without problems until 1MHz. If you want more, you can increase voltages. Most gates will behave good until 17 V. CMOS 4000 is slow so for anything 5-10Mhz and beyond, consider 74HC, 74LS/ALS, 74F.If you want SERIOUS fun, consider to buy an EPROM burner and some 61 series SRAMS. You can make microprogrammed state machines with a EPROM, a ROM and a counter and some gates. Also you can read stuff from eproms and make crazy mess with it. You can store data in SRAMS, to then read in some way.

author: PerranOak
author_rank: Frequent Contributor
timestamp: February 28, 2020, 04:45:34 pm
content: One last question:If, say, I'm using a chip with four NAND gates but I only actually need one, do I have to tie the inputs of the unused gates to ground/Vcc?

author: rstofer
author_rank: Super Contributor
timestamp: February 28, 2020, 05:43:55 pm
content: Quote from: PerranOak on February 28, 2020, 04:45:34 pmIt is highly recommended, particularly with certain families of CMOS where the input will float midway and lead to heating of the output stage.In my view, the answer is "YES", terminate the inputs.So, pull-up or pull-down. I almost always use a resistor and pull up. If I do it this way, instead of connecting the pin to solid ground, I can probably use the gate later by just removing the resistor (or not) but I won't have to cut a trace on a PCB. Also, check the pin input current for Vcc and Gnd. I think you will find that pulling up requires less current and potentially generates less heat.See IIHand IILon page 5 here:https://www.ti.com/lit/ds/symlink/sn74ls04.pdfNote that IILis much larger than IIH

author: Wimberleytech
author_rank: Super Contributor
timestamp: February 28, 2020, 05:51:22 pm
content: Quote from: PerranOak on February 28, 2020, 04:45:34 pmIf you are fooling around with a breadboard as your design develops or just learning...then "no." If you are building PCB to take it to the next level...I would say "yes."

author: james_s
author_rank: Super Contributor
timestamp: February 28, 2020, 06:14:11 pm
content: It's not strictly necessary but it's good practice to do so, floating inputs can lead to unpredictable behavior.

author: Ian.M
author_rank: Super Contributor
timestamp: February 28, 2020, 07:00:24 pm
content: Breadboards are bad enough for digital signal integrity without encouraging ground bounce by allowing CMOS gates with floating inputs to hammer your Vdd and Gnd nets as capacitively coupled glitches on their inputs take them in and out of their linear regions.Spend a minute or two adding jumpers to tie unused gates' inputs to the nearest rail, or waste hours chasing glitches and malfunctions when your circuit complexity grows till you can no longer beat the odds.

author: PerranOak
author_rank: Frequent Contributor
timestamp: February 29, 2020, 02:22:19 pm
content: Cheers all.

author: TomS_
author_rank: Frequent Contributor
timestamp: March 06, 2020, 07:16:14 am
content: If you just want to play with logic, you can look at some simulation software. Titles I have used are logicly and logisim.Logicly also has a web based version (at logic.ly) so you can try it out before you might decide to buy a copy. You can also build up your own modules to include into future circuits which I found was quite valuable because you can build up familiar 74 series logic chips to make circuits that are more like what you can build on the real world.Logisim seems more limited in that respect, but has a lot of other things that logicly doesn't, like ROM/RAM simulators.I've used both for proofing some of my own designs before committing to a bunch of soldering or ordering PCBs.Personally I've found it easier to whip something up in software like this and make changes with a few mouse clicks than having to deal with the tediousness of a breadboard, and once I have something that works the way I need I look at designing it into my project.

author: westfw
author_rank: Super Contributor
timestamp: March 06, 2020, 10:28:36 pm
content: You might learn more by buying 100 quad 2-input nand gates and building everything with them (you can.)But even in the old days a lot of stuff would be built with bigger chips (flip flops and counters in particular.)I 2nd the “cmos cookbook” recommendation.

author: TomS_
author_rank: Frequent Contributor
timestamp: March 07, 2020, 10:30:10 am
content: I've built a project entirely out of NOR logic. NOR and NAND are universal gates, and the right combination can implement any other logic function.The Apollo Guidance Computer was also built entirely out of NOR logic and was the inspiration for my project.

author: tkamiya
author_rank: Super Contributor
timestamp: March 08, 2020, 05:58:21 pm
content: If you are using CMOS, yes. Just make sure it's input. An advantage of using TTL is that you don't have to worry about any of that.Amazon has IC assortment kits. Use sockets, because even with TTL, it isn't that difficult to kill it.