Is it necessary to add an transistor to the output of my four bit adder. I want to add an led to show the 5 bit output. Should I add a transistor or or just directly connect the led’s anode to the output and cathode to ground?
What you are really asking is whether you can drive a LED directly from a digital signal, or whether it should be buffered by a transistor. Think about it. This has nothing to do with a adder or whether it is 4 bits wide or not.
The answer depends on the current capability of the digital output, and how much current you want to drive thru your LED. This really should have been obvious.
Most digital outputs can source or sink a milliamp or a few. Check the datasheet. Many modern LEDs will be bright enough to see whether they are on indoors on your bench with only a milliamp or a few thru them.
If you want more current thru the LED than the digital output can provide, then obviously the digital output can't drive the LED directly. In that case, a single transistor is usually enough to amplify the current and drive the LED.
If the LED is high current, like for lighting instead of just indicator use, then the current amplification ratio required may be higher than a single bipolar transistor can do. The right kind of FET may then be required, or a different topology altogether.