How to represent, calculate, and convert the base system in computer programming?

Updated on technology 2024-04-24
8 answers
  1. Anonymous users2024-02-08

    In everyday life, people all adopt the decimal system.

    technology, which is characterized by "every ten". The technical method used in computers is binary, which is characterized by "every two into one". Binary numbers.

    There are only two counting symbols, 0 and 1. Therefore, as a machine-expressed value, only two electrical signal states are required: on, off, or high and low. Therefore, the computer adopts the binary representation of dispatch, which is easy to transmit and process data, and it is not easy to produce errors, and the work reliability is high.

    In addition, the binary algorithm is relatively simple, allowing the computer to look at the combinator.

    The structure is greatly simplified, and the control is simpler.

    For example, the binary number 11010 is converted to a decimal number

    Convert decimal to binary.

    Adoption"Divide by 2 and take the remainder and arrange them in reverse order"Law. Here's how: divide a decimal integer by 2 to get a quotient and remainder.

    Removing the quotient with 2 will give a quotient and remainder again, and so on until the quotient is less than 1, and then the remainder obtained first will be used as the lower significant digit of the binary number, and the remainder obtained later will be used as the high significant digit of the binary number, and then arranged in turn. Such as 125 in decimal

    Write down the remainder from bottom to top: 1111101.

    Inside the computer, all information is stored, processed, and transmitted in the form of binary signals. For example, English letters, Chinese characters, colors, images and sounds must be converted into binary codes through different digital codes before they can be accepted by computers.

    Binary signal forms are referred to as digitized signals or digital signals in information processing.

  2. Anonymous users2024-02-07

    19 questions choose D, converted to decimal system can be compared, as shown in the figure below. A in hexadecimal is equal to 10 (decimal), b is 11 (decimal), and so on.

    20 question selection b, octal number medium so that only these eight with rental travel, will not appear .

  3. Anonymous users2024-02-06

    Conclusion: 19 questions choose D; 20 questions choose B

    Analysis: 1. Analysis of 19 questions.

    This type of base conversion can be judged by the conversion in the same base of the options. Converting to decimal is relatively simple.

    The conversion of R to Decimal uses the method of bitwise weighting, that is, the weights in each number position are written and then added. The specific conversions are as follows.

    Item A: Binary 1101100

    Item B: Decimal 65, decimal does not need to be converted.

    Term C: Octal 70

    D: Hexadecimal A7A7

    The final fruit is the largest compared to the trouser branch D item A7.

    2. Analysis of 20 questions.

    This type of question is judged numerically. The number is the data contained in this base system, so that the pure is known. Binary digits ; octal digits 0 to 7; decimal 0 to 9; Hexadecimal 0 to 9, a to f. Each decimal is counted from 0.

    Octal digits 0-7, according to this judgment, ACD has several terms more than 7, and B is correct.

  4. Anonymous users2024-02-05

    If the base is larger than the size, you can convert it to the same base, and then the second of the Ming Zhao is the octal system, and you can see which digit can be converted to the base 8.

  5. Anonymous users2024-02-04

    Conversion of advance numbers: 1, binary numbers, hexadecimal numbers to decimal numbers (sum by weight).

    The law of converting binary numbers and hexadecimal numbers to decimal numbers is the same. The binary number (or hexadecimal number) is in the form of a polynomial sum in the form of a bitwise weight, and its final sum is its corresponding decimal number - referred to as "sum by weight".

    For example: put ( binary calculations.

    Solution: (2, the decimal number is converted to a binary number, and the hexadecimal number is answered by the Sun system number (divided by 2 16 to take the remainder).

    Integer conversion. The conversion of a decimal chain integer to a binary integer usually adopts the remainder method of dividing by two, that is, dividing the decimal number by 2 continuously until the quotient is 0, and arranging the remainder in reverse order can be obtained - referred to as dividing by two remainder

    Example: Convert 25 to a binary number.

    Solution: 25 2=12 remainder 1

    12 2=6 remainder 0

    6 2=3 remainder 0

    3 2=1 remainder 1

    1 2=0 remainder 1

    So 25=(11001)2

    In the same way, when converting a decimal number to a hexadecimal number, it is sufficient to convert base 2 to 16.

    Example: Convert 25 to a hexadecimal number.

    Solution: 25 16=1 remainder 9

    1 16=0 remainder 1

    So 25 = (19)16

    3. Conversion between binary and hexadecimal numbers.

    Since a 4-digit binary number has exactly 16 combinatorial states, i.e., a 1-digit hexadecimal number corresponds to a 4-digit binary number. Therefore, the conversion of hexadecimal numbers to binary numbers is very simple.

    To convert a hexadecimal number to a binary number, simply replace each hexadecimal number with the corresponding 4-digit binary number - referred to as 4 digits.

    Example: Convert (4af8b)16 to a binary number.

    Solution: 4 a f 8 b

    So (4af8b)16=(1001010111110001011)2

    So (111010110)2=(1d6)16

    When converting, note that when the last group is less than 4 digits, 0 must be added to make up 4 digits.

  6. Anonymous users2024-02-03

    Today's content. The origin of the base system.

    Common decimal systems in life.

    Binary in a computer.

    Description of the four commonly used bases in a computer.

    Octadecimal and hexadecimal.

    The origin of the base system.

    Base system: Carry counting system.

    Raw count.

    Knotted rope counting. Deed count.

    Abacus. Orthography notation.

    The base system commonly used in daily life.

    Decimal (every decimal of one).

    Septimal (week 1 to Sunday).

    Decimal (12 months in a year).

    Decimal (a century of a hundred years).

    Decimal (1k).

    Binary in a computer.

    A word is 8 digits long.

    1b=8bit

    1kb= 1024b

    1mb = 1024kb

    1gb = 1024mb

    1tb = 1024gb

    Binary: Leibniz.

    The state of the circuit switch used in the computer corresponds to the binary, open represents 1, and off represents 0 Put ten circuit switches together as a group, and all states have 1024 states.

    Quartalment instructions.

    Decimal 0-9

    The binary 1 0 complement is saved in the form of [storage].

    Octal 0-7

    Hexadecimal Variance 0-9 ABCDEF (10-15) Octadecimal and Hexadecimal.

    For the sake of simplicity in binary writing, octal is used to represent it, and every three digits of the original binary are put together to form an octal.

    Put every four bits of the original binary together to form a hexadecimal.

    Binary is still stored when the computer actually stores it.

    Conversion between decimal systems.

    Convert other decimal to decimal system.

    The right to be respectful of the law.

    Convert binary to decimal 0011 0111 (1+2+4+0+16+32=55).

    Convert octal to decimal 0234 1 8 64 4+24+128=156

    Convert hexadecimal to decimal 78ab

    Convert the decimal system to its auspicious companion system.

    Short division.

  7. Anonymous users2024-02-02

    The base system is a carry rule that is set for the convenience of counting.

    When we learn mathematics at the poor base, the teacher will first teach us 0 9 nine numbers, these nine numbers can only represent 10 numbers, but in actual use, 10, 110, and 1111 will be used to represent more quantities, Qiao Qinghui.

    At this time, the teacher told us to 'meet one in ten'

    This is the concept of bits and decimal systems, for example, 10 has two digits, unit digits, 0 digits, 1 digits, this is the concept of bits, and when we 'meet a few digits (digits)', this is the concept of the base system, and the base system is a kind of carry rule that we use to advance one digit to a few digits. For example, filial piety binary meets two into one, decimal system, meets ten into one.

  8. Anonymous users2024-02-01

    The carry counting system is artificially defined with carryingCounting method

    For any kind of base system, the base of x, means that the number in each position is calculated by one digit of x. The decimal system is every decimal one, the hexadecimal system is every sixteen into one, the binary system is every two into one, and so on, the decimal system is the silver notice and the x-round.

    In life, decimal counting is generally used, every decimal one, a digit bit, the maximum is 9

    In the base n, that is, every n into one, the largest number in a digit is n-1

    Binary in computers is a very tiny switch, "on" for 1 and "off" for 0, and a bit can only represent two digits.

    In a computer, a data volume is called 1bit, and 8 data bits are generally used to represent a friendly answer number, which is called a byte.

    8bit = 1byte; 1b = 8b ;

    1024byte = 1kb;

    1024kb = 1mb;

    1024mb = 1gb;

    1024gb = 1tb;

    1024tb = 1 pb;

    Octadecimal and hexadecimal systems solve the problem that binary digits are too long to be written and not easy to identify. ==

Related questions
16 answers2024-04-24

1.The computer is stuck and running slowly or cannot shut down properly or shut down slowly or has little virtual memory. >>>More

5 answers2024-04-24

The school should have a lot of computer labs, right? If you really want to learn the computer well, the time on the computer must be guaranteed, you can go to the computer room, but the disadvantage is that it costs money (but the general school computer room is not expensive), and it is inconvenient, and your own information or something has to be copied again every time. >>>More

5 answers2024-04-24

In English, the common name of computer is "computer" and the pronunciation is k m pju t r, where "com" is pronounced as k m, "pu" as pju, and "ter" as t r. >>>More

10 answers2024-04-24

1.Learning to program depends on how well you think about it, if you are strong, you can get started in a few months, if you are not good, it will take two years (it is recommended that you find a training school). >>>More

5 answers2024-04-24

Bogu Tongjin is a popular science fun created by the small code king**,From when did the computer appear in history to the current smart home,From the binary principle executed inside the computer to the encoding and decoding of files。 Let the children learn to code and understand some deep things around the computer.