Hardware and software setup

Binary number system. Fundamentals of binary arithmetic

Number systems The number system is a set of techniques and rules for designating and naming numbers. The positional number system is called because the same digit receives different quantitative values ​​​​depending on the place, or position, that it occupies in the notation of the number. For example, in the entry of the number 555, the number 5, which is in the first place on the right, means 5 ones, in the second 5 tens, in the third 5 hundreds.


Positional Number Systems The base of a positional number system is the number of different characters or symbols used to represent digits in a given system. Any natural number two, three, four, etc. can be taken as the basis of the system. Therefore, an infinite number of positional systems are possible: binary, ternary, quaternary, etc.


Positional number systems Example: Binary number system Places Number, 1 2 = =1*2 3 +0*2 2 +1*2 1 +0*2 0 +1*2 -1 Octal number system Places Number2 7 6, 5 2 =2*8 2 +7*8 1 +6*8 0 +5* *8 -2


Positional number systems The binary system, convenient for computers, is inconvenient for humans because of its bulkiness and unusual notation. In this regard, octal and hexadecimal systems have been developed. Numbers in these systems are read almost as easily as decimal numbers, they require three (octal) and four (hexadecimal) times fewer digits, respectively, than in the binary system (after all, the numbers 8 and 16 are the third and fourth powers of the number 2, respectively) . -binary (digits 0, 1 are used); –octal (digits 0, 1,..., 7 are used); –hexadecimal (for the first integers from zero to nine, the digits 0, 1,..., 9 are used, and for the next numbers from ten to fifteen, the symbols A, B, C, D, E, F are used as digits).


Writing numbers in number systems 10-z2-z8-z16-z10-z2-z8-z16-z A B C D E F


How information is represented in a computer, or digital data In order to understand how a wide variety of information is represented in a computer, let's look inside the computer memory. It is convenient to present it in the form of a sheet in a cage. Each such “cell” stores only one of two values: zero or one. Two digits are convenient for electronic storage data as they require only two states electronic circuit"on" (corresponding to the number 1) and "off" (corresponding to the number 0). Each "cell" of computer memory is called a bit. The numbers 0 and 1 stored in the "cells" of the computer's memory are called bit values.




With the help of a sequence of bits, you can represent a variety of information. This representation of information is called binary or digital coding. The advantage of digital data is that it is relatively easy to copy and modify. They can be stored and transmitted using the same methods, regardless of the data type. Methods for digital coding of texts, sounds (voices, music), images (photos, illustrations) and sequences of images (movies and videos), as well as 3D objects were invented in the 80s of the last century.


Binary coding of numerical information There are many ways to write numbers. We use the decimal positional number system. It is called decimal because in this number system ten units of one digit make up one unit of the next most significant digit. The number 10 is called the base of the decimal number system. Ten digits are used to write numbers in the decimal system: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.


Binary coding of numerical information Consider two numerical series: 1, 10, 100, 1000, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, Both of these series begin with one. Each next number in the first row is obtained by multiplying the previous number by 10. Each next number in the second row is obtained by multiplying the previous number by 2.


Binary coding of numerical information Any integer can be represented as a sum of bit terms of units, tens, hundreds, thousands, and so on, written in the first row. Moreover, each member of this series may either not be included in the sum or be included in it from 1 to 9 times. Example: 1409 = The numbers 1, 4, 0, 9 multiplied by the members of the first row make up the original number.


Converting integer decimal numbers to binary code Let's try to represent the number 1409 as the sum of the members of the second row. This method of obtaining the binary code of a decimal number is based on recording the remainders from dividing the original number and the resulting quotients by 2, continuing until the next quotient is equal to 0. Example:


Converting integer decimal numbers to binary code The first cell of the top row contains the original number, and each next cell contains the result of integer division of the previous number by 2. The cells of the bottom row contain the remainders from dividing the numbers in the top row by 2. The last cell of the bottom row remains empty . The binary code of the original decimal number is obtained by sequentially writing all the remainders, starting with the last one: =


Converting integer decimal numbers to binary code The first 20 members of the natural series in the binary system are written as follows: 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000 , 10001, 10010, 10011,




Using the Calculator 2. Make sure the Calculator is set to decimal. Using the keyboard or mouse, enter an arbitrary two-digit number in the input field. Activate the Bin switch and observe the changes in the input window. Return to the decimal system. Clear the input field. 3. Repeat step 2 several times for other decimal numbers. 4. Set up the Calculator to work in the binary system. Pay attention to which Calculator buttons and keyboard numeric keys are available to you. Alternately enter the binary codes of the 5th, 10th and 15th members of the natural series and use the Dec switch to convert them to the decimal number system.

