Loading

- Human beings count from 0 to 9 before adding another digit in presenting the number. In contrast, computers operate on bits (binary digits) and bytes. The number system human beings use is recognized as the decimal system; and the number system the computer operates is recognized as the binary system.
- To simplify the representation of a binary number, the hex decimal system has been introduced. Under this system, each digit has 16 possible values (0 to 15) and can be used to represent four bits.
- To find the corresponding decimal value for any binary or hex decimal representation, multiply the bits/hex digits by their corresponding positional value and sum the total.
- To find the binary/hex representation for a decimal number, divide the number by two/sixteen and find the remainder, which is the bit/hex value for the lowest position. Then divide the integer quotient by two/sixteen again to obtain the bit/hex value for the next higher position. Repeat this process to find the bit/hex value for each successive higher position until the resulting quotient is zero.
- Most of the logical operators such as Not, And, Or, and Xor are bit-wise operators. They set the results of the operation on a bit-by-bit basis.
- The Not operator can be used to reverse the content or state of flags; the And operator can be used to test whether a particular bit is on or off as well as to test whether a number is odd or even; the Or operator can be used to turn on a bit; and the Xor operator can be used to toggle bits as well as to encrypt or decrypt data.