At the compiler level, the differentiation is based on data type. If the data type is int, then 4 bytes is allocated to that variable (in C). So 15 in 2's complement is 00000000 00000000 00000000 00000000 00001111 while -1 is 11111111 11111111 11111111 11111111 . The compiler then converts this to the corresponding opcode of the CPU. The CPU executes this opcode and at this level everything is in the form of 1s and 0s.