Binary systems are those systems in which numeric data is represented with the help of two numbers/symbols i.e 0 & 1 only. In binary number system, also known as base 2 system or radix 2, the most common forms in which a number is represented are; _{2} or (011) _{2}_{2}The binary number system has a vast scope as it is used in logic gates, the base of every digital electronic system. |

## Digital Computer and Digital System:

A computer that stores data in terms of digits (numbers) and performs calculations and logical operations with quantities represented as digits, usually in the binary number is called a *digital computer*.Computers are used in scientific calculations, business applications,educational field etc and follow a sequence of instructions called a *program*. Digital computer manipulates discrete elements of information and these elements are represented in binary form.

## Binary Number System:

Unlike the decimal system, only two digits - 0, 1 are used to represent a number in the Binary Number System.Some of the decimal numbers and their binary representation is shown below where each decimal number is represented in 4 bits: 1: 0001 2: 0010 3: 0011 4: 0100 5: 0101 6: 0110 7: 0111 8: 1000 9: 1001 10: 1010

## Number Systems Conversion:

### Conversion from other Number Systems to Binary:

Any number belonging to other number system having base 8,10 or 16 etc can be converted to its binary equivalent. To convert from *base-10 to its binary equivalent*, the number is divided by two, and the remainder is taken as the least-significant bit. The integer result is again divided by two, its remainder is the next most significant bit.This process repeats until the result of further division becomes zero.e.g

To convert from ** hexadecimal(base-16) to its binary equivalent, **each hexadecimal number is represented in group of four binary digits(combination of 1\'s and 0\'s).Hexadecimal digit, their equivalent decimal value and four-digit binary sequence are shown below:

**Hex Dec Binary** 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 8 1000 9 9 1001 A 10 1010 B 11 1011 C 12 1100 D 13 1101 E 14 1110 F 15 1111 ** Conversion examples;** (9B)

_{16}= (1001 1011)

_{2}(489)

_{16}= (0100 1000 1001)

_{2}Conversion from

**is similar to conversion from hexa to binary.To convert from octal(base-8) to its binary equivalent,each octal number is represented in group of three binary digits(combination of 1\'s and 0\'s). (65)**

*octal to binary*_{8}= (110 101)

_{2}17

_{8}= (001 111)

_{2}(17)

_{8}= 001 111

_{2}

### Conversion to Decimal Number System:

Conversion from other number system to decimal is very easy.it can be understood from the following examples.

### Conversion to Octal Number System:

Binary 000 is equivalent to the octal digit 0, binary 111 is equivalent to octal 7, and so forth. **Octal Binary ** 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 Conversion from other number system to octal is very easy.it can be understood from the following examples.

(101100)_{ 2} = (101 100)_{ 2} grouped = (54) _{8} (10011) _{2} = (010 011)_{2} grouped with padding = (23) _{8} **Numbers with Different Bases:** ** **

**Arithmetic operations in Binary:** Arithmetic operations of Addition, subtraction, multiplication, and division can be performed on binary numerals.

*Binary Addition:*The simplest arithmetic operation in binary is addition 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0, carry 1 (since 1 + 1 = 0 + 1 × 10 in binary)

Adding two "1" digits produces a digit "0", while 1 will have to be added to the next column.Following example elaborates the concept.

1 1 1 1 1 (carried digits)

0 1 1 0 1

+ 1 0 1 1 1

-------------

= 1 0 0 1 0 0

In this example, two numerals are being added together: (01101)_{2} ((13)_{ 10}) and (10111)_{ 2} ((23) _{10}). The top row shows the carry bits used. Starting in the rightmost column, 1 + 1 =( 10) _{2}.The 1 is carried to the left, and the 0 is written at the bottom of the rightmost column. The second column from the right is added: 1 + 0 + 1 = (10) _{2} again; the 1 is carried, and 0 is written at the bottom. The third column: 1 + 1 + 1 = 11 _{2}. This time, a 1 is carried, and a 1 is written in the bottom row. Proceeding like this gives the final answer 100100 _{2} (36 decimal). Some other examples are as follows.

**Binary Subtraction:**Subtraction rules are ; 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",because in actual a number \'2\' is borrowed from which \'1\' is subtracted resulting in a1. This is known as borrowing. This becomes more clear from the following examples:

*Binary Multiplication*:Multiplication in binary is similar to multiplication in decimal but here the result can be either a 0 or a 1.Rules of Multiplication are : 0 x 0 = 0 0 x 1 = 0 1 x 0 = 0 1 x 1 = 1 Binary numbers can also be multiplied with bits after a binary point:

1 0 1.1 0 1 (A) (5.625 in decimal)

× 1 1 0.0 1 (B) (6.25 in decimal)

-------------

1 0 1 1 0 1 ← Corresponds to a one in B

+ 0 0 0 0 0 0 ← Corresponds to a zero in B

+ 0 0 0 0 0 0

+ 1 0 1 1 0 1

+ 1 0 1 1 0 1

-----------------------

= 1 0 0 0 1 1.0 0 1 0 1 (35.15625 in decimal)

**Arithematic Operations in Other Number Systems:** The arithematic operations in other number system are slightly different from those in decimal or binary.Example below illustrates this:** **

By observing the examples given above, one can understand that when a result of adding or multiplying two numbers becomes greater than 15 or F,then two steps are taken:

- the answer greater than 15 is divided by 16
- the quotient is taken as a carry to the next bit and the remainder is taken as the least significant bit (answer) for that particular bit position.

For subtraction,16 is borrowed in actual when borrowing is used. Same Procedure is applied for octal operations but here the limit is 7 instead of 15 and division is done by 8 instead of 16.For subtraction 8 is borrowed from the next bit position if a larger number is subtracted from a smaller number (borrowing). ** **

**Decimal Codes: **Decimal Codes are different techniques of encoding in computers.One of them is called BCD which stands for Binary Coded Decimal.BCD represents a digit(0-9) in 4 bits .

← ASCII Code - Definition, Parity Bit, Printing & Non Printing Characters |
---|