A computer understands only digital data. Computer systems are constructed of digital electronics. That means that their electronic circuits can exist in only one of two states: on or off. Because of their digital nature, a computer's electronics can easily manipulate numbers stored in binary by treating 1 as "on" and 0 as "off." Binary digit or bit is the smallest unit of information on a computer. One bit contains a single binary value — either a 0 or a 1. A byte contains eight bits, which means it can have 256 (28) different values. An integer that can never be negative is called an unsigned integer. It can take only positive values or a zero.
Sign-magnitude is a method of representing negative numbers. Sign-magnitude representation uses the most significant bit of the number to indicate the sign. Ones' complement can be used to represent negative numbers. The ones' complement form of a negative binary number is the complement of its positive counterpart. The most common format used to represent signed integers in modern computers is two's complement. Negative numbers are represented using a 2's complement form. The 2’s complement of a binary value is obtained by (1) converting the value to its 1’s complement, then (2) adding 1 to that complement.