C++ implementation of a 4-bit and 1-bit ALU