To come in
Logopedic portal
  • Soft sign after hissing: rules and exceptions
  • Famous expressions in Latin with translation
  • Continuous and separate spelling of prefixes in adverbs formed from nouns and cardinal numbers
  • Spelling of doubtful consonants at the root of a word
  • Plays in German for children - German language online - Start Deutsch
  • "The Captain's Daughter": retelling
  • Number 8 in octal system. Number systems. The positional number system is octal. Positional number systems

    Number 8 in octal system.  Number systems.  The positional number system is octal.  Positional number systems

    Octal number system finds application in technology mainly as a means of compact notation of binary numbers. In the past, it was quite popular, but recently it has been practically superseded by the hexadecimal system, because the latter is better suited to the architecture of modern digital devices.

    So, the basis of the system is the number eight 8 or in octal system 10 8 - this means that eight digits are used to represent numbers (0,1,2,3,4,5,6,7). Hereinafter, a small number to the right below the main notation of the number will indicate the base of the number system. For the decimal system, the base will not be indicated.

    Zero - 0 ;
    One - 1 ;
    Two - 2 ;
    ...
    and so on…
    ...
    Six - 6 ;
    Seven - 7 ;

    What to do next? All numbers are gone. How to represent the number eight? In the decimal system in a similar situation (when the numbers ran out), we introduced the concept of ten, here we introduce the concept of "eight" and say that eight is one eight and zero units. And this can already be written down - "10 8".

    So, Eight - 10 8 (one eight, zero ones)
    Nine - 11 8 (one eight, one one)
    ...
    and so on…
    ...
    Fifteen - 17 8 (one eight, seven ones)
    Sixteen - 20 8 (two eights, zero ones)
    Seventeen - 21 8 (two eights, one one)
    ...
    and so on…
    ...
    Sixty three - 77 8 (seven eights, seven ones)

    Sixty four - 100 8 (one Sixty-four, zero eights, zero ones)
    Sixty five - 101 8 (one "Sixty-four", zero eights, one one)
    Sixty six - 102 8 (one "Sixty-four", zero eights, two ones)
    ...
    and so on...
    ...

    Whenever we have exhausted the set of digits to display the next number, we enter larger units of account (i.e. count in eights, sixty fours, etc.) and write the number with a one-digit extension.

    Consider the number 5372 8 written in octal number system. We can say about it that it contains: five to five hundred and twelve, three to sixty-four, seven eights and two units. And you can get its value through the numbers included in it as follows.

    5372 8 = 5 *512+3 *64+7 *8+2 *1, hereinafter the * (asterisk) sign means multiplication.

    But the series of numbers 512, 64, 8, 1 is nothing but the integer powers of the number eight (the base of the number system) and therefore we can write:

    5372 8 = 5 *8 3 +3 *8 2 +7 *8 1 +2 *8 0

    Similarly for an octal fraction (fractional number) for example: 0.572 8 (One hundred and fifty-seven five hundred and twelfths), it can be said that it contains: five eighths, seven sixty-fourths and two five hundred and twelfths. And its value can be calculated as follows:

    0.572 8 = 5 *(1/8) + 7 *(1/64) + 2 *(1/512)

    And here is a series of numbers 1/8; 1/64 and 1/512 are nothing but integer powers of eight and we can also write:

    0.572 8 = 5 *8 -1 + 7 *8 -2 + 2 *8 -3

    For the mixed number 752.159, we can similarly write:

    752.364 = 7 *8 2 +5 *8 1 +2 *8 0 +1 *8 -1 +5 *8 -2 +9 *8 -3

    Now, if we number the digits of the integer part of any number, from right to left, as 0,1,2 ... n (numbering starts from zero!). And the digits of the fractional part, from left to right, like -1, -2, -3 ... -m, then the value of any arbitrary octal number can be calculated by the formula:

    N = d n 8 n +d n-1 8 n-1 +…+d 1 8 1 +d 0 8 0 +d -1 8 -1 +d -2 8 -2 +…+d -(m-1) 8 -(m-1) +d -m 8 -m

    Where: n- the number of digits in the integer part of the number minus one;
    m- the number of digits in the fractional part of the number
    d i- number in i-th category

    This formula is called the formula for the bitwise expansion of an octal number, i.e. number written in octal number system. But if in this formula the number eight is replaced by some natural number q, then we get the expansion formula for the number expressed in the number system with the base q:

    N = d n q n +d n-1 q n-1 +…+d 1 q 1 +d 0 q 0 +d -1 q -1 +d -2 q -2 +…+d -(m-1) q - (m-1) +d -m q -m

    Using this formula, we can always calculate the value of a number written not only in the octal number system, but also in any other positional system. You can read about other number systems on our website using the following links.

    The octal number system is a positional number system with base 8. To write numbers in the octal system, 8 digits from zero to seven (0,1,2,3,4,5,6,7) are used.

    Application: the octal system, along with binary and hexadecimal, is used in digital electronics and computer technology, but is rarely used today (previously used in low-level programming, superseded by hexadecimal).

    The widespread use of the octal system in electronic computing is explained by the fact that it is characterized by easy conversion to binary and vice versa using a simple table in which all digits of the octal system from 0 to 7 are presented as binary triplets (Table 4).

    * History of the octal number system

    History: the emergence of the octal system is associated with such a technique for counting on fingers, when not fingers were counted, but the spaces between them (there are only eight of them).

    In 1716, King Charles XII of Sweden invited the famous Swedish philosopher Emanuel Swedenborg to develop a number system based on 64 instead of 10. However, Swedenborg believed that for people with less intelligence than the king, it would be too difficult to operate with such a number system and proposed the number as the basis 8. The system was developed, but the death of Charles XII in 1718 prevented its introduction as generally accepted, this work of Swedenborg is not published.

    * Convert from octal to decimal number system

    To translate an octal number into a decimal number, it is necessary to represent this number as the sum of the products of the degrees of the base of the octal number system by the corresponding digits in the digits of the octal number.

    For example, you want to convert the octal number 2357 to decimal. This number has 4 digits and 4 digits (the digits are counted starting from zero, which corresponds to the least significant bit). In accordance with the rule already known to us, we represent it as a sum of powers with base 8:

    23578 = (2*83)+(3*82)+(5*81)+(7*80) = 2*512 + 3*64 + 5*8 + 7*1 = 126310

    * Convert from octal to binary number system

    To convert from octal to binary, each digit of the number must be converted into a group of three binary digits triad (Table 4).

    * Convert from octal to hexadecimal number system

    To convert from hexadecimal to binary, each digit of the number must be converted into a group of three binary digits in a tetrad (Table 3).

    Hexadecimal number system

    Positional number system in integer base 16.

    Usually, decimal digits from 0 to 9 and Latin letters from A to F are used as hexadecimal digits to represent numbers from 1010 to 1510, that is, (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F).

    It is widely used in low-level programming and computer documentation, since in modern computers the minimum unit of memory is an 8-bit byte, the values ​​\u200b\u200bof which are conveniently written in two hexadecimal digits.

    In the Unicode standard, it is customary to write a character number in hexadecimal form, using at least 4 digits (with leading zeros if necessary).

    Hexadecimal color - writes the three color components (R, G and B) in hexadecimal.

    * History of hexadecimal number system

    The hexadecimal number system was introduced by the American corporation IBM. Widely used in programming for IBM-compatible computers. The minimum addressable (sent between computer components) unit of information is a byte, usually consisting of 8 bits (eng. word (command). Thus, it is convenient to use the base 16 system for writing commands.

    * Convert from hexadecimal to binary number system

    The algorithm for converting numbers from hexadecimal to binary is extremely simple. It is only necessary to replace each hexadecimal digit with its binary equivalent (in the case of positive numbers). We only note that each hexadecimal number should be replaced by a binary number, complementing it up to 4 digits (in the direction of higher digits).

    * Convert from hexadecimal to decimal number system

    To convert a hexadecimal number to a decimal one, this number must be represented as the sum of the products of the degrees of the base of the hexadecimal number system and the corresponding digits in the digits of the hexadecimal number.

    For example, you want to convert the hexadecimal number F45ED23C to decimal. This number has 8 digits and 8 digits (remember that the digits are counted starting from zero, which corresponds to the least significant bit). In accordance with the above rule, we represent it as a sum of powers with base 16:

    F45ED23C16 = (15*167)+(4*166)+(5*165)+(14*164)+(13*163)+(2*162)+

    (3*161)+(12*160) = 409985490810

    * Convert from hexadecimal to octal number system

    Usually, when converting numbers from hexadecimal to octal, first convert the hexadecimal number to binary, then break it into triads, starting with the least significant bit, and then replace the triads with their corresponding equivalents in the octal system (Table 4).

    In the course of computer science, regardless of school or university, a special place is given to such a concept as number systems. As a rule, several lessons or practical exercises are allocated for it. The main goal is not only to learn the basic concepts of the topic, to study the types of number systems, but also to get acquainted with binary, octal and hexadecimal arithmetic.

    What does it mean?

    Let's start with the definition of the main concept. As the textbook "Computer Science" notes, the number system is a record of numbers that uses a special alphabet or a specific set of numbers.

    Depending on whether the value of a digit changes from its position in the number, two are distinguished: positional and non-positional number systems.

    In positional systems, the value of a digit changes with its position in the number. So, if we take the number 234, then the number 4 in it means units, but if we consider the number 243, then here it will already mean tens, not units.

    In non-positional systems, the value of a digit is static, regardless of its position in the number. The most striking example is the stick system, where each unit is indicated by a dash. No matter where you assign the wand, the value of the number will only change by one.

    Non-positional systems

    Non-positional number systems include:

    1. A single system, which is considered one of the first. It used sticks instead of numbers. The more there were, the greater was the value of the number. You can meet an example of numbers written in this way in films where we are talking about people lost at sea, prisoners who mark every day with the help of notches on a stone or tree.
    2. Roman, in which Latin letters were used instead of numbers. Using them, you can write any number. At the same time, its value was determined using the sum and difference of the digits that made up the number. If there was a smaller number to the left of the digit, then the left digit was subtracted from the right one, and if the digit to the right was less than or equal to the digit to the left, then their values ​​were summed up. For example, the number 11 was written as XI, and 9 - IX.
    3. Letters, in which numbers were denoted using the alphabet of a particular language. One of them is the Slavic system, in which a number of letters had not only a phonetic, but also a numerical value.
    4. in which only two designations were used for recording - wedges and arrows.
    5. In Egypt, too, special symbols were used to denote numbers. When writing a number, each character could be used no more than nine times.

    Positional systems

    Much attention is paid in computer science to positional number systems. These include the following:

    • binary;
    • octal;
    • decimal;
    • hexadecimal;
    • sexagesimal, used when counting time (for example, in a minute - 60 seconds, in an hour - 60 minutes).

    Each of them has its own alphabet for writing, translation rules and arithmetic operations.

    Decimal system

    This system is the most familiar to us. It uses numbers from 0 to 9 to write numbers. They are also called Arabic. Depending on the position of the digit in the number, it can denote different digits - units, tens, hundreds, thousands or millions. We use it everywhere, we know the basic rules by which arithmetic operations are performed on numbers.

    Binary system

    One of the main number systems in computer science is binary. Its simplicity allows the computer to perform cumbersome calculations several times faster than in the decimal system.

    To write numbers, only two digits are used - 0 and 1. At the same time, depending on the position of 0 or 1 in the number, its value will change.

    Initially, it was with the help of computers that they received all the necessary information. At the same time, one meant the presence of a signal transmitted using voltage, and zero meant its absence.

    Octal system

    Another well-known computer number system, which uses numbers from 0 to 7. It was used mainly in those areas of knowledge that are associated with digital devices. But recently it has been used much less frequently, since it has been replaced by the hexadecimal number system.

    Binary Decimal

    Representing large numbers in the binary system for a person is a rather complicated process. To simplify it, it was developed. It is usually used in electronic watches, calculators. In this system, not the entire number is converted from the decimal system to binary, but each digit is translated into the corresponding set of zeros and ones in the binary system. The same goes for converting from binary to decimal. Each digit, represented as a four-digit set of zeros and ones, is translated into a digit in the decimal number system. In principle, there is nothing complicated.

    To work with numbers, in this case, a table of number systems is useful, which will indicate the correspondence between numbers and their binary code.

    Hexadecimal system

    Recently, the hexadecimal number system has become increasingly popular in programming and computer science. It uses not only numbers from 0 to 9, but also a number of Latin letters - A, B, C, D, E, F.

    At the same time, each of the letters has its own meaning, so A=10, B=11, C=12 and so on. Each number is represented as a set of four characters: 001F.

    Number conversion: from decimal to binary

    Translation in number systems occurs according to certain rules. The most common conversion is from binary to decimal and vice versa.

    In order to convert a number from decimal to binary, it is necessary to consistently divide it by the base of the number system, that is, the number two. In this case, the remainder of each division must be fixed. This will continue until the remainder of the division is less than or equal to one. It is best to carry out calculations in a column. Then the resulting division remainders are written to the string in reverse order.

    For example, let's convert the number 9 to binary:

    We divide 9, since the number is not evenly divisible, then we take the number 8, the remainder will be 9 - 1 = 1.

    After dividing 8 by 2, we get 4. We divide it again, since the number is divided by two - we get 4 - 4 = 0 in the remainder.

    We carry out the same operation with 2. The remainder is 0.

    As a result of division, we get 1.

    Regardless of the final number system, the transfer of numbers from decimal to any other will occur according to the principle of dividing the number by the basis of the positional system.

    Number conversion: from binary to decimal

    It is quite easy to convert numbers to decimal from binary. To do this, it is enough to know the rules for raising numbers to a power. In this case, to a power of two.

    The translation algorithm is as follows: each digit from the binary number code must be multiplied by two, and the first two will be to the power of m-1, the second - m-2, and so on, where m is the number of digits in the code. Then add the results of the addition, getting an integer.

    For schoolchildren, this algorithm can be explained more simply:

    To begin with, we take and write down each digit multiplied by two, then we put down the power of two from the end, starting from zero. Then add up the resulting number.

    For example, let's analyze with you the number 1001 obtained earlier, converting it to the decimal system, and at the same time check the correctness of our calculations.

    It will look like this:

    1*2 3 + 0*2 2 +0*2 1 +1*2 0 = 8+0+0+1 =9.

    When studying this topic, it is convenient to use a table with powers of two. This will significantly reduce the amount of time required for calculations.

    Other translation options

    In some cases, translation can be carried out between binary and octal, binary and hexadecimal. In this case, you can use special tables or run the calculator application on your computer by selecting the “Programmer” option in the view tab.

    Arithmetic operations

    Regardless of the form in which the number is represented, it is possible to carry out calculations familiar to us with it. This can be division and multiplication, subtraction and addition in the number system you have chosen. Of course, each of them has its own rules.

    So for the binary system developed its own tables for each of the operations. The same tables are used in other positional systems.

    It is not necessary to memorize them - just print and have at hand. You can also use the calculator on your PC.

    One of the most important topics in computer science is the number system. Knowing this topic, understanding the algorithms for translating numbers from one system to another is a guarantee that you will be able to understand more complex topics, such as algorithmization and programming, and will be able to write your first program on your own.

    Service assignment. The service is designed to translate numbers from one number system to another online. To do this, select the base of the system from which you want to translate the number. You can enter both integers and numbers with a comma.

    You can enter either whole numbers, such as 34 , or fractional numbers, such as 637.333 . For fractional numbers, the accuracy of the translation after the decimal point is indicated.

    The following are also used with this calculator:

    Ways to represent numbers

    Binary (binary) numbers - each digit means the value of one bit (0 or 1), the most significant bit is always written on the left, the letter “b” is placed after the number. For ease of perception, notebooks can be separated by spaces. For example, 1010 0101b.
    Hexadecimal (hexadecimal) numbers - each tetrad is represented by one character 0...9, A, B, ..., F. Such a representation can be denoted in different ways, here only the character "h" is used after the last hexadecimal digit. For example, A5h. In program texts, the same number can be denoted both as 0xA5 and 0A5h, depending on the syntax of the programming language. A non-significant zero (0) is added to the left of the most significant hexadecimal digit represented by a letter to distinguish between numbers and symbolic names.
    Decimals (decimal) numbers - each byte (word, double word) is represented by an ordinary number, and the sign of the decimal representation (letter "d") is usually omitted. The byte from the previous examples has a decimal value of 165. Unlike binary and hexadecimal notation, decimal is difficult to mentally determine the value of each bit, which sometimes has to be done.
    Octal (octal) numbers - each triple of bits (separation starts from the least significant) is written as a number 0-7, at the end the sign "o" is put. The same number would be written as 245o. The octal system is inconvenient in that the byte cannot be divided equally.

    Algorithm for converting numbers from one number system to another

    The conversion of integer decimal numbers to any other number system is carried out by dividing the number by the base of the new number system until the remainder leaves a number less than the base of the new number system. The new number is written as the remainder of the division, starting with the last one.
    The conversion of the correct decimal fraction to another PSS is carried out by multiplying only the fractional part of the number by the base of the new number system until all zeros remain in the fractional part or until the specified translation accuracy is reached. As a result of each multiplication operation, one digit of the new number is formed, starting from the highest.
    The translation of an improper fraction is carried out according to the 1st and 2nd rules. The integer and fractional parts are written together, separated by a comma.

    Example #1.



    Translation from 2 to 8 to 16 number system.
    These systems are multiples of two, therefore, the translation is carried out using the correspondence table (see below).

    To convert a number from a binary number system to an octal (hexadecimal) number, it is necessary to divide the binary number into groups of three (four for hexadecimal) digits from a comma to the right and left, complementing the extreme groups with zeros if necessary. Each group is replaced by the corresponding octal or hexadecimal digit.

    Example #2. 1010111010.1011 = 1.010.111.010.101.1 = 1272.51 8
    here 001=1; 010=2; 111=7; 010=2; 101=5; 001=1

    When converting to hexadecimal, you must divide the number into parts, four digits each, following the same rules.
    Example #3. 1010111010.1011 = 10.1011.1010.1011 = 2B12.13 HEX
    here 0010=2; 1011=B; 1010=12; 1011=13

    The conversion of numbers from 2, 8 and 16 to the decimal system is carried out by breaking the number into separate ones and multiplying it by the base of the system (from which the number is translated) raised to the power corresponding to its ordinal number in the translated number. In this case, the numbers are numbered to the left of the decimal point (the first number has the number 0) with increasing, and to the right with decreasing (ie, with a negative sign). The results obtained are added up.

    Example #4.
    Example of converting from binary to decimal number system.

    1010010.101 2 = 1 2 6 +0 2 5 +1 2 4 +0 2 3 +0 2 2 +1 2 1 +0 2 0 + 1 2 -1 +0 2 - 2 +1 2 -3 =
    = 64+0+16+0+0+2+0+0.5+0+0.125 = 82.625 10 An example of converting from octal to decimal number system. 108.5 8 = 1* 8 2 +0 8 1 +8 8 0 + 5 8 -1 = 64+0+8+0.625 = 72.625 10 An example of converting from hexadecimal to decimal number system. 108.5 16 = 1 16 2 +0 16 1 +8 16 0 + 5 16 -1 = 256+0+8+0.3125 = 264.3125 10

    Once again, we repeat the algorithm for translating numbers from one number system to another PSS

    1. From the decimal number system:
      • divide the number by the base of the number system being translated;
      • find the remainder after dividing the integer part of the number;
      • write down all remainders from division in reverse order;
    2. From the binary system
      • To convert to the decimal number system, you need to find the sum of the products of base 2 by the corresponding degree of discharge;
      • To convert a number to octal, you need to break the number into triads.
        For example, 1000110 = 1000 110 = 106 8
      • To convert a number from binary to hexadecimal, you need to divide the number into groups of 4 digits.
        For example, 1000110 = 100 0110 = 46 16
    The system is called positional., for which the significance or weight of a digit depends on its location in the number. The relationship between systems is expressed in a table.
    Table of correspondence of number systems:
    Binary SSHexadecimal SS
    0000 0
    0001 1
    0010 2
    0011 3
    0100 4
    0101 5
    0110 6
    0111 7
    1000 8
    1001 9
    1010 A
    1011 B
    1100 C
    1101 D
    1110 E
    1111 F

    Table for converting to octal number system

    Example #2. Convert the number 100.12 from decimal to octal and vice versa. Explain the reasons for the discrepancies.
    Solution.
    Stage 1. .

    The remainder of the division is written in reverse order. We get the number in the 8th number system: 144
    100 = 144 8

    To translate the fractional part of a number, we successively multiply the fractional part by base 8. As a result, each time we write down the integer part of the product.
    0.12*8 = 0.96 (whole part 0 )
    0.96*8 = 7.68 (whole part 7 )
    0.68*8 = 5.44 (whole part 5 )
    0.44*8 = 3.52 (whole part 3 )
    We get the number in the 8th number system: 0753.
    0.12 = 0.753 8

    100,12 10 = 144,0753 8

    Stage 2. Converting a number from decimal to octal.
    Reverse conversion from octal to decimal.

    To translate the integer part, it is necessary to multiply the digit of the number by the corresponding degree of digit.
    144 = 8 2 *1 + 8 1 *4 + 8 0 *4 = 64 + 32 + 4 = 100

    To translate the fractional part, it is necessary to divide the digit of the number by the corresponding degree of digit
    0753 = 8 -1 *0 + 8 -2 *7 + 8 -3 *5 + 8 -4 *3 = 0.119873046875 = 0.1199

    144,0753 8 = 100,96 10
    The difference of 0.0001 (100.12 - 100.1199) is due to a rounding error when converting to octal. This error can be reduced if we take a larger number of digits (for example, not 4, but 8).

    For the first time, the positional number system arose in ancient Babylon. In India, the system operates in

    the form of positional decimal numbering using zero, the Indians have this number system

    borrowed by the Arab nation, they, in turn, were taken by the Europeans. In Europe, this system has become

    call Arabic.

    Positional system reckoning- the value of all digits depends on the position (digit) of this digit in the number.

    Examples, the standard 10th number system is a positional system. Let's say you're given a number 453 .

    Number 4 stands for hundreds and corresponds to a number 400, 5 - number of tens and corresponds to the value 50 ,

    A 3 - units and value 3 . It is easy to see that as the digit increases, the value increases.

    Thus, we write the given number as a sum 400+50+3=453.

    Octal number system.

    The octal number system, like the binary number system, is often used in digital

    Base of the octal number system - 8.

    There are 8 digits in the octal number system: 0, 1, 2, 3, 4, 5, 6, 7.

    To convert to binary For example, number 611 (octal), you need to change all the digits

    its equivalent binary triad (triple of digits). To convert a multi-digit binary number to

    octal number system, you need to break it into triads from right to left and replace all

    triad corresponding octal digit.

    Example:

    6118 = 011 001 0012

    1 110 011 1012=14358 (4 triads)

    Example octal number: 254.

    To convert to decimal, you need to multiply all the digits of the original number by 8n,

    Where n- rank number.

    The bottom line is that 254 8 = 2*8 2 + 5*8 1 + 4*8 0 = 128+40+4 = 172 10 .

    Table for converting octal numbers to binary.

    0 8 = 000 2

    1 8 = 001 2

    2 8 = 010 2

    3 8 = 011 2

    4 8 = 100 2

    5 8 = 101 2

    6 8 = 110 2

    7 8 = 111 2

    To convert an octal number to binary, you need to change all the digits of the octal number to

    triplet of binary digits.

    For example:

    2541 8 = [ 2 8 | 5 8 | 4 8 | 1 8 ] = [ 010 2 | 101 2 | 100 2 | 001 2 ] = 010101100001 2

    In programming, the prefix zero is used to specify an exact octal number.

    For example: 022.

    Algorithm for converting numbers from one number system to another.

    1. From the decimal number system:

    • we divide the number by the base of the number system being translated;
    • find the remainder from dividing the integer part of the number;
    • write down all the remainders of the division in reverse order;

    2. From the binary number system:

    • to convert to decimal, we find the sum of the products of base 2 by

    appropriate degree of discharge;

    • to convert a number to octal, we divide the number into triads.

    For example, 1000110 = 1000 110 = 1068

    • to convert a number from binary to hexadecimal, we divide the number into

    groups of 4 grades.

    For example, 1000110 = 100 0110 = 4616.

    Translation tables:

    Binary SS

    Hexadecimal SS

    Binary SS

    Octal SS