simulates how hardware runs a binary multiplication and division algorithm