Itron interview question

had to solve some circuits and write a program in vhdl.