Binary is a base-2 number system that uses two values, 0 and 1, to represent a number. We can also call it true(1) and false state(0). A binary number is made the same way as we form a normal decimal number.
Binary arithmetic is a very important part of various digital systems. Using various methods, we can perform addition, subtraction, multiplication, and division in binary numbers. These operations are much easier than decimal number arithmetic operations because the binary system has only two digits: 0 and 1.
Binary Arithmetic:
Binary arithmetic is essential to all digital computers and many other digital systems. Binary arithmetic includes the basic arithmetic operations of addition, subtraction, multiplication and division. The following sections highlight the rules that apply to these operations when they are performed on binary numbers.
Binary Addition:
It is a key for binary subtraction, multiplication, and division. Binary addition is performed in the same way as an addition in the decimal system and is easier than decimal addition as there are only 2 bits, 0 and 1. Carry and addition are the two steps involved in binary addition. Binary addition follows the following four basic rules:
Case
A+B
Sum
Carry
1
0+0
0
0
2
0+1
1
0
3
1+0
1
0
4
1+1
0
1
In the fourth case, a binary addition creates a sum of (1 + 1 = 10), i.e. 0 is written in the given column and a carry of to the next column.
When adding more than a single-digit binary number, carry into higher-order columns as is done when adding decimal numbers. For example 11 and 10 = 101. In the first column, 1+0=1. In the second column, 1+1 =0 with a carry of 1 into the third column; hence it is 101. When we add 1 + 1.+ 1 (carry) produces 11, recorded as 1 with a carry to the next column.
Rules of addition:
The addition always starts with the rightmost side (LSB bit) and goes to the left side.
The output is also low when a low bit is added to a low bit. There is no increment in the overall value of the number. Ex: 0+0=0
When a high bit is added with a low, or a low bit is added with a high, output is always high. The overall value is incremented with one.
When a high bit is added with high, output is high, with a carry. The value is incremented by one.
Binary Subtraction:
Binary subtraction is very easy as the addition subtraction of one bit from another. Subtraction and borrowing are the two steps involved in binary subtraction. It follows the following four basic rules:
Case
A-B
Subtract
Borrow
1
0-0
0
0
2
1-0
1
0
3
1-1
0
0
4
0-1
0
1
In rule 4, transfer (borrow) of 1 is performed as 0 has a lower value than one, so we cannot subtract from it, so we borrow one from the next column. However, borrowing from the next higher-order column is sometimes essential when subtracting. For example, it will be necessary to borrow binary numbers if we are trying to subtract one from a 0. In such a case, one is borrowed from the next higher-order column, which leaves 0 in that column and creates a ten, i.e., two being subtracted.
Binary Multiplication:
Binary multiplication is similar to decimal multiplication. However, as there are only 2 bits, 0 and 1, It is much simpler than decimal multiplication because there are only two possible results of multiplying two bits. There are four rules of binary multiplication.
Case
A*B
Multiplication
1
0*0
0
2
0*1
0
3
1*0
0
4
1*1
1
Binary Division:
The binary division method is the same as decimal division. Therefore, it is called the long division procedure. Example:
Binary Coded Decimal:
Binary Coded Decimal: In this code, instead of converting the entire decimal value into a pure binary form, each digit of a decimal number system is converted into its binary equivalent. A group of 4-bit numbers represents BCD. 4 bits can represent only digits because 4 bits are insufficient to specify various characters used by the computer as their ASCII value is high. In 6-bit BCD code, two more zone bits are added & we can represent 26, i.e., 64 different characters. 6-bit BCD code is sufficient to code the decimal digits (10), alphabetic characters (26) & other special symbols (28).
Binary Equivalent Decimal Digit
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
Extended Binary Coded Decimal Interchange Code:
Extended Binary Coded Decimal Interchange Code(EBCDIC)- It is an extended form of BCD where it can represent 256 characters, i.e. 2^8 characters. It also supports a large variety of printable characters & non-printable control characters. EBCDIC can be divided into two groups of 4-bit each which can be represented by one hex digit. In computers that use EBCDIC for the internal representation of characters, the Hexadecimal Number system is used as a shortcut notation for memory dump.
Two types of formats :
1. Zoned Decimal Format
2. Packed Decimal Format.
A sign indicator is used in the zone position of the rightmost digit to represent whether the number is positive, negative or unsigned when a numeric value is represented in EBCDIC. For printing the Data, Zoned Decimal Format is used as printers print only those numeric characters in a Zoned Decimal Format. A lot of computers cannot perform arithmetic operations on Zoned Decimal Data. To perform arithmetic calculations, it had to be converted to Packed Decimal Format.