Hw from CISP300 depicted in C++