-
Binary is a system of numbers that is widely used in computing technology. Binary data is a number represented by two numbers, 0 and 1. Its base is 2, the carry rule is "every two into one", and the borrowing rule is "borrow one as two".
Binaries are the base operators of binaries every 2 digits [2]; The basis of computer computing is binary. The basis of the computer is binary. The decimal system commonly used in early design was mainly decimal (since we have ten fingers, decimal is a more reasonable choice, fingers can represent ten numbers, and the concept of 0 did not appear until much later, so it is 1 10 instead of 0 9).
After the advent of electronic computers, it was too complicated to use electron tubes to represent the ten states, so there were only two basic states in all electronic computers, on and off. That is, the two states of the tube determine that the tube-based electronic computer adopts binary to represent numbers and data. The commonly used base systems are also 8 base and hexadecimal, in computer science, 16 is often used, and decimal is rarely used, because 16 and binary are naturally related:
4 binary bits can represent numbers from 0 to 15, which is exactly the data that 1 hexadecimal bit can represent, that is, converting binary to hexadecimal only needs to be converted every 4 bits.
Binary "00101000" can be converted directly to "28" in hexadecimal. Bytes are the basic storage units in the computer, according to the different length of the computer, the word has different digits, the word length of modern computers is generally 32 bits, that is, the number of bits of a word is 32. A byte is an 8-bit unit of data, and a byte can represent 0 255 decimal data.
For modern computers with a 32-bit word length, a word is equal to 4 bytes, and for early 16-bit computers, a word is equal to 2 bytes.
-
Logical operations on binary numbers include logical addition (OR), logical multiplication (AND operations), logical negation (NOT operations), and logical XOR operations.
1) Logical "or" operations.
Also known as logical addition, it can be represented by the symbol " " " or " ". The rules for logical OR operations are as follows:
0 0 0 or 0 0 0
0 1 1 or 0 1 1
1 0 1 or 1 0 1
1 1 1 or 1 1 1
It can be seen that as long as one of the two logical variables of phase "or" is 1, the result of the "or" operation is 1. Only when both variables are 0 or the result of the operation is 0. When calculating, special attention should be paid to distinguishing it from the addition of arithmetic operations.
2) Logical "and" operation.
Also known as a logical multiplication, it is often represented by the symbol " " or " · or " ". The AND operation follows the following rules:
0 1 0 or 0·1 0 or 0 1 0
1 0 0 or 1·0 0 or 1 0 0
1 1 1 or 1 1 1 or 1 1 1
It can be seen that as long as one of the two logical variables of "and" is 0, the result of the "and" operation is 0. The result of the AND operation is 1 only if both variables are 1.
3) Logical "non" operations.
Also known as logical negation, it is actually the inversion of the state of the original logical variable, and its operation rules are as follows:
As you can see, adding a dash above the variable indicates "not". When the logical variable is 0, the result of the "not" operation is 1. When the logical variable is 1, the result of the NNOT operation is 0.
4) Logical "XOR" operations.
XOR "operation, commonly used symbol" or "" to dedicate, its operation rules are:
0 0 0 or 0 0 0
0 1 1 or 0 1 1
1 0 1 or 1 0 1
11 0 or 11 0
It can be seen that when two XOR logical operation variables have the same value, the result of XOR is 0. If the values are different, the result of XOR is 1
-
We commonly use the decimal system, that is, every decimal one, there are only 10 numbers, 0 - 9. When the digit reaches 9, it needs to be advanced by one digit, and the high position is made up by one, and the original position becomes 0
Binary is a computer coded base, that is, every two into one, there are only 2 numbers, 0 - 1. When the number of digits reaches 1, it needs to be advanced by one place, and the high position is made up by one, and the original position becomes 0
Decimal (d): 3120 = 3x10 + 1x10 + 2x10 (1st power) + 0x10 (0th power) = 3000 + 100 + 20 + 0 (d).
Binary (b): 1011 = 1x2 +0x2 +1x2 + 1x2 (to the power of 0) = 8 + 0 +1 +1 = 10 (d).
Above is the number size (d) of binary to decimal that represents the decimal symbol.
-
The 1s and 0s in the logical truth table represent the two logical states of true and false. For any logical operation, the result can only be 1 or 0, and no other values can exist.
An example can be given to illustrate the case where the result of any operation is the same as the quiver 1,0 and 0,1. Suppose there are two logical variables, a and b, whose values are 0 and 1, respectively. Then according to the truth table of the OR (or) operation in the logical operation, the result of a or b is 1.
At this point, regardless of whether a or b is in the truth table is 1,0 or 0,1, the result is the same, both are 1.
Therefore, any operation result of 1,0 and 0,1 in the logical truth table is the same. This conclusion is based on the definition of logical operations and the results of truth tables, which is one of the basic principles of logical brightness.
-
Logical addition is usually represented by the symbol "+" or "". The rules of logical addition are as follows:
As can be seen from the above equation, logical addition has the meaning of "or". That is to say, in a given logical variable, as long as one of a or b is 1, the result of the Bi family report added by the spike logic is 1; The result of the logical addition is 0 only when both are 0.
Logical multiplication ("and" operation).
Logical multiplication is usually done with the symbol " " or " or " · to represent. The rules of logical multiplication are as follows:
It is not difficult to see that logical multiplication has the meaning of "and". It means that the logical product is equal to 1 only if all the logical variables involved in the operation are aware and have a value of 1.
-
If you ask so, you can only say that you don't have a deep understanding of this table with Senyin!
Let's say the first line of truth tables. They are the results of the argumentation of each logic gate under the conditions of a=0 and b=0. Can you say they're all the same?
The second row is under a=0 and b=1 conditions.
The third row is under the condition of a=1 and b=0.
The fourth row is under the conditions of a=1 and b=1.
So, you need to see the results of each line clearly to really understand what they do.
-
Operations between logical variables are called logical operations.
The binary numbers 1 and 0 can logically represent "true" and "false", "yes" and "no", "have" and "nothing". Such variables with logical properties are called logical variables.
The main difference between the arithmetic operations of the computer's logical operations is that the logical operations are carried out on a bit-by-bit basis, and the bits are not related to carry or debit bits like addition and subtraction operations.
There are three basic types of logical operations: logical addition (also known as "or" operations), logical multiplication (also known as "and" operations), and logical negation (also known as "non" operations). In addition, "XOR.
Arithmetic is also useful.
1. Logical addition ("or" operation).
Logical addition is usually represented by the symbol "+" or "". The rules of logical addition are as follows:
As can be seen from the above equation, logical addition has the meaning of "or". That is, in a given logical variable, as long as one of a or b is 1, the result of its logical addition is 1; If both are 1, the logic is added to 1.
2. Logical multiplication ("and" operation).
Logical multiplication is usually done with the symbol " " or " or " · to represent. The rules of logical multiplication are as follows:
It is not difficult to see that logical multiplication has the meaning of "and". It means that the logical product is equal to 1 only if all the logical variables involved in the operation have a value of 1 at the same time.
3. Logical negation (non-operational).
Logical non-operation is also known as logical negative operation. The rules of operation are as follows:
0=1 Non-0 equals 1
1=0 Non-1 equals 0
4. XOR logic operation (semi-addition operation).
XOR operations are usually symbolized"?"means that its algorithm rules are:
0?0=0 0 is the same as 0 or 0, and the result is 0
0?1=1 0 is the same as 1 XOR, and the result is 1
1?0=1 1 is the same as 0 or the result is 1
1?1=0 1 is different from 1 or, the result is 0
That is, if the two logical variables are different, the output is 1
-
XOR is denoted by the symbol .
So it's (1*(0+1 0)) 1+(0*1 1)) Let's talk about XOR first.
If the two units are not the same, it is 1, and if it is the same, it is 0, so 1 1 and 0 0 are both equal to 0, and 1 0 and 0 1 are 1.
-
In binary, when performing logical operations, 1 means true and 0 means false copy
In the operation, true and true = true, true and false = false, true or false = false, false or false = false, ......For these relationships, you can query the knowledge of logical relations, laws of operation, propositional relations, and so on.
In the sub-representation, 1+1=1, it is said that zd is true and true, and this proposition is true.
-
That is, the numbers on the corresponding bits of the two binary numbers are in harmony with each other, and the first thing to know is that the definition of and is the same as one.
-
Bitwise and result is binary 10 decimal 2, logic and result is binary 01 decimal 1 I don't know if I understand it.
The above statement is wrong.
How to calculate the binary of 1100 111. >>>More
Complement10000000, how big does it mean? >>>More
Convert decimal integers to binary numbers.
The divide by 2 reverse remainder method is adopted: >>>More
In the standard output of the C++ language, there are hexadecimal, decimal, and octal output formats, but there is no binary output format. So if you want to output binary, you can only write your own functions for output. >>>More
Binary numbers. Writing is long, error-prone, and hard to remember, while the decimal system. >>>More