OPEN AI BINARY SYSTEM
The binary system is a numbering system that uses only two digits: 0 and 1. It is the fundamental basis of computers and all digital devices, as it represents the two states of a switch (on and off) in a simple and clear way. Here are some key points about the binary system:
Main Characteristics of the Binary System:
- Base 2: Unlike the decimal system, which uses ten digits (0 to 9), the binary system uses only two digits, 0 and 1.
- Representation of Numbers: Each digit in a binary number is a power of 2. For example, the binary number 1011 can be broken down as follows:
– 1×2³ + 0×2² + 1×2¹ + 1×2⁰
– This is equivalent to 8 + 0 + 2 + 1 = 11 in decimal.
- Bit: Each binary digit is called a bit (binary digit). Eight bits make a byte, which is a unit of measurement commonly used to represent quantities of data.
- Arithmetic Operations:
– Addition: Binary addition follows the same rules as decimal addition, with attention to carries. For example:
– 1 + 1 = 10 (which is 2 in decimal, with a carry)
– Subtraction: Similar to addition, with borrowing when necessary.
– Multiplication and Division: Similar to decimal operations but with the rules of the binary system.
- Conversion between Systems: Conversion between the decimal and binary systems can be done using various methods, such as successive division by 2 (to convert from decimal to binary) or calculating powers of 2 (to convert from binary to decimal).
Conversion Examples:
– From Decimal to Binary:
– Take the number 13 in decimal.
– Divide 13 by 2: the quotient is 6 and the remainder is 1.
– Divide 6 by 2: the quotient is 3 and the remainder is 0.
– Divide 3 by 2: the quotient is 1 and the remainder is 1.
– Divide 1 by 2: the quotient is 0 and the remainder is 1.
– Read the remainders from bottom to top: 1101.
– From Binary to Decimal:
– Take the binary number 1101.
– Calculate: 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8 + 4 + 0 + 1 = 13.
Applications of the Binary System:
The binary system is essential for the functioning of computers and electronic devices. All data, whether text, images, video, or audio, is represented and manipulated internally by computers in binary format. Additionally, the binary system is used in digital circuits and processor architecture, making it fundamental to modern technology.
BINARY SYSTEM
The binary number system is a base-2 positional number system. It uses only two symbols, usually denoted 0 and 1, instead of the ten digits used by the decimal number system. Each of the numbers expressed in the binary number system is called a “binary number”. In computer science, the binary system is used for the internal representation of information by almost all electronic computers, as the physical characteristics of digital circuits make the management of only two values very convenient,
These values conventionally take on the numerical meaning of 0 and 1 or those of true and false of Boolean logic . A binary number is a sequence of binary digits (called bits). Each digit in position n (counted from right to left starting from 0) is considered multiplied by 2 n , rather than by 10 n , as happens in decimal numbering.
INFORMATION IN THE BINARY SYSTEM
The smallest piece of information that can be represented in binary is the binary digit bit. This system uses only two symbols to represent information, 0 and 1. The reasons behind this choice are purely technological . In fact, in the electronic field there are components such as transistors , capacitors, diodes that are well suited to representing these two pieces of information, a transistor can work like a switch in particular situations, and therefore it is possible to assign the logical state 1 when there is current passage, and the logical state 0 when the switch is open and there is no flow of current . Just above I mentioned the concept of information , but what is meant by information? By this term we mean everything that is manipulated by a computer:
-
Numbers
-
Characters
-
Images
-
Sounds
-
Programs
How many combinations can be encoded in the binary system? This depends on the number of bits used in particular we can say that with n bits we can encode 2 n pieces of information, for example if we have 8 bits (1 byte) we can encode 2 8 = 256, from 0 to 255, and so on . A binary number is called positional because the position of the bit in the sequence takes on a different weight based on the position in which it is found, in base 2 because only two symbols are needed, zero and one , not to be confused with zero and one of the decimal system . A binary number is expressed in this form:
(10011101) 2
while for a decimal number like 1235 it will be:
(1235) 10
BINARY SYSTEM – BASIC POSITIONAL SYSTEMS b
In binary like the decimal number system there is a positional representation, by which I mean that in the sequence of digits
c n-1 c n-2 …c 1 c 0
c 0 represents the least significant digit while c n-1 represents the most significant digit. The number b of different digits (by different digits I mean referring to the decimal system that the base is 10 as we have 10 different symbols 0….9) is called the base of the numbering system. Each digit is associated with a value between 0 and b-1. We can represent the number 1245 as:
1 · 10 3 + 2 · 10 2 + 4 · 10 1 +5 · 10 0 = 1245, when we write a number in decimal form we simply omit the base .
Basic | Alphabet | System |
2 | 0,1 | tracks |
8 | 0,1,2,3,4,5,6,7 | octal |
10 | 0,1,2,3,4,5,6,7,8,9 | decimal |
16 | 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F | hexadecimal |
The following compares the binary , hexadecimal, and decimal representations of numbers between 0 and 15:
Tracks | Hexadecimal | Decimal |
---|---|---|
0 | 0 | 0 |
1 | 1 | 1 |
10 | 2 | 2 |
11 | 3 | 3 |
100 | 4 | 4 |
101 | 5 | 5 |
110 | 6 | 6 |
111 | 7 | 7 |
1000 | 8 | 8 |
1001 | 9 | 9 |
1010 | TO | 10 |
1011 | b | 11 |
1100 | c | 12 |
1101 | D | 13 |
1110 | AND | 14 |
1111 | f | 15 |
-
HOW TO GO FROM A BINARY NUMBER TO DECIMAL
To convert a binary number to the decimal number system, simply use the polynomial form. Let’s see an example. Let’s propose to convert the number (110011) 2 into decimal, starting from right to left we have:
1×2 0 +1×2 1 +0x2 2 +0x2 3 +1×2 4 +1×2 5 = (51) 10
-
HOW TO GO FROM A DECIMAL NUMBER TO BINARY
To go from base ten to base two you need to divide the number by 2 and then continue to divide the quotients obtained by 2 until you obtain a zero as a quotient. The remainders of the divisions, written in reverse order , will give us the number written in base two.
287 = (…??…) 2
287:2=143 remainder 1
143:2=71 remainder 1
71:2 = 35 remainder 1
35:2 = 17 remainder 1
17:2= 8 remainder 1
8:2 = 4 remainder 0
4:2 = 2 remainder 0
2:2 = 1 remainder 0
1:2 = 0 remainder 1
(287) 10 = (100011111) 2
OCTAL AND HEXADECIMAL SYSTEM
Base eight and sixteen were introduced for convenience, in fact in the binary system the information is sometimes expressed by long sequences of bits, to compress this binary information a little these two systems which are also positional are used .
Base 8 digits: 0 1 2 3 4 5 6 7
Base 16 digits:0 1 2 3 4 5 6 7 8 9 ABCDEF
234 8 = 4×8 0 + 3×8 1 + 2×8 2 = 156 10
38F 16 = 15×16 0 +8×16 1 +3×16 2 = 911 10
QUICK CONVERSION BETWEEN BASE 2 AND BASE 8
1 |
1 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
|
|
|
|
|
|
|
|
|
110 |
001 |
100 |
||||||
6 |
|
|
1 |
|
|
4 |
|
|
Result 614 8 |
||||||||
|
|
|
|
|
|
|
|
|
The bits are grouped three by three 2 3 = 8 if there were not 3 in the last group just add some zeros. Each triplet of bits is transformed into the corresponding octal number.
QUICK CONVERSION BETWEEN BASE 2 AND BASE 16
The bits are grouped four by four 2 4 = 16 if there were not 4 in the last group just add some zeros. Each quadruple of bits is transformed into the corresponding hexadecimal number.
0 |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
0001 |
1000 |
1111 |
|||||||||
1 |
|
|
|
8 |
|
|
|
f |
|
|
|
Result 18F 16 |
For the moment this is just a small introduction, otherwise if you want to delve deeper into the topic I will leave you two links below.
Leave A Comment