4 bit Adder - Page 1
Forum section: electronics / beginners

author: Fuldup
author_rank: Contributor
timestamp: March 10, 2024, 11:30:53 am
content: hi, i created this 4 bit adder, but i got a problem, when all the switches are open, current still goes through the switches. can someone tell me what i got to change so that the adder can work.link to the adder:https://www.circuitlab.com/circuit/6248teq76yq6/adder/

author: Ian.M
author_rank: Super Contributor
timestamp: March 10, 2024, 11:44:30 am
content: Generally speaking: in any CMOS logic family inputs *MUST* *NOT* be left floating, and for all bipolar 'TTL' families, a floating input is a somewhat unreliable logic high. Therefore switches should be to ground (i.e. active low) with individual pullup resistors, typically 10K for CMOS and 1K for TTL.

author: CaptDon
author_rank: Super Contributor
timestamp: March 10, 2024, 01:53:55 pm
content: Another piss poor example of a circuit obtained online from an original designer who dwelled in theory and not reality. For that circuit to work correctly as drawn you would need a bunch of 220 ohm (TTL) or 1K ohm (CMOS) PULL DOWN resistors to insure a low state until you close a switch. However, then the resistors would waste power whenever a switch is closed. Floating CMOS can be influenced just by placing your hand within a couple of inches from the I.C.!! TTL inputs will weakly drift hi but is not stable as mentioned in the previous post. I hate these 'online' examples of circuits designed in theory but never built and proof tested in the real world!! Just another reason why I chose candidates for possible employment who had real world practical experience over know-it-all fresh-out-of-college kids with nearly meaningless degrees. "Well in college our book example showed......" 'a path to disaster mostly'.

author: Ian.M
author_rank: Super Contributor
timestamp: March 10, 2024, 02:20:48 pm
content: Furthermore, 74xx283 full adders are still in production in LS TTL and several CMOS families, as is the 4008, so why would you want to use seven logic ICs when one would do the job?

author: pcprogrammer
author_rank: Super Contributor
timestamp: March 10, 2024, 02:36:17 pm
content: Quote from: Fuldup on March 10, 2024, 11:30:53 amAre you simulating with very high voltages?Only then will a switch that is physically open still pass currentSo I guess you wrongly phrased your question and mean to say that the circuit is not stable when all the switches are open. Ian.M already gave the answer for this.Don't know your educational background, but this is one of the first things to learn about digital logic. What does an open input do. Datasheets provide information about this sort of stuff. Another thing one needs to learn is the use of decoupling capacitors. These can make or break a circuit.If this is part of your study and you want to know the working of digital systems it is better to use a simulator specific for digital stuff, like used in the FPGA field. Here you can simulate state changes and see the results of it in line diagrams, similar to what a logic analyzer shows.For specific behavior on analog level what you used is better, but then the question is if the models of the used gates are related to real ones. Otherwise it is still useless.

author: amyk
author_rank: Super Contributor
timestamp: March 10, 2024, 08:13:11 pm
content: It sounds like your circuit simulator is either capable of simulating gate capacitance to some extent, or the floating-input behaviour of TTL .

author: Ian.M
author_rank: Super Contributor
timestamp: March 10, 2024, 08:38:44 pm
content: Or its using a default switch model with one ohm on resistance and an off resistance low enough to still hold a CMOS (or other hi-Z) input high!

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 10, 2024, 09:42:54 pm
content: Quote from: CaptDon on March 10, 2024, 01:53:55 pmNow you know exactly how I feel about most C programming guides. Anything usingfgets()instead ofgetline()/getdelim(), oropendir()/readdir()/closedir()instead ofnftw()/scandir()/glob()makes me utterly sad, because the correct ones are specified inPOSIX.1(list) and are availableby default(you only need to declare in your sources youwantthem) just about everywhere. The one exception is native Windows (outside WSL2, Cygwin, MSYS2, etc.), where you will be using C++ and not plain standard C anyway. And don't get me started with"Error checking omitted for simplicity"and"I'll add error checking later when I have more time"(these never ever happen): it's like the horror clips from Chinese factory and assembly line accidents as used as a guide on how to squeeze maximum profit from your "workers".Decades ago, when I made my first circuit on a breadboard, I was warned about the stray capacitance and inductance of breadboards and how it affects anything sufficiently high-frequency, and how easily it picks up any kind of electrical or EM noise. Nowthatwas useful, because it made me immediately aware of the limitations, and only tookone sentenceto describe. Do you see anything similar when you look at sayFritzing breadboard tutorials? No. Exactly. Everything is dumbed down to the lowest common denominator.Now with 'AI'-assisted video and text generation, the barrier to producing such low-quality "information" is lower than ever before. We cannot rely on popularity pushing best advice on top, because it rarely happens even on sites like StackOverflow or Stack Exchange, where everything is geared and gamified towards making that happen.What works, is those with experience creating better examples, and simply telling early on why the "extra" is needed wrt. other examples and tutorials and guides. That part is crucial, because it is the only way to distinguish between easy wrong answers and thought-out advice. I'm doing my part here and elsewhere (even used to at SO/SE network, until their rules became impossible (not unacceptable, just impossible due to personal limitations) for me to follow), just like Dave does his with the videos.If good examples don't exist, we cannot berate the learners for following what examples do exist!Everyone else with the experience and understanding need to step up, or we'll drown in low-quality "information". You too, CaptDon!

author: CaptDon
author_rank: Super Contributor
timestamp: March 10, 2024, 11:02:57 pm
content: Indeed you are correct!! People asking CrapGPT to provide their answers or do their work for them is just plain scary!! Many textbook examples are so over simplified do demonstrate a thought only and not a practical workable circuit and then the bad times come!! Cheers mates. Learning should never stop.