its either your Ram or VGA (normally attached to the motherboard) is faulty. RAM changeable but i don't think VGA is changeable
Test your RAM. if you have two RAMs' test each one separately. better to test on a working PC. if its bad then test a good RAM on your PC and see the result.