Author Topic: 4 bit Adder  (Read 463 times)

0 Members and 1 Guest are viewing this topic.

Offline FuldupTopic starter

  • Contributor
  • Posts: 16
  • Country: ch
4 bit Adder
« on: March 10, 2024, 11:30:53 am »
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/
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: 4 bit Adder
« Reply #1 on: March 10, 2024, 11:44:30 am »
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.
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1740
  • Country: is
Re: 4 bit Adder
« Reply #2 on: March 10, 2024, 01:53:55 pm »
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'.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: 4 bit Adder
« Reply #3 on: March 10, 2024, 02:20:48 pm »
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?
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3710
  • Country: nl
Re: 4 bit Adder
« Reply #4 on: March 10, 2024, 02:36:17 pm »
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.

Are you simulating with very high voltages?

Only then will a switch that is physically open still pass current  :palm:

So 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.

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8276
Re: 4 bit Adder
« Reply #5 on: March 10, 2024, 08:13:11 pm »
It sounds like your circuit simulator is either capable of simulating gate capacitance to some extent, or the floating-input behaviour of TTL .
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: 4 bit Adder
« Reply #6 on: March 10, 2024, 08:38:44 pm »
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!
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6264
  • Country: fi
    • My home page and email address
Re: 4 bit Adder
« Reply #7 on: March 10, 2024, 09:42:54 pm »
I hate these 'online' examples of circuits designed in theory but never built and proof tested in the real world!!
Now you know exactly how I feel about most C programming guides.  Anything using fgets() instead of getline()/getdelim(), or opendir()/readdir()/closedir() instead of nftw()/scandir()/glob() makes me utterly sad, because the correct ones are specified in POSIX.1 (list) and are available by default (you only need to declare in your sources you want them) 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.  Now that was useful, because it made me immediately aware of the limitations, and only took one sentence to describe.  Do you see anything similar when you look at say Fritzing 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!
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1740
  • Country: is
Re: 4 bit Adder
« Reply #8 on: March 10, 2024, 11:02:57 pm »
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.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 
The following users thanked this post: Nominal Animal


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf