The Algorithmic Ascent: From Logic Gates to Sentient Machines