Natural Binary Code


The exchange of all information within the computer is performed by NBC. Every computer is created from electronic components, where the transfer of information consists of sending signals. The basis of electronics is an electric current, which either flows or not. The computer recognizes the signals and interprets them in terms of numbers. A current flowing is set to “1” and the absence of current is set to “0”. Operating with the appropriate settings, when the current flows and when not, different values of “0” and “1” are set. The minimal set of characters needed to represent any number is a set consisting of only two digits: “0” and “1”. Thus the processor converts the adjusted settings into numbers and produces clearly legible text, images, sounds etc. It is the NBC system by which the digital machines including computers were created.
A base-2 system is a positional notation system with a radix of 2. The numbers are encoded using only 2 digits: “0” and “1”. As it is a positional notation system the same symbols are used for different orders of magnitude to represent numbers. A representation of a decimal number in NBC system follows:

Example:
11110101 = 2^7 + 2^6 + 2^5 + 2^4 + 2^2 +2^0 = 128 + 64+32+16+4+1= 245


Binary Arithmetic


Addition

Adding two single-digit binary numbers is simple, using a form of carrying:
0 + 0 → 0
0 + 1 → 1
1 + 0 → 1
1 + 1 → 10, carry 1
Adding two "1" digits produces a digit "0", while 1 will have to be added to the next column. This is known as carrying. When the result of an addition exceeds the value of a digit, the procedure is to "carry" the excess amount divided by two to the left, adding it to the next positional value.

Subtraction

Subtraction works in the very similar way:
0 − 0 → 0
0 − 1 → 1, borrow 1
1 − 0 → 1
1 − 1 → 0
Subtracting a "1" digit from a "0" digit produces the digit "1", while 1 will have to be subtracted from the next column. This is known as borrowing. The principle is the same as for carrying. When the result of a subtraction is less than 0, the least possible value of a digit, the procedure is to "borrow" the deficit divided by two from the left, subtracting it from the next positional value.

Multiplication

Multiplication in binary is similar to its decimal counterpart. Two numbers A and B can be multiplied by partial products: for each digit in B, the product of that digit in A is calculated and written on a new line, shifted leftward so that its rightmost digit lines up with the digit in B that was used. The sum of all these partial products gives the final result.
Since there are only two digits in binary, there are only two possible outcomes of each partial multiplication:
0 * 0 → 0
0 * 1 → 0
1 * 1 → 1

Division

Binary division is the repeated process of subtraction, just as in decimal division.
To perform binary division follow the following steps:
Align leftmost digits in dividend and divisor and if that portion of the dividend above the divisor is greater than or equal to the divisor, then subtract divisor from that portion of the dividend and concatentate 1 to the right hand end of the quotient. If the portion of the dividend is smaller than the divisor concatentate 0 to the right hand end of the quotient. Later shift the divisor one place right. Repeat this procedure until the dividend is less than the divisor. Quotient is the result of the division whereas the dividend left is the remainder