The diffrence between RAM & ROM.

what is a ROM & RAM

Read-only memory is ROM Random-access memory is RAM

How do they work.

RAM, is used by computers to store and access information using a random order. RAM chips are only capable of storing and accessing information when electrical power is present but when the power is shut off all the memory is lost like humans in short term memory.

ROM is memory that cannot be changed by a program or user. ROM retains its memory even after the computer is turned off. For example, ROM stores the instructions for the computer to start up when it is turned on again.

why is it needed in a computer.

If a computer did not contain a RAM the hard drive would take its place but the computer would be very slow and without a ROM the computer wouldn't work as the computer can work without a RAM but can't be turned on without a ROM.