4 bit adder project need help

Thread Starter

automagp68

Joined Nov 13, 2011
81
Hi

Im a first year EE student just fooling around with some TTL logic and i cant get my little design to work.

I have a TI SN74LS83AN logic chip "assumed ot be a 4 bit fast adder"

I have a have a data sheet for a Motorolla version and assumed it was the same as i cant find the TI one ANYWHERE

Needless to say the thing doesnt work.

I have built it twice, and tested each part individually as i went, switches, leds powers grounds etc to illiminate any issues later but the thing is still not working and just acts random

Im wondering if the pin out is different
Im new to this so not sure if the pinout would be different or conventionally its the same from manf to manf

Any ideas?

I have a diagram i made in EAGLE if that would be helpful.

Ill post it in a second but for now my question is more about the difference in the datasheet

Thanks
 

Thread Starter

automagp68

Joined Nov 13, 2011
81
I finally found the schematic

It appears the pins are the same

But it still doesnt work

Im thinking at moment it needs a pull down resistor in between all the switches so the chip sees a true 0

Any ideas?
 

Thread Starter

automagp68

Joined Nov 13, 2011
81
Ok the pull down resistors did not work.

Will someone please help me?
This is fairly simple, so i find it hard to believe that no one on this board can help
 

elec_mech

Joined Nov 12, 2008
1,500
automagp68,

Please note this is an international forum, meaning it could take up to 24 hours before someone sees your post who can help.

What exactly is not working?

The output LEDs don't light, the input LEDs don't light, the value displayed on the output LEDs doesn't match the value you expect, etc.?

What is your supply voltage (Vcc)?

First, you are right, you need pull-down resistors on all the inputs. You should also add current-limiting resistors to the output LEDs and a 0.1uF capacitor between Vcc and GND as close to you IC as possible.

Second, remove LEDs 1-8 and connect the output of the switches directly to the input pins of the 74LS83. Do the output LEDs work now? If yes, you can use MOSFETs or transistors to power your input LEDs. The power draw from them might have interfered with your inputs to the IC.

If the output LEDs still don't light (assuming this is your problem), remove the output LEDs and test the outputs of the IC with a voltage meter. Is the output value what you expect given whatever your input values are set at?
 

Thread Starter

automagp68

Joined Nov 13, 2011
81
Hi there

Thanks for the ideas, I did not know this was an international forum.

So here is where i am at

The intial problem was all the output LEDS were on when all inputs where at a low

I did add pull down resistors after thinking about it but stupid me i put in 10k resistors.

Which needless to say did not fix my problem and also caused my logic probe to show a false zero at the input pin.

After futsing around some more i thought that maybe the value was to high and the pin was still not seeing a true zero regardless of what my logic probe said. So i took it down to 1k and presto! It is working. I have not reorganized the bits as to get correct readings because the data sheet did not specify which pin was the MSB and which was the LSB, at moment i think i have it backwards but none the less when u flip switches the value changes! which is all i really wanted.

Im taking a digital design class where we study this stuff so i just wanted to see it work in real life. I have not taken a real cirucits class yet so i have had to learn about pull down resistros on my own and why they are needed. Makes sense though.

Could you please explain the other comments you made?

Why should i add a cap? and where exactly should i put it?

I have a revised schematic im going to post in a minute.

I would like to enhance this design as best as possible.
Also you mentioned adding current limiting resistors.

Could you please explain this fucntion. At moment the INPUT LEDS are very dim when you flip the switches and the OUTPUT leds are nice and bright. Might be old crappy leds i guess.

This is a 5 volt system. by the way.

Also once it is working correctly i plan to run the output pins to an ARDUINO microcontroller in which i wrote some code to act as a 7 segement LED driver. With the intent on seeing the base 10 number instead of the base 2 number.

Thanks for any suggestions! Ill post the revised schematic in a second
 

elec_mech

Joined Nov 12, 2008
1,500
I did add pull down resistors after thinking about it but stupid me i put in 10k resistors.
10kΩ should work fine. I think the issue is the input LEDs. More on that below.

Im taking a digital design class where we study this stuff so i just wanted to see it work in real life. I have not taken a real cirucits class yet so i have had to learn about pull down resistros on my own and why they are needed. Makes sense though.
Pull-down and pull-up resistors are are used to set an input pin in a specific state when no signal is present. In your circuit, you use the switch to send a high signal (logic 1) to your input pins as needed. However, when the switch is off, the input pin does not see a low signal (logic 0), rather it sees nothing and doesn't know what to do. Electric noise in the IC or on the input pin could make it think it is getting a logic 1 or 0 when it is not. The pull-up/down resistors force the input pin into a desired state when there is no signal. Since you want a low signal (logic 0 state) when the switch is in the off position, you want a pull-down resistor on each input pin.

I have not reorganized the bits as to get correct readings because the data sheet did not specify which pin was the MSB and which was the LSB, at moment i think i have it backwards but none the less when u flip switches the value changes! which is all i really wanted.
Generally speaking, A1, B1, and Ʃ1 should represent LSB and A4, B4, and Ʃ4 should represent MSB.

Why should i add a cap? and where exactly should i put it?
The capacitor is used to help reduce noise in the circuit, but more specifically generated by the IC when it changes state (high to low transistions for example). I know this is a concern in CMOS ICs, I'm not so sure in TTL ICs as you're using, but it won't hurt. You want to place the capacitor as physically close to the power pins as possible. You can place the cap on the IC's GND pin and the other lead to the nearest Vcc connection or vice versa. In a perfect world, you'd place the cap directly across the power pins, but that isn't practical.

Also you mentioned adding current limiting resistors.
LEDs require current-limiting resistors so they do not get burned out due to excessive current. There are people here who can and have explained it better than I, so I recommend doing a search in the forum under this subject. I can explain how to size them though: R_LED = (Vcc - V_LED)/I_LED.

So we know Vcc is 5V. V_LED and I_LED depend on the ratings of the LED which will be given in the LED's datasheet or the back of the package if you bought them from RadioShack. For example's sake, let's say you are using diffused red LEDs (where the LED body is red, not clear). V_LED is about 2V and I_LED will be between 2mA and 20mA. Most LEDs use 20mA so we'll go with that. So, R_LED = (5-2)/0.02 = 3/0.02 = 150Ω. If you were using these LEDs in your output circuit, you'd place a 150Ω in series with every LED, either between the output pin of the IC and the LED or between the LED and GND.

Could you please explain this fucntion. At moment the INPUT LEDS are very dim when you flip the switches and the OUTPUT leds are nice and bright. Might be old crappy leds i guess.
No, I doubt you have bad LEDs. I don't think the input of your IC is designed to sink enough current to power the LEDs. LEDs require a fair amount of current, while the high/low signals the IC input pins expect is fairly small. I think the LEDs are why the 10kΩ resistors didn't work and 1kΩ. The 1kΩ are providing enough of a current path for the LEDs to operate on.

I'd recommend using transistors to power the LEDs independently. Instead of spending a lot of time learning about transistors and making a lot of connections, I imagine you have access to a ULN2001/2003/2803/2804 trasistor array. You should be able to connect the input signals directly to the input of the ULN IC and connect the LEDs to the output pins of the ULN with current-limiting resistors. This shows a simple example of how to use these types of ICs: http://www.google.com/imgres?q=uln2...tart=0&ndsp=10&ved=1t:429,r:0,s:0&tx=46&ty=59

You can also use a UDN2981/2, but then the LED is connected to GND, not Vcc.

Also once it is working correctly i plan to run the output pins to an ARDUINO microcontroller in which i wrote some code to act as a 7 segement LED driver. With the intent on seeing the base 10 number instead of the base 2 number.
Sounds good. There are ICs that convert binary-coded decimal (0-9) to 7-segment, but none that I know of that convert true binary (0-15) to decimal. You could use the Arduino to convert from binary to BCD then use a BCD-to-7-segment IC to drive the 7-segment displays. This would reduce the output pins needed on the Arduino from 14 to 8. Look at the 7447 and 7448 depending on the type of 7-segment display used (common cathode - CC vs common anode - CA). Of course, if pin count isn't a problem, you can certainly drive the 7-segment displays directly from the Arduino as long as the displays aren't too big (beyond about 0.8" high).

Hope this helps.
 

Thread Starter

automagp68

Joined Nov 13, 2011
81
What a great bit of information! "haha get it BIT" lol that was def an EE joke!

Thanks so much.

There is so much more to this then just what we see in school. i.e the ones and zeros!

So with all the great information i have a few more questions just for clerificiation.


In regards to the cap.

The capacitor is used to help reduce noise in the circuit, but more specifically generated by the IC when it changes state (high to low transistions for example). I know this is a concern in CMOS ICs, I'm not so sure in TTL ICs as you're using, but it won't hurt. You want to place the capacitor as physically close to the power pins as possible. You can place the cap on the IC's GND pin and the other lead to the nearest Vcc connection or vice versa. In a perfect world, you'd place the cap directly across the power pins, but that isn't practical.
In here you use the word "PINS" as plural

So just to make sure i know what you mean, you want me to place a Cap In series with every single power pin i.e all 8 inputs, the one vcc power for the chip and the GND so a total of 10 caps all in series?

As close to the IC as i can get.

I just want to make sure i understand correctly.

In regards to the Transistor array this is a very neat idea.

But let me see if i understand you correctly. "as i need to do some more research on the transistor array. We have not even covered those yet so im going off what i have learned from my own tinkering.

The array does the following.....

We wire the output of all of the switches as normal, but we tap the output before it hits the input pin and send it to an input on array. I assume the array has its on VCC as to not draw from the intial current off the switch. The signal line continues normaly untill we run into another junction that goes down to the pull down resistor and then on again to the input pin.

This does the following if im understanding correctly.

The array sees a high when we flip the switch but pulls virtually no current and say O time to turn the light on! Uses it own VCC and turns on the light as to not draw current from the intial circuit.

The pull down resistor stays in place as normal. and the signal continues on to the input pin of the IC and does it thing. We shut the switch off, the pull down resistor does its thing and shows a true zero at the IC and the transitor now showing a low also sees a true zero from the pull down resistor and shuts its LED off. So its basically like a relay.

Does that sound right?

Sounds cool to me if thats the way it works.

Just need you to clerify where exactly the caps go and i think im in business.

as far as the MSB and LSB goes i assumed that was the case. as conventionally when you set up a truth table the A4 would be the far left. etc

Ill have to look into the current limiting resistors some more and do a bit more research, but in lamense terms, is the point of them to limit the amount of draw from the transistor array or is the point to limit the amount of current aloud to go through the LED to prevent burning them out?

Or both?

Thanks so much for all the help! this is awesome! As this is my first circuit and first attempt at a schematic.

Our class only does the lecture no hands on lab so im kinda doing this all on my own and my professor is semi useless.

Thanks again!!!!!
 

kubeek

Joined Sep 20, 2005
5,794
So just to make sure i know what you mean, you want me to place a Cap In series with every single power pin i.e all 8 inputs, the one vcc power for the chip and the GND so a total of 10 caps all in series?
No, you put one end to GND and one end to VCC, and you place it resonably close to the IC. Usually 100nF ceramic cap is used.

The array does the following....
Transistor array is something completely different in common talk, I think you meant the logic IC.

The resistors in series with the LEDs are for limiting the current through the LED, and consequently also throught the output pin of the IC.
74xx series is has quite sturdy outputs, so here the resistor is used mainly to protect the LEDs from overcurrent which damages them rapidly.
On 40xx series CMOS chips, the outputs are weak and limited to cca 5mA or less, so there you would use larger resistor value to limit the current to that number, otherwise you are likely to destroy the outputs of the IC.

The input LEDs should be in PARALLEL with the inputs, so that +5V can go to the logic input, and also to the current limiting resistor in series with each LED.
 

Thread Starter

automagp68

Joined Nov 13, 2011
81
Transistor array is something completely different in common talk, I think you meant the logic IC.
Array was the term used above so that is where i got it. Hoever, the LOGIC chip loaded up with the 8 transistors works as i mentioned correct?

No, you put one end to GND and one end to VCC, and you place it resonably close to the IC. Usually 100nF ceramic cap is used.
Please be more sepcific, So all i need is one Cap, I take the VCC that powers the chip, NOT the inputs or ground for the chip, and run one end of the cap to ground the other end of the cap gets two connections like a T
One from the VCC and the other going to power the chip?

Is that correct?

Thanks
 

kubeek

Joined Sep 20, 2005
5,794
I don´t see any point using the transistor array, I think it was more of an exmple.
Just connect it like this, the decoupling cap as you can see is in parallel with the IC´s power supply.

Even though R1..R4 might seem superfluous they are needed there, because the input LEDs will have Vf of about 3V, so the LEDs can´t pull the inputs lower than this voltage, so they don´t provide a solid logic level.
 

Attachments

elec_mech

Joined Nov 12, 2008
1,500
As Kubeek pointed out, yes, only one capacitor is needed per IC to filter noise. By pins, I meant Vcc and GND, but as Kubeek said much simplier, the cap goes across the power lines, Vcc and GND, as close to the IC as you can put it.

I haven't put LEDs on input signals, hence my recommendation of using a transistor or transistor array. Kubeek's solution is much simplier and makes sense now that I "see" it. Thank you Kubeek!
 

Thread Starter

automagp68

Joined Nov 13, 2011
81
Hi guys

Thanks for the drawings and ideas

Sounds good to me.
So i will swap a few things. I will T in the cap for the IC and take the LEDS out of series, and run them as suggested.

Should 150 ohms do as a current limiting resistor for the LEDs?

I think someone mentioned that.

Other then that i think im in business.

Also Elec Mech you mentioned there are such chips that acutally are designed to run a 7 segment drive?

do you recall any numbers for these?

Id like to check them out.
I plan on finishing this project and then onto a headphone amplifer



Thanks again for all the ideas and help.

Ill post a revised and final schematic of the optoimized design
 

kubeek

Joined Sep 20, 2005
5,794
The output leds need resistors too. If youre going to use Eagle to make the board, use the Invoke tool to show the power supply of the IC and connect it. 150ohm should be ok.
 
Last edited:

elec_mech

Joined Nov 12, 2008
1,500
The output leds need resistors too.
Ditto. I suggested 150Ω resistor if you're using common red diffused LEDs as these are often used for indicators. If you have the forward voltage and current rating of the LED, you can refer to my earlier post on how to calculate the current-limiting resistor value.

Also Elec Mech you mentioned there are such chips that acutally are designed to run a 7 segment drive?
7447 (74LS47, etc.) can be used for common anode displays. I'm not sure if it's still made, but the 7448 is used for common cathode displays. You can do a search for BCD to 7-segment decoder IC. I'm a little more familar with the CMOS version, CD4511, but CMOS and TTL don't always play well together, so I'd stick with a TTL chip (7400 series).

Please note again, these chips will only work for values from 0-9 since a 7-segment display can only display 0-9. As you're using true binary, 0-15, you'll need the Arduino to convert binary to BCD.

I just remembered someone else here is working on a similar project. That person wanted to convert binary, 0-15, to a two-digit 7-segment display. JDT came up with a cool solution using discrete CMOS ICs (no microcontroller needed). Take a look at post #9 here: http://forum.allaboutcircuits.com/showthread.php?t=60890.

The CD4008 would replace the 74LS83 or you could keep it and look for 7400 series equivalent ICs in place of the 4000 series ICs.
 

Thread Starter

automagp68

Joined Nov 13, 2011
81
Hey guys

Check this out

I wired the thing finally the exact way of the last schematic except i added the resistors for the output leds also and it fried the chip

I took the cap out installed a new chip and it works great. Just as expected. Any idea why the cap fried the chip
 
Top