EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: banedon on August 20, 2013, 10:21:54 pm

Title: 4bit full adder project - no result
Post by: banedon on August 20, 2013, 10:21:54 pm
Hi guys

I'm a bit of a neewbie when it comes to electronics, but am trying my hand at a first project. Unfortunately, it's not working and I wanted to see if any of you knowledgeable/brainy types can see where I've gone wrong... :)

The following is *supposed* to be a 4 bit full adder. The two sets of inputs are set by SW1 & 2 which then set the pins of a CMOS CD74HC283E. The output pins then each drive the base of an NPN transistor which turns on a red LED to show that line being set to 1. The output Carry is treated similarly (uses a yellow LED).
Each IC has a decoupling capacitor (although from what I've read these ICs are so low powered that they don't need it).

Looking at this the only thing I can think of is that :
a) there needs to be a current limiting resistor between the +5v rail and th switches
b) the output signal is too weak to drive the base of the BC547 NPN transistors (would a Darlington work here?)

What does everyone think?  Any advice/constructive criticism would be very much appreciated.

(one note:  I marked the input to the 5v regulator as +12V when it's actually +9V - sorry!)

Circuit diagram:
(http://img809.imageshack.us/img809/2200/33zt.jpg) (http://imageshack.us/photo/my-images/809/33zt.jpg/)

UPDATE:
Here are the datasheets for the ICs:

CD74HC283E - http://www.ti.com/lit/ds/symlink/cd74hct283.pdf (http://www.ti.com/lit/ds/symlink/cd74hct283.pdf)
L7805CP - http://www.farnell.com/datasheets/1696820.pdf (http://www.farnell.com/datasheets/1696820.pdf)
Title: Re: 4bit full adder project - no result
Post by: JorgeCarbajal on August 20, 2013, 10:34:31 pm
Inputs are switched either 'high' or 'open', wich isnt a '0', usually an open pin would go high.
You need to use pull up/pull down configuration on these switches. Check the image attached.
(http://www.freewebs.com/maheshwankhede/ioports/input_switch.gif)
Title: Re: 4bit full adder project - no result
Post by: banedon on August 20, 2013, 10:38:13 pm
I think I see what you mean. While the DIP switches are set to off then those outputs are open. Argh I really am a  noob :D. Thank you for pointing this out.  Just got to buy more resistsors now lol!

BTW can you see anything else that I might have gotten wrong?  This is my first attempt at designing my own (admittedly very basic) circuit.

Cheers again!


UPDATE:  Here's my updated design:
(http://img22.imageshack.us/img22/8070/b0xo.jpg) (http://imageshack.us/photo/my-images/22/b0xo.jpg/)

Although doing it this way would mean that when a switch is "on" it's actually bring the line low (0), whilst when the switch is off the line goes high (1)?  Am I correct? 
Title: Re: 4bit full adder project - no result
Post by: Paul Moir on August 21, 2013, 01:49:15 am
Quote
Although doing it this way would mean that when a switch is "on" it's actually bring the line low (0), whilst when the switch is off the line goes high (1)?  Am I correct?

Yes, that's correct. 

You end up inverted a lot in TTL.  For example, TTL can usually "sink" much more than it can "source", which means you can run much more current into an output than you can actually get out of it.  In your circuit for example, the 74LS283* can only source a bit of current, so it needs those transistors to operate the ~20ma you're putting through the LEDs (5v - 1.9v LED voltage drop / 150 ohms).  If you wire them from +5v through resistors and into the outputs, you could run more current without the transistors.  But when the '283 outputted an "0" the LED would be on, and off for a 1.

* the 74HC283 can *source* and sink 25ma.  So you really don't need those transistors at all.  The 74HC283 can directly drive the LEDs, employing a current limiting resistor of course. 

Only further criticism I would make is that you probably don't need to put a full 20ma through the LEDs.  If they were rated at 20ma I would probably go 15ma for longer life with very little apparent change in brightness.  Something like a 220 ohm resistor instead of 150?  If you have 150 ohm on hand, then go with it though.  So totally minor.

 
Title: Re: 4bit full adder project - no result
Post by: edavid on August 21, 2013, 04:13:47 pm
* the 74HC283 can *source* and sink 25ma.  So you really don't need those transistors at all.  The 74HC283 can directly drive the LEDs, employing a current limiting resistor of course.

This is a common mistake in using HC.  There is also a package limit of 50mA, so you can't drive 5 LEDs @ 25mA.  (Also, 25mA is an absolute maximum, not a recommended condition, or even something you can necessarily achieve.)

Of course, modern LEDs are really bright.  You only need 1-2 mA to make them very visible, so you can drive them from an HC output with say a 1K resistor.

Also, with the switches, there is no reason not to put them on the high side and use pulldown resistors.  Even with TTL, this is not "fair", this is fine.
Title: Re: 4bit full adder project - no result
Post by: MacAttak on August 21, 2013, 06:06:50 pm
Also, if you move the limiting resistors to the anode [oops! I meant cathode] of the LED bank, then you can replace them all with a single bussed resistor network whose common pin is tied to ground. Similarly, you can use a second bussed resistor network to handle all of the pull-ups or pull-downs (whichever approach you decide to use).

I'm just a fan of not using any more parts than required, and 2 parts is better than 13 parts. Price won't be much cheaper (if at all), but when routing a board for minimum area it can make a difference.
Title: Re: 4bit full adder project - no result
Post by: Paul Moir on August 22, 2013, 12:59:49 am
Dohh, I knew I should have check ed that.  Thanks MacAttak!
I've been out of the loop for a bit, and never really got into the CMOS parts.
Title: Re: 4bit full adder project - no result
Post by: banedon on August 24, 2013, 04:25:17 pm
Hi guys

Thanks for the help and advice.

I've put together my first self-designed digital project with the following results. Please keep in mind that although I'm not exacly superman when it comes to soldering, I'm not normally as bad as demostrated here. I had to put in wire links and solder bridges (and used tons more solder than normal doing this) as I mistakenly purchased the wrong type of board. I was actually after strip board, but got this stuff instead.

Top side
(http://imageshack.us/a/img827/5219/sw9q.th.jpg) (http://imageshack.us/photo/my-images/827/sw9q.jpg/)

Bottom (solder) side
(http://imageshack.us/a/img823/9725/0st8.th.jpg) (http://imageshack.us/photo/my-images/823/0st8.jpg/)

I ended up using the 10K drop down resistors which ahd the unwanted effect of inverting the on/off positions of the switches - not that it makes much difference for a demo project.
Also, I used 220R resistors to limit the LED current draw and that seems to work fine despite the max current output of the 74HC283.

Does anyone have any tips or constructive commends on what I've done?  I ask as I made this project to learn as I only started teaching myself electronics a couple of weeks ago using the internet and some good forum advice here :).

-Mike
Title: Re: 4bit full adder project - no result
Post by: Clint on August 24, 2013, 04:28:16 pm
Looks good enough to me :)

Are they Allen Bradley Resistors ?
Title: Re: 4bit full adder project - no result
Post by: banedon on August 24, 2013, 04:38:56 pm
Thanks for saying :).

Both resistor types used are TE CONNECTIVITY / NEOHM purchased from Farnell:
220R - http://uk.farnell.com/te-connectivity-neohm/cbt25j220r/resistor-carbon-comp-1-4w-220r/dp/1265068?Ntt=126-5068 (http://uk.farnell.com/te-connectivity-neohm/cbt25j220r/resistor-carbon-comp-1-4w-220r/dp/1265068?Ntt=126-5068)
10K - http://uk.farnell.com/te-connectivity-neohm/cbt25j10k/resistor-carbon-comp-10k-250mw/dp/1265079?Ntt=126-5079 (http://uk.farnell.com/te-connectivity-neohm/cbt25j10k/resistor-carbon-comp-10k-250mw/dp/1265079?Ntt=126-5079)

They looked ok - what's your opinion of the make?
Title: Re: 4bit full adder project - no result
Post by: Clint on August 24, 2013, 04:42:43 pm
My opinion is that they look like a resistor should look :)

I recently purchased some very similar looking ones made my Allen Bradley.
Title: Re: 4bit full adder project - no result
Post by: banedon on August 24, 2013, 04:47:07 pm
lol ok.  I wonder as I know there are some makes of capacitors to avoid so wondered if the same were true of resistors.
Title: Re: 4bit full adder project - no result
Post by: Clint on August 24, 2013, 04:49:42 pm
I am sure there are but anything that comes out of TE will be to spec without a doubt.
Title: Re: 4bit full adder project - no result
Post by: SeanB on August 24, 2013, 04:53:53 pm
Normally the ones to avoid are those made by a mystery manufacturer in some random sweatshop. Most though made by any manufacturer are fine for most general purpose use. There are specialist resistors, and as the specs are narrowed the price rises. When you are looking for stable ( from -55 to 125C with no drift or with under 0.01%) and low noise they get really expensive. When they have to be stable for decades then they get to eye wateringly expensive.

For most general use any one will do. For TTL that is a not terribly demanding application, even carbon composition is fine.