1 slide

2 slide

* Binary coding in a computer All information that a computer processes must be represented by a binary code using two digits: 0 and 1. These two characters are called binary digits or bits. With the help of two digits 0 and 1, any message can be encoded. This was the reason that two important processes must be organized in a computer: encoding and decoding. Encoding is the transformation of input information into a form that is perceived by a computer, i.e. binary code. Decoding is the transformation of data from a binary code into a human-readable form. *

3 slide

* Binary number system The binary number system is a positional number system with base 2. The numbers 0 and 1 are used. The binary system is used in digital devices, because it is the simplest and satisfies the requirements: The fewer values ​​exist in the system, the easier it is to make individual elements. The lower the number of states for an element, the higher the noise immunity and the faster it can work. Ease of creating addition and multiplication tables - basic operations on numbers *

4 slide

* Correspondence between decimal and binary number systems The number of digits used is called the base of the number system. When working with several number systems at the same time, to distinguish them, the base of the system is usually indicated as a subscript, which is written in the decimal system: 12310 is the number 123 in the decimal number system; 11110112 is the same number, but in binary. The binary number 1111011 can be written as: 11110112 = 1*26 + 1*25 + 1*24 + 1*23 + 0*22 + 1*21 + 1*20. p = 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

5 slide

* Translation of numbers from one number system to another Translation from the decimal number system to the base p number system is carried out by successively dividing the decimal number and its decimal quotients by p, and then writing out the last quotient and remainders in reverse order. Let's translate the decimal number 2010 into binary number systems (the base of the number system is p=2). As a result, we got 2010 = 101002. *

6 slide

* Transfer of numbers from one number system to another Transfer from a binary number system to a number system with base 10 is carried out by sequentially multiplying the elements of a binary number by 10 to the degree of the place of this element, taking into account that the numbering of places goes to the right and starts with the number "0". Let's translate the binary number 100102 into decimal number systems. As a result, we got 100102 = 1810. 100102=1*24+ 0*23 +0*22+1*21+ 0*20 =16+2=1810 *

Outline of a lesson in informatics in grade 9 on the topic " Binary number system "(Slide 1)

Target: to form the concept of "binary number system"and basics of arithmetic calculations in the binary system.(Slide 2)

Requirements for knowledge and skills (Slide 3)

Students should know:

    decimal and binary number systems;

    expanded form of writing a number;

    rules for converting from binary to decimal and vice versa;

    addition and multiplication rules binary numbers.

Students should be able to:

    convert binary numbers to decimal system;

    convert decimal numbers to binary;

    add and multiply binary numbers.

Software and didactic equipment: Sem., § 16, p. 96; demonstration "Binary number system"; projector.(Slide 4)

During the classes

    Organizing time

    Setting lesson goals

What numbers does the computer work with? Why?

How to operate them?

    Work on the topic of the lesson

(Using the demonstration "Binary Number System" to show the expanded form of the number, the conversion from binary to decimal and vice versa, binary arithmetic.)

The binary number system is the main representation systeminformationin computer memory. This idea belongs to John von Neumann(Slide 5) , who formulated in 1946 the principles of the design and operation of computers. But, contrary to a common misconception, the binary number system was invented not by design engineers of electronic computers, but by mathematicians and philosophers, long before the advent of computers, back in the 17th-19th centuries. The great German scientist Leibniz(Slide 6) thought: "Calculation with the help of twos<...>is fundamental for science and generates new discoveries ... When numbers are reduced to the simplest principles, which are 0 and 1, a wonderful order appears everywhere. Later, the binary system was forgotten, and only in 1936-1938 the American engineer and mathematician Claude Shannon(Slide 7) found remarkable applications of the binary system in the design of electronic circuits.

What is a number system? These are the rules for writing numbers and the associated ways to perform calculations.

The number system we are all used to is called decimal. This name is explained by the fact that it uses ten digits: 0,1,2, 3,4, 5, 6, 7, 8,9. (Slide 8) The number of digits determines the base of the number system. If the number of digits is ten, then the base of the number system is ten. In the binary system, there are only two digits: 0 and 1. The base is two. The question arises whether it is possible to represent any value with just two digits. It turns out you can!

Expanded form of writing a number (Slide 9)

Recall the principle of writing numbers in the decimal number system. The value of a digit in a number entry depends not only on the digit itself, but also on the location of this digit in the number (they say: on the position of the digit). For example, in the number 555, the first digit on the right means: three units, the next - three tens, the next - three hundreds. This fact can be expressed as the sum of the bit terms:

555 10 = 5 x 102 + 5 x 101 + 5 x 10° = 500 + 50 + 5.

Thus, with the advancement from digit to digit from right to left, the "weight" of each digit increases by 10 times. This is due to the fact that the base of the number system is ten.

Converting binary numbers to decimal

And here is an example of a multi-digit binary number: 1110112 . The two at the bottom right indicates the base of the number system. This is necessary in order not to confuse a binary number with a decimal one. After all, there is a decimal number 111011! The weight of each next digit in a binary number increases by 2 times when moving from right to left. The expanded form of this binary number looks like this:

111011 2 = 1 x 25 + 1 x 24 + 1 x 23 + 0x 22 + 1 x 21 + 1 x 2° = 6710 .

In this way, we converted the binary number to the decimal system.

Let's convert a few more binary numbers to the decimal system(Slide 10).

10 2 = 2 1 =2; 100 2 = 2 2 = 4; 1000 2 = 2 3 = 8;

10000 2 = 2 4 = 16; 100000 2 = 2 5 = 32 etc.

Thus, it turned out that a two-digit decimal number corresponds to a six-digit binary! And this is typical for the binary system: a rapid increase in the number of digits with an increase in the value of the number.

Exercise 1. (Slide 11) Write the beginning of the natural series of numbers in decimal (A10 ) and binary (A2 ) number systems.

Task 2. Convert the following binary numbers to decimal.

101 ; 11101 ; 101010 ; 100011 ; 10110111011 .

Answer: 5; 29; 42; 35; 1467.

Converting Decimal Numbers to Binary (Slide 12)

How to translate a binary number into a decimal number equal to it should be clear to you from the examples discussed above. And how to carry out the reverse translation: from the decimal system to binary? To do this, you need to be able to decompose a decimal number into terms, which are powers of two. For instance:

15 10 = 8 + 4 + 2 + 1 = 1 x 2 3 + 1 x 2 2 + 1 x 2 1 + 1 x 2° = 1111 2 . It's complicated. There is another way, which we will now get to know.

Let it be necessary to convert the number 234 into the binary number system. We will divide 234 sequentially by 2 and memorize the remainders, not forgetting the zeros:

234 = 2 x 117 + 0 14 = 2 x 7 + 0

Having written out all the remainders, starting with the last one, we get the binary expansion of the number: 23410 = 11101010 2 .

Task 3. (Slide 13) Which binary numbers correspond to the following decimal numbers?

2; 7; 17; 68; 315; 765; 2047.

Answer: 10 2 ; 111 2 ; 10001 2 ; 1000100 2 ; 100111011 2 ; 1011111101 2 ; 11111111111 2 .

Binary arithmetic (Slide 14)

Rules binary arithmetic much easier rules decimal arithmetic. That's all possible options addition and multiplication of single-digit binary numbers:

0+0=0

0+1=1

1+0=1

1+1=10

0*0=0

0*1=0

1*0=0

1*1=1

With its simplicity and consistency with the bit structure of computer memory, the binary number system attracted the inventors of the computer. It's much easier to implement technical means than the decimal system.

Here is an example of column addition of two multi-valued binary numbers(Slide 15) :

+ 1011011101

111010110

10010110011

Now look carefully at the following example of multiplying multi-valued binary numbers:

X 1101101

101

1101101

1101101

1000100001

Task 4. (Slide 16) Perform binary addition.11 + 1; 111 + 1; 1111 + 1; 11111 + 1.

Answer: 100; 1000; 10000; 100000.

Task 5. Perform multiplication in binary number system.

111 x 10; 111 x 11; 1101 x 101; 1101 x 1000.

Answer: 1110; 10101; 1000001; 1101000.

    Summing up the lesson (Slide 17)

The number system is certain rules for writing numbers and the ways of performing calculations associated with these rules. The base of the number system is equal to the number of digits used in it.

Binary numbers are numbers in the binary number system. They use two digits: 0 and 1.

An expanded form of writing a binary number is its representation as the sum of powers of two multiplied by 0 or 1.

The use of binary numbers in a computer is associated with the bit structure of computer memory and with the simplicity of binary arithmetic.

Homework (Slide 18)

    Given binary numbersX and Y . CalculateX + YandX- Y , ifX= 1000111, Y = 11010.

    Given binary numbersXandU. CalculateX + Y - 1001101 ifX= 1010100, Y = 110101.

    Multiply: 100110 x 11001.

Answers: 1.1100001 and 101101; 2. 111100; 3. 1110110110.

Liked the article? Share with friends!
Was this article helpful?
Yes
Not
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thank you. Your message has been sent
Did you find an error in the text?
Select it, click Ctrl+Enter and we'll fix it!