Joke Collection Website - Talk about mood - What does the base system mean in computers?
What does the base system mean in computers?
Binary is a carry system where 2 is the digit, and 0 and 1 are the basic operators. Modern electronic computer technology all uses binary, because it only uses two digital symbols, 0 and 1, which is very simple and convenient, and easy to implement electronically. The information processed internally by the computer is represented by binary numbers. Binary numbers use two numbers, 0 and 1, and their combinations to represent any number. The carry rule is "carry 1 every 2". The number 1 represents different values ??in different bits. In order from right to left, this value increases by two times. In addition to numerical values, data such as English letters, symbols, Chinese characters, sounds, images, etc. are also encoded in the form of binary numbers within the computer. Currently the most commonly used is to use the international standard code ASCII code (American Standard Code for Information Interchange). Chinese characters are also represented in the form of binary number codes inside the computer. Due to the large number of Chinese characters, in 1981, my country's national standard GB2312--80 (Chinese character encoding character set for information exchange - basic set) specified codes for 6763 commonly used Chinese characters. Each Chinese character occupies two bytes, and each byte Represented as an eight-digit binary number. In 1995, the "Chinese Character Coding Extension Specification" (GBK) was promulgated. GBK is compatible with the content standards corresponding to the GB2312--80 national standard. At the vocabulary level, it supports all Chinese, Japanese, and Korean (CJK) Chinese characters of ISO/IEC10646--1 and GB13000--1, with a total of 20902 Character. Turning text, graphics, images, sounds, animations and other information into binary numbers encoded according to certain rules is the digitization of information. [Edit] Four binary arithmetic operations rules: addition 0=0, 1=1+0=1, 1+1=10 subtraction 0-0=0, 1-0=1, 1-1=0, 0-1=-1 10100-1010= 1010 Multiplication 0×0=0, 0×1=1×0=0, 1×1=1 Division 0÷1=0, 1÷1=1 There are only two digits 0 and 1, and the base is two. Conversion of decimal numbers and binary numbers: Decimal number binary number 0 0 1 1 2 10 3 11 4 100 5 101 ………… 1101101= (counting from right to left) 1+0×2+1×2?0?32+ 1×2?0?33+0×2?0?34+1×2?0?35+1×2?0?36 =1+4+8+32+64 =109 1 binary digit is called bit ,bit is the smallest unit to represent data. Binary coding In daily life, we often use various codes, such as provincial certificate numbers, phone numbers, postal codes, etc. These codes are composed of decimal numbers. In the same way, in computers, a code composed of several binary digits, referred to as binary code, is used to represent non-numeric information such as letters, symbols, Chinese characters, colors, etc. In order to represent different types of information, various encoding schemes have been developed. Among them, ASCII code is a commonly used character information encoding scheme. It uses 8-bit binary numbers to represent various letters and symbols. For example: 01000001 represents A, 01000010 represents B, 00111111 represents? ... There are many Chinese characters, so 16-bit binary numbers are currently used to represent commonly used Chinese characters, for example: 10100111 11000000 represents "green" 10010101 10011010 represents "island" 8 binary digits are called a byte Byte, referred to as B. Bytes are the most basic unit of information storage. One byte can store an English letter or symbol code, and two bytes can store a Chinese character code. Like binary numbers, binary coding is also a means used inside computers to represent information. People usually ignore it when dealing with computers. We still input or output information in the way people are accustomed to, and the conversion during the period is automatically completed by the computer.
Example: Decimal number → Binary number 16 → 10000 46 → 101110 99 → 1100011 888 → 1101111000 7654 → 1110111100110 10000 → 10011100010000 Note: Generally, in order to distinguish binary numbers from decimal numbers, a "B" is added after the binary number , such as 145→ 10010001B The numbers we usually talk about are usually in decimal system, 10 cents is 1 cent, 10 cents is 1 yuan... These numbers are just composed of ten digits, that is: 0.1.2.3.4.5.6.7. 8.9 [we generally call it the base number] are all these numbers, but the weight they represent in different positions is different. For example, 111 is both 1 but different. This involves the concept of positional weight. The following examples can be used to illustrate. A decimal number 4 5 5 3 .8 7 can be expressed as: 4553.87=4×10(3)+5×10(2)+5×10(1)+3×10(0)+8×10(-1)×7 ×10(-2) [Statement: (N) represents Nth power] In this number, some of the same numbers are in different positions, and the values ??they represent are also different. The values ??represented by each number are The size is determined by the bit weight. The bit weight is a power value, the base of the power is the base of the carry counting system (in this case, 1 0), and the exponent is determined by the position of each digit in the number. In the above decimal number, the bit weights of each digit from left to right are: 10(3), 10(2).10(1), 10(0), 10(-1), 10(-2). Generally speaking, in the carry system, the numerical value represented when each digit in a number is 1 is called the bit weight. For example, the bit weight of 456 is the numerical value when each bit is 1. The bit weight of 4 in 456 is 10(2), the bit weight of 5 is 10(1), and the bit weight of 6 is 10(0). Except Another important concept of bit weight for base counting is the base. The base is easy to understand. It is the number of different basic symbols used in the carry counting system. It is called the base of the counting system. For example, in decimal system, it is 1.2.3.4.5.6. The ten numbers .7.8.9.0 are relatively speaking, the binary system has two bases: 0 and 1, the octal system is: 0.1.2.3.4.5.6.7.8, and the hexadecimal system is: 0.1.2.3.4.5.6.7.8.9 .A.B.C.D.E.F From the above two concepts, the following formula can be derived: [The name will be described in detail below] The base of N base can be expressed as: 0.1.2...N-2.N-1 N base Weight can generally be expressed as: N(X)[X is the power of b*N(5)+c*N(4)+d*(3)+e*(2)+f*N(1)+g*N(0)+h*N(-1)+i* N(-2)+j*N(-3)+k*N(-4) Decimal: There are 10 bases: 0 ~~ 9, every decimal Binary: There are 2 bases: 0 ~~ 1, every Binary to octal: There are 8 bases: 0 ~~ 7, and octal to hexadecimal: There are 16 bases: 0 ~~ 9, A, B, C, D, E, F (A=10, B=11, C=12, D=13, E=14, F=15), every sixteenth is the first. Since everyone has been learning the decimal system since childhood, it has a wide range of uses in life. It is a single number thinking mode. Many of us think that there is only one base number. Let me tell you about the most commonly used base numbers in computers, so that everyone can broaden their thinking and don't stay in the same thinking mode. The most commonly used base numbers in computers are also The only number system that the CPU can recognize is binary. A computer is a machine that processes information, and the premise of information processing is the representation of information. The representation of information within a computer is a binary digital encoding. In other words, various types of information (numeric values, text, sounds, images) must be converted into digital quantities, that is, binary digital encoding, before they can be processed in computers.
Even if you move the mouse or click the keyboard, each of your actions will finally reach the CPU, and only 0 and 1 will be left. Sometimes I feel that the people who design computers are too powerful, and they can create such perfection with just two numbers. This is the crystallization of wisdom. In fact, at the end of the day, the CPU only has a few hundred instructions. With the layers of software and systems superimposed, we don’t understand what is inside the computer at all. In fact, it is not just 0 and 1 Just two states. Why do computers use binary? There is a reason for this, and it is also an important factor that computer designers consider. The main reasons for using binary in computers are: 1. It is easy to represent binary numbers with only "0" The two basic symbols "1" and "1" are easily represented by two opposing physical states. For example, the "closed" state of a light switch can be used to represent "1", and the "off" state can be used to represent "0"; the conduction of a transistor can represent "1", and the off state can represent "0"; the charging and discharging of a capacitor, and the electrical pulse All devices with two opposite stable states, such as presence and absence, positive and negative pulse polarity, high and low potential, can represent binary "0" and "1". Decimal numbers have 10 basic symbols (0, 1, 2, .., 9), which can be represented by 10 states. It is very difficult to implement them with electronic devices. 2. The arithmetic operations of simple binary numbers are very simple. There are only 3 operation rules for addition and multiplication (0=0, 1=1, 1+1=1 0 and 0×0=0, 0×1=0, 1× 1=1), it is less prone to errors during operation. [In fact, when computers process arithmetic operations, they are all additions and shifts, and there is no multiplication or division. For example, if 11B is shifted one position to the left, it becomes 110B. 11B is 3 in decimal, and 110B is 6. See if it is equal to multiplying by two, left Transfer multiplication, shift right and divide, haha, it’s fun] In addition, the “1” and “0” of binary numbers can correspond to the logical values ????“true” and “false”, which provides convenience for computers to perform logical operations. . Arithmetic operations and logical operations are the basic operations of computers. These two types of operations can be easily and conveniently performed using binary systems. Binary system conversion. Although binary system has many advantages, after all, we use decimal system in our daily life. In order to be universal, it is necessary to convert it to decimal system. As for why octal and hexadecimal are used? It is very difficult. It is simple because it is a power of 2, 2(3)=8, 2(4)=16, which facilitates binary calculation and reading. It is relatively simple to convert other base systems into decimal systems. Here are some examples: Let me explain here that commonly used base systems have abbreviations to avoid confusion. For example, decimal system usually adds a letter D at the end [general custom is not to add it], binary system adds a B, octal system Q, hexadecimal H. For example :123D, 1011B, 123Q, AB9H 123D=1×102×13×1=123 0.11D=1*10(-1)+1*10(-2) 1011B=(1×8+0× 4+1×2+1×1) D=11 0.11B=1*2(-1)+1*(-2) 123Q= (1×64+2×8+3×1) D=83 0.11Q =1*8(-1)+1*8(-2) AB9H=(10×256+11×16+9×1)D=2745 0.11H=1*16(-1)+1*16(- 2) Converting decimal to other base systems is more difficult, but there are methods, and there are many methods. Here we introduce one of the more commonly used ones for everyone to master. Let’s talk about converting decimal to binary first---- - I can only give an example. If the text cannot explain clearly, the integer part and decimal part of a decimal number are usually processed separately. 1. Number system conversion of integers; ——Adopt "radix division", the specific steps are as follows: (1) Divide the given decimal integer by base 2, and the remainder is the lowest bit of the equivalent binary number. (2) Divide the quotient of the previous step by base 2, and the remainder is the second lowest digit of the equivalent binary number. (3) Repeat step 2 until the final quotient is equal to 0.
The remainder of each division is the number of binary digits. The last remainder is the highest digit of three. A simple method for converting binary to octal and hexadecimal. Every three digits from binary to decimal starting from the lowest digit are converted to decimal, which is the corresponding octal. The high-order bits are less than three digits, and zero-padding is the same as binary conversion of every four digits starting from the lowest bit to decimal, which corresponds to the hexadecimal high-order bits being less than four digits, and zero-padding is like (1001100) 2 = (114) 8 = (4C) 16
- Previous article:Significance and effect of lawyer's letter
- Next article:I am snowing heavily in the sunny south, and you are cold as spring in the north.
- Related articles
- Short sentences of gratitude, classic quotations
- B&B comments on guests' beautiful sentences
- Not afraid of villains, but afraid of villains handsome. Tell me who you don't hate because of their looks.
- What is it like to play all day?
- The feminine implication of color.
- What are the sentences about the turtle's positive energy?
- Talk about the humor of a person walking at night.
- The problem that affects too many children: dysarthria, after all, depends on training to change.
- Talking about finished products
- Have a snack and send a beautiful sentence to a circle of friends.