Binary is a numbering system used to express numbers in 2 states. These two states are 0 and 1. The binary numbering system is very important for computer and IT systems because of the different types of hardware using a binary system like CPU, RAM, GPU, HDD, NIC, etc.
Binary Values
Binary numbering system provides two values named 0
and 1
. There is no number like 3
, 5
or similar in binary. Computers mainly use these binary values in order to process, read, write data.
Boolean Logic
Binary numbers are highly related with the boolean logic. Boolean Logic is a logic which is mainly used in computers and mathematics. 0
binary values are used to express the false logic where 1
is used to express the true logic. We can also use different logic operators like AND
, OR
, EXOR
etc. Here are some Boolean Logic calculations with binary values.
1 AND 1 = 1
1 OR 0 = 1
1 AND 0 = 0
1 XOR 0 =1
1 XOR 1 = 0
Binary and Decimal Numbers
Binary numbers can cen be converted into decimal numbers and vise versa. For example 11
binary value is equal to 3
in decimal numbering system.
Decimal Value | Binary Value | Base-2 Representation |
---|---|---|
0 | 0 | n/a |
1 | 1 | 20 |
2 | 10 | 21 |
3 | 11 | 21 + 20 |
4 | 100 | 22 |
5 | 101 | 22+ 20 |
6 | 110 | 22 + 21 |
7 | 111 | 22 + 21 + 20 |
8 | 1000 | 23 |
9 | 1001 | 23 + 20 |
10 | 1010 | 23 + 21 |
64 | 1000000 | 26 |
256 | 100000000 | 28 |
1024 | 10000000000 | 210 |