I'm currently trying to build a 8 bit ALU. I was able to make the half-adders and Full-adders from scratch (Using the Logic Gates); however when I'm using 74LS283, I'm having trouble.
This is my circuit diagram.
(If they ask you to log on - just close the box; I believe you can see the image afterwards. Or just refresh the page.)
Am I doing something wrong here?
EDIT: Mistake in the diagram: The LEDs should be put to GND, not to (+) as shown.
You will not pull down a 74LS input with a 10K resistor, that is way too high. You can use a 220R to 330R to do that. It was rare that you pulled a 74LS input low, normally you pulled it high ( with 4K7 ) and then switched it low.
The same goes for the LEDs on the outputs you normally sink current with them which means they are shown correct except they are the wrong way round.
That is not so much of a problem with 74LS logic. Unconnected inputs float high. The noise immunity is poor but that would not cause his problem. If it were just that then all that would happen is that the output would flicker between n and n+1.
74LS chips cannot really tolerate 5V on the inputs since even a small amount of rail noise
will take them over the abs max or 5.5V. You show no decoupling capacitors - you need at
least one right next to the chip or it will may malfunction. And yes you have the LEDs
shown as diodes and facing the wrong way round.
You always use 10k pull-ups with 74LS and switches to ground, since this protects the inputs
from overvoltage (For TTL families HIGH is above 2.4V and LOW is below 0.4V or so. The
correct pull-down for TTL is 0 ohms (!).
In TTL floating inputs will tend to read as HIGH unless there's a lot of noise about - so tie them
to GND or via 10k (LS) or 1k (TTL) to +5V.
Why on earth are you using a TTL chip at all? The 74HC283 is the CMOS part and
has none of the strange restrictions on inputs, and it will work from 2V upto 6V. With
CMOS there's no debate, all inputs must be driven, never left floating.
MarkT:
74LS chips cannot really tolerate 5V on the inputs since even a small amount of rail noise
will take them over the abs max or 5.5V.
No that would take 0.5V noise on the rail and that is not small is it?
Never ever had any problems with connecting LS TTL to 5V, have you?
The correct pull-down for TTL is 0 ohms (!).
Care to share the maths on that one?
Look at the sink current that you get with a zero on the input. Then take that sink current and calculate what resistor you need for 0.4V at that current. It is not zero is it?
With CMOS there's no debate, all inputs must be driven, never left floating.
TomGeorge:
Use REPLY rather than QUICK REPLY and it has an attachment facility, so you can post your sketch, files as an attachment.
I wish you would not encourage people to use attachments.
What affects me is that many of my computers cannot access the attachments due to the (apparently deliberate) way the forum software now obfuscates them (since the so-called "update" ).
And as it affects most people, ".pdf"s as attachments require a separate viewer, and ".ino"s require you to start up the IDE just to view them.
If images are lodged somewhere reputable (including previously on the Arduino.cc server), they can be linked into the text so they are immediately visible, and code posted in the correct tags is immediately usable.
Grumpy_Mike:
MarkT:
74LS chips cannot really tolerate 5V on the inputs since even a small amount of rail noise will take them over the abs max or 5.5V.
No that would take 0.5V noise on the rail and that is not small is it? Never ever had any problems with connecting LS TTL to 5V, have you?
Whether the noise exceeded the "Absolute Maximum" rating is neither probably nor particularly significant. I fancy LS logic did include parasitic diodes which would clip this. I thought there was some other reason related to parasitics whereby actually tying to the Vcc rail resulted in a leakage current.
But the point is - the series is obsolete. If you have a heap of them lying around, maybe you would use them for a lurk, but the performance - notably quiescent current and speed - of CMOS is so much superior that you should never use them in a new design.
Some time back (it was!) I made a point of replacing the 7490s and such in our KYOKUTO FM144-10SXRII with LS chips - that radio has a bad reputation for unreliability and the heat build-up in the synthesiser section (as well as dodgy soldering apparently) was a clear contributor, so it was completely worthwhile to do all the de-soldering and replacement. It subsequently would make yet again more sense to replace it with HCMOS which I intend to do with another one that I came across. (Easier to operate than current models with lots of buttons and menus!) The later model had a chip with a Ni-Cd battery backup which needed to be replaced with a supercap. Were I to work on it now, I would of course replace the whole microcontroller with an ATMega328 using its EEPROM instead.
Building your own ALU is a pretty obsolete concept, regardless of which electronic family you use.
I was recently given a bunch of supposedly mint condition Z-80 chips, and I thought, neat, I can build my own computer, like it is 1978. And then I thought, why ?