Infosys interview question

Asked me write a very simple algorithm based on microprocessor