The beep you hear is a BIOS Beep Code.
The computer's way of telling you something is wrong, and a general area to look in.
The Compaq Presario S5100NX uses an Asus P4G533 motherboard, with an Award BIOS,http://h10025.www1.hp.com/ewfrf/wc/documentSubCategory?tmp_rule=51284&tmp_task=prodinfoCategory&lc=en&dlc=en&cc=us&lang=en&product=363427
Left-click on - Motherboard Specifications, P4G533 (Echo)
One long continuous beep indicates Ram Memory failure.
Your diagnosis is correct.
I would like you to take the ram memory module/s out, and clean the gold plated contact pins on the bottom.
Suggestion is to try this, before resolving to replace the ram memory.
A pencil eraser is used to clean the contact pins.
The Compaq Presario S5100NX, uses DDR Sdram ram memory modules,http://en.wikipedia.org/wiki/File:Generic_DDR_Memory_%28Xytram%29.jpg
The above link is provided to give a closeup side view, of a DDR Sdram ram memory module, and it's gold plated contact pins.
Use the pencil eraser to stroke down each contact pin. Both sides.
(A DDR Sdram ram memory module has 184 contact pins. 92 on each side)
Refrain from touching the contact pins with your fingers.
You can touch the body of the module anywhere you wish, as it is coated with a see-through protective plastic.
If an eraser on the end of a pencil is used, do Not let the metal part of the pencil, rub against the contact pin.
Use air to remove the eraser dust. You can use a can of compressed air for computers, or air from your mouth may be sufficient.
Reinstall the ram memory module/s.
HP Support product specifications, indicate the Compaq Presario S5100NX comes with one - 256MB DDR Sdram ram memory module.
If there has been two ram memory modules installed, suggestion is to reinstall one at a time, to see if there is a bad ram memory module.
Yes, it's kind of a pain.
When installing just one ram memory module, it is installed in Slot 1.
The ram memory slot that is closest to the Processor.http://h10025.www1.hp.com/ewfrf/wc/document?docname=bph07845&tmp_task=prodinfoCategory&lc=en&dlc=en&cc=us&product=363427&lang=en
Scroll down the above page until you come to the motherboard illustration, and the motherboard photo underneath it.
In the motherboard illustration - DDR DIMM 1 (64/72 bit, 184-pin module) indicates Slot 1.
Install one cleaned ram memory module in Slot 1, plug the computer into power, WAIT 1 minute, turn the computer on.
Computer shut down normally (Start>Turn Off Computer>Turn Off), unplug from power, observe anti-Static precautions.
Remove that ram memory module, install the other one.
Your body carries Static electricity.
Static WILL fry out (Short Circuit), the hardware components inside a computer.
You may not even see it, or feel it.
(Hmmm, I did everything right, but my computer doesn't work)
Computer on a table, unplugged from power, computer case open.
TOUCH the metal frame of the open computer case, to relieve your body of Static.
If you get up, and walk away in the middle of working on your computer, upon your return Touch the metal frame again ]
Note the Locating Notch, on the bottom of the ram memory module.
It lines up with a Locating Lug, in the bottom of the ram slot on the motherboard.
At a casual glance the Locating Notch may seem to be in the middle.
It is Not.
Assure that you have the module turned the correct way when reinstalling, so that the Notch lines up with the Lug.
Note the Locks at each end of the ram slot. (White in color)
The top of the Lock is eased towards the outside.
(Away from the ram slot)
Ease both Locks up at the same time.
Note that the bottom corners of the ram module, sit in small slots, of each Lock.
As the ram module is pushed down into place, the Locks are brought up simultaneously.
Note that there is a Notch, on each side of the ram module.
The Lock has a protrusion ('Bump') that fits into the Notch, when the ram is fully seated in the ram slot.
Sometimes the 'Bump' does not fit in perfectly into the Notch. It's okay.
If there are two clicks, from the Locks snapping into the Notches, the ram memory module should be fully seated.
Basic video guide, to installing ram memory in a desktop computer,http://www.youtube.com/watch?v=r2EC4BxtBSY&feature=related