Download presentation on computer science binary number system. Presentation - binary number system. Converting decimal numbers to binary

1 slide

2 slide

* Binary coding in a computer All information that a computer processes must be represented in binary code using two digits: 0 and 1. These two characters are usually called binary digits or bits. Using two numbers 0 and 1 you can encode any message. This was the reason that two important processes must be organized in a computer: encoding and decoding. Coding is the transformation of input information into a form that can be perceived by a computer, i.e. binary code. Decoding is the process of converting data from binary code into a form that can be understood by humans. *

3 slide

* Binary number system Binary number system is a positional number system with base 2. The digits 0 and 1 are used. The binary system is used in digital devices, since it is the simplest and satisfies the requirements: The fewer values ​​there are in the system, the easier it is to produce individual elements. The fewer states an element has, the higher the noise immunity and the faster it can operate. Easy to create addition and multiplication tables - basic operations with 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 simultaneously with several number systems, 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 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 p=2 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000 *

5 slide

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

6 slide

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

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


Positional Number Systems The base of a positional number system is the number of different signs or symbols used to represent numbers in a given system. Any natural number two, three, four, etc. can be taken as the base of the system. Consequently, 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 due to its bulkiness and unusual notation. In this regard, octal and hexadecimal systems were developed. Numbers in these systems are almost as easy to read as decimal ones; they require, respectively, three (octal) and four (hexadecimal) times fewer digits than in the binary system (after all, the numbers 8 and 16 are, respectively, the third and fourth powers of the number 2) . – 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-ya2-ya8-ya16-ya10-ya2-ya8-ya16-ya A B C D E F


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




A sequence of bits 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 change. They can be stored and transmitted using the same methods, regardless of the data type. Methods for digitally encoding texts, sounds (voices, music), images (photos, illustrations) and sequences of images (cinema and video), as well as three-dimensional objects, were invented in the 1980s.


Binary coding of numerical information There are many known 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 constitute one unit of the next highest digit. The number 10 is called the base 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 number 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 subsequent number in the second row is obtained by multiplying the previous number by 2.


Binary encoding of numerical information Any integer can be represented as a sum of digit terms of units, tens, hundreds, thousands, and so on, written in the first row. Moreover, each member of this series can 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, by which the terms of the first row are multiplied, form the original number.


Translation of integers decimal numbers into binary code Let's try to represent the number 1409 as the sum of the terms of the second row. This method of obtaining the binary code of a decimal number is based on writing the remainders from dividing the original number and the resulting quotients by 2, continued until the next quotient is equal to 0. Example:


Converting integer decimal numbers into binary code The first cell of the top line 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 line contain the remainders from dividing the numbers in the top line by 2. The last cell of the bottom line remains empty . The binary code of the original decimal number is obtained by sequentially recording all remainders, starting from the last: =


Converting whole decimal numbers into binary code The first 20 terms of the natural series in the binary number 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 work in the decimal number system. Using the keyboard or mouse, enter a random two-digit number in the input field. Activate the Bin switch and watch the changes in the input window. Return to the decimal number 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 number system. Pay attention to which Calculator buttons and number keys on your keyboard are available to you. Alternately enter the binary codes of the 5th, 10th and 15th terms of the natural series and use the Dec switch to convert them to the decimal number system.

Slide 1

Binary number system
GBOU secondary school No. 1167

Slide 2

Quotes
All our dignity lies in thought... Let us learn to think well.

B. Pascal Learning without reflection is useless, but reflection without learning is also dangerous.

A number system is a set of techniques and rules for designating numbers.
Number systems A positional number system is a number system in which the same digit receives different quantitative values ​​depending on the place or position it occupies in the record of a given number.
Let's consider decimal numbers. Can we assume that they are the same, since they involve the same numbers - 3 and 4? Don't you agree? Explain why? The positional number system includes the decimal number system and the binary number system.

- Positional - Non-positional

43 and 34
Slide 4

A number system is called non-positional if in it the quantitative values ​​of the symbols used to write numbers do not depend on their position (place, position) in the number code.

For example, in the Roman numeral system, the entry IX represents the number 9, and the entry XI represents the number 11. The decimal number 28 is represented as follows: XXVIII = 10+10+5+1+1+1 The decimal number 99 is represented as follows: XCIX = -10 +100-1+10
Slide 5 The importance of the binary number system for encoding information In computers they use

binary system

, because it has a number of advantages over other systems: its implementation requires technical elements with two possible states (there is current, no current; on, off, etc.; one of the states is assigned 1, the other - 0), and not ten, as in the decimal system;
presentation of information through only two states is reliable and noise-resistant;

performing arithmetic operations is simplified; the ability to use the apparatus of Boolean algebra to perform logical transformations of information.

Slide 6
Charles Babbage (1791-1871), English mathematician and engineer who developed the principles on which all modern computers are designed.
Analytical Engine

Slide 7

Lady Programmer Augusta Ada Lovelace
From his student years until the end of his life, the great European, German scientist Wilhelm Gottfried Leibniz studied the properties of the binary number system, which later became the main one in the creation of computers. Image of the medal by W. Leibniz

Lesson plan for a computer science lesson in 9th grade on the topic “ Binary number system" (Slide 1)

Target: form the concept of “binary number system”and the 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;

    rules of addition and multiplication binary numbers.

Students should be able to:

    convert binary numbers to decimal system;

    convert decimal numbers to binary system;

    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 “Binary Number System” demonstration, show the expanded form of a number, conversion from the binary number system to the decimal number system and vice versa, the arithmetic of binary numbers.)

The binary number system is the main representation systeminformationin the computer's 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 popular belief, the binary number system was not invented by electronic computer design engineers, but by mathematicians and philosophers, long before the advent of computers, back in the 17th-19th centuries. The great German scientist Leibniz(Slide 6) believed: “Calculation using twos<...>is fundamental for science and gives rise to new discoveries... When numbers are reduced to the simplest principles, such as 0 and 1, a wonderful order appears everywhere.” Later, the binary system was forgotten, and only in 1936-1938 was 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 of performing calculations.

The number system to which we are all accustomed 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 equal to two. The question arises whether it is possible to represent any value with just two digits. It turns out that it is possible!

Expanded form of writing a number (Slide 9)

Let us recall the principle of writing numbers in the decimal number system. The meaning of a digit in a number 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 a sum of bit terms:

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

Thus, as you move from digit to digit from right to left, the “weight” of each digit increases 10 times. This is due to the fact that the base of the number system is ten.

Converting binary numbers to decimal system

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 so as not to confuse a binary number with a decimal one. After all, there is a decimal number 111011! The weight of each subsequent digit in a binary number increases by 2 times when moving from right to left. The expanded form of writing 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 number! And this is characteristic of the binary system: a rapid increase in the number of digits as the value of the number increases.

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 convert a binary number into its equal decimal number should be clear to you from the examples discussed above. How to carry out the reverse translation: from the decimal system to the binary system? To do this, you need to be able to decompose a decimal number into terms that are powers of two. For example:

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 acquainted with.

Suppose we need to convert the number 234 to the binary number system. We will divide 234 sequentially by 2 and remember the remainders, not forgetting about the zeros:

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

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

Task 3. (Slide 13) What 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 Number Arithmetic (Slide 14)

The rules of binary arithmetic are much simpler than the rules of 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

Its simplicity and consistency with the bit structure computer memory The binary number system attracted the inventors of the computer. It is much easier to implement technically than the decimal system.

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

+ 1011011101

111010110

10010110011

Now look carefully at next example Multiplying multi-digit binary numbers:

X 1101101

101

1101101

1101101

1000100001

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

Answer: 100; 1000; 10000; 100000.

Task 5. Perform multiplication in the 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)

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

Binary numbers are numbers in the binary number system. They are written using two numbers: 0 and 1.

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

The use of binary numbers in a computer is due to the bit structure of computer memory and the simplicity of binary arithmetic

Homework (Slide 18)

    Binary numbers givenX and Y . CalculateX + YAndX- Y , IfX= 1000111, Y = 11010.

    Binary numbers givenXAndU. CalculateX + Y - 1001101 ifX = 1010100, Y = 110101.

    Perform multiplication: 100110 x 11001.

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