4
\$\begingroup\$

I am currently trying to build a 4-bit adder and I've run into an odd problem.

The LEDs only seem to light up if my fingers are near, seemingly arbitrary, parts of the circuit. I have only connected two bits so far. The circuit seems to work as intended, I also tested it on TinkerCad.

0+1 returns 01 a.k.a 1 in decimal

1+0 returns 01 a.k.a 1 in decimal

1+1 returns 10 a.k.a 2 in decimal

I just don't get why the LEDs are behaving oddly.

Look at the TinkerCAD sketch for the circuit, my build irl is basically identical with the only difference being I've rotated the dip-switches 180 degrees so the numbers of the dip-switch are facing upwards. I have also logically so connected the dip switches to low (negative) instead of the high (positive) you see on the TinkerCAD sketch.

enter image description here

Irl mine would be:

enter image description here

I am running it on 5 volt. The resistors are 1kOhm resistors.

XOR gates are of the model 74HC86N

AND gates are of the model 74HC08

OR gates are of the model 74HC32

See video for clarification video.

\$\endgroup\$
1
  • \$\begingroup\$ Some breadboards have split power rails. The long +/- rows on top and bottom of the breadboard are on some models not continuous from left to right. Maybe check that. \$\endgroup\$
    – jnovacho
    Nov 11, 2020 at 12:20

3 Answers 3

9
\$\begingroup\$

The problem is that you have HC type CMOS logic chips, and in the video LS TTL type chips are used. CMOS chips don't work in a circuit that is deliberately made to utilize the characteristics of LS TTL type chips.

So your inputs float unconnected when the DIP switch is off, and the CMOS chips in your circuit do not work properly with unconnected inputs.

LS TTL chips use bipolar transistors and their internal circuitry is such that an unconnected input pin will tend to float high at logic 1 level, as the input impedance is moderate. So they can, but are not recommended to, be left unconnected.

CMOS chips have extremely high input impedance, and have no internal circuitry to default to a certain state. Thus leaving them unconnected can make the voltage drift to any random level, and a finger has low enough impedance to set the pin state quite easily to logic high or low, depending on if you are touching VCC or GND with another finger.

Basically it means that since your DIP switches either connect an input to VCC or leave it completely disconnected, for each DIP switch, you need a pull-down resistor. Almost any value between the range of 1 kilo-ohm to 1 megaohm will work.

\$\endgroup\$
10
\$\begingroup\$

I see two problems here.

First, you don't have any pull-up resistors, so your switches can't actually provide a high input. 74 series chips frequently have inputs that float high, but I think the CMOS varieties (like 74HC) need a pull-up or pull-down resistor to function properly.

Second, you have a lot of unconnected inputs, which are picking up noise and amplifying it into other parts of the circuit. Hook the unused inputs up to Vcc or ground through a resistor.

\$\endgroup\$
7
\$\begingroup\$

CMOS floating inputs are very receptive to stray electric fields.

You need pulldown resistors on the switched_nodes. Use 100Kohm.

Fresh out of university, I assisted a very senior guy debug a 3_rack cabinet logic system: the central_station telemetry receiver for South Florida Flood Control District, monitoring dozens of remote sites out in swamps that would daily report rain, water levels (in the swamps), salt water intrusion (in canals where heavier salt water would become the underlying layer), winds, etc.

We had lots of intermittent behavior. Finally we realized about 20% of the RCA Corp DIP packages, on Augat wire_wrap boards, CD40xx 12_volt logic,

had no power or Ground connections

The clock speed was rather slow (100,000Hz bit rate, from the long_range radio links in the 400MHz RF band) and CMOS needs zero input current once transient charges have charged the nodes, and at +12 volts the NOISE IMMUNITY was very high, so the

LOGIC was getting POWER thru the ESD DIODES

====================================================

Do not let the CMOS inputs float. Have either a switch tying the input to +5 or to Ground; OR have a (10Kohm) resistor pulling in one direction, and the switch pulling in the other.

Or are those SPDT switches? Cannot be, because the white board does not allow such connectivity.

\$\endgroup\$
4
  • \$\begingroup\$ Pardon me, I am not all too familiar with the vocabulary. Do you mean I need to replace the black wires connecting the dip-switches to negative with resistors? I do not have 100Kohm resistors, would 10Kohm suffice? \$\endgroup\$
    – NoName123
    Nov 10, 2020 at 16:44
  • \$\begingroup\$ What is the difference between mine and this guys's. How come his works even with floating CMOS inputs? They are SPST switches \$\endgroup\$
    – NoName123
    Nov 10, 2020 at 17:12
  • \$\begingroup\$ Since your switches are connected to Ground, you need pull-up resistors connecting the IC inputs to +5V - 10K would be fine. Also, it looks like you only have one pole of each switch connected to Ground - you need to connect all four poles of each switch to Ground. \$\endgroup\$ Nov 10, 2020 at 17:22
  • \$\begingroup\$ "This board works when we ship it with a $20K logic probe." \$\endgroup\$ Nov 10, 2020 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.