How can I modify a PowerBook or iBook G4 to install Yosemite or Sierra? I own a PowerBook G4 A1104 with 512 mb of ram and 1.5 ghz and I also own an Ibook G4 1.33 Ghz 512 ram. I have seen videos on youtube of people turning their ibook g4 and imac g4 into  machines running from Yosemite to Sierra.

How can I accomplish this?
Your Mac uses the PowerPC processor. Yosemite and Sierra require an Intel x64 compatible processor. So a software modification not practically possible. I can not directly answer the question regarding whether a hardware modification can be made. Although, I can say that usually such modifications require reusing the existing logical board, RAM and peripherals. The existing logic board, RAM and peripherals will be to slow for Yosemite and Sierra. Furthermore the video will not support the higher resolutions required by Yosemite and Sierra.

If you want to choose a current operating system, try Ubuntu (Lubuntu) or some other linux distro.