Mac power PC

If i put the Memory from a Mac PPC to add it to another the same type,does it work outomatically or what will happen.
I have a Mac PPC G4 with OSX 10.4 on and would like to upgrade Hardware. Found now a PPC G4 with OSX 10.5 on. Does it work straight away or must i download the OSX again?