cpu arithmetic basic implementation