Number System (Binary Calculation)
A number system is a system for expressing numbers that is mathematical notation used for manipulating other countable things. The numbers are represented in different based system in different situation. The decimal number system is used for human counting but not role in machines. Binary numbers are used in modern digital devices. Octal and Hexadecimal number system are just packages of 4 binary bits. In computer science we have to study four number systems. They are
- Binary Number System (0, 1) / Base or radix = 2
- Octal Number System (0 to 7) Base or radix = 8
- Decimal Number System (0 to 9) Base or radix = 10
- Hexadecimal Number System (0 to 9 and A to F) Base or radix = 16
The following table shows the number system equivalent to one another.
Binary
|
Octal
|
Decimal
|
Hexadecimal
|
0000
|
0
|
0
|
0
|
0001
|
1
|
1
|
1
|
0010
|
2
|
2
|
2
|
0011
|
3
|
3
|
3
|
0100
|
4
|
4
|
4
|
0101
|
5
|
5
|
5
|
0110
|
6
|
6
|
6
|
0111
|
7
|
7
|
7
|
1000
|
10
|
8
|
8
|
1001
|
11
|
9
|
9
|
1010
|
12
|
10
|
A
|
1011
|
13
|
11
|
B
|
1100
|
14
|
12
|
C
|
1101
|
15
|
13
|
D
|
1110
|
16
|
14
|
E
|
1111
|
17
|
15
|
F
|
- Binary Number System : Any number having base or radix 2 and the number consists 0 and 1 only are called binary number system. E.g: 11102, 10012, 1110012
- Decimal Number System: Any number having base or radix 8 and the number consists 0, 1, 2, 3, 4, 5, 6 and 7 are called octal number system. E.g: 5638, 12358, 57368
- Decimal Number System: Any number having base or radix 10 and the numbers consists 0, 1, 2, ........ 9 are called decimal number system. E.g : 19610,
25810, 123610
- Hexadecimal Number System : Any number having base or radix 16 and the number consists 0, 1, 2, 3, ...... 9 and character consist A, B, C, D, E and F are called hexadecimal number system. Where A=10, B=11, C=13, D=14, E=15 and F=15. E.g : 25A16, 156B16, 9D16
Binary Calculation
The modern digital computer system performs every calculations in the form of binary format. They present 0 or 1, on or off, presence and absent. It represents the status.
Binary Addition:
Binary addition is performed in a similar way to decimal addition.
Binary Addition
|
||
X
|
Y
|
X+Y
|
0
|
0
|
0
|
0
|
1
|
0
|
1
|
0
|
0
|
1
|
1
|
10 (with a carry of 1)
|
Example: a) Add 110102 + 10012 b) 111102 + 111012
Binary Subtraction:
Binary subtraction, similar method is adopted as in decimal system.
Binary Subtraction
|
||
X
|
Y
|
X-Y
|
0
|
0
|
0
|
0
|
1
|
1 (with a borrow of 1)
|
1
|
0
|
1
|
1
|
1
|
0
|
Example : a) 10010 - 1011 b) 1101101 - 111101
Binary Multiplication
Binary multiplication is easier since there is no number as "carry" value. The following rule is adopted in binary multiplication. The values are added column wise as in binary addition.
Binary Multiplication
|
||
X
|
Y
|
X*Y
|
0
|
0
|
0
|
0
|
1
|
0
|
1
|
0
|
0
|
1
|
1
|
1
|
Example: a) 11101 x 111 b) 100011 x 110
Binary Division
Binary Division is similar to decimal division. If a number cannot be divided, put 0 to the quotient. If division is possible put 1 to the quotient. Multiplication and subtraction is as discussed in binary multiplication and binary subtraction.
Example: a) Divide 1011 by 11 b) 111 by 11
For Practice :
- Binary Addition
- 1011 + 11
- 11111 + 10101
- 11100 + 10111
- Binary Subtraction
- 1011 - 1000
- 101010 - 11001
- 11011 - 1010
- Binary Multiplication
- 1110 x 110
- 1101 x 111
- 11101 x 1011
- Binary Division
- 10011 by 110
- 11100 by 1110
- 1110 by 110