Binary arithmetic presentation. Presentation for the lesson "Binary number system. Binary arithmetic." Presentations for the lesson

💖 Do you like it? Share the link with your friends

Calculate the algebraic sum -5 - 1.

Sign of overflow of the bit grid:

When adding two numbers algebraically,

placed in the bit grid, may arise

overflow, that is, a sum is formed that requires

its representation is one more binary digit,

than the bit grid of terms. It is assumed that

positive numbers are represented in direct code, and

negative in additional.

A sign of overflow is the presence of a carry in

sign digit of the amount in the absence of transfer from

sign bit (overflow) or

the presence of a carryover from the sign digit of the amount when

absence of transfer to the sign bit (negative

overflow).

If overflow is positive, the result of the operation is

positive, and with negative overflow -

negative.

If both in the signed and from the signed digits of the sum

Physics of Computers 2011

there are hyphens or there are no hyphens, then

L.A. Zolotorevich

there is no overflow.

These codes differ from direct, inverse and additional codes in that two bits are assigned to the sign image: if the number is positive - 00, if the number is negative - 11. Such codes turned out to be convenient (from the point of view of ALU construction) for detecting overflow of the bit grid. If the sign bits of the result take the value 00 and 11, then there was no overflow of the bit grid, and if 01 or 10, then there was

overflow.

Note:

It should be borne in mind that only the basic principles of performing arithmetic operations have been considered, from which it is clear that all arithmetic operations with binary numbers can be reduced to two operations - the operations of summing binary numbers in direct or

additional codes, as well as shift operations

binary number to the right or left. Real algorithms

performing operationsPhysics of computer multiplication and division 2011 in modern

Computers are quite cumbersome and L.A. and Zolotorevich are not considered here.

When working with arithmetic increased accuracy requires more memory to store the same amount of data

And more intensive processor operation.The increase in the amount of memory required is quite obvious.

Let us consider very briefly the sequence of operations when adding numbers with triple precision. Here it is no longer enough to extract two words from memory and form a sum in the accumulator

And send the result to memory.

First you need to contact the younger meaningful word each number.

After addition, the result is written into memory, and possible transfers are subject to temporary storage.

Then the words of average importance are extracted, they are added, and the carry bits obtained as a result of the previous operation are added to the sum. The result is written into memory in a place specially reserved for the middle word of the sum.

The same is done with the senior word.

Thus, using triple precision arithmetic requires three times the memory and time required for addition operations compared to arithmetic

single precision. Physics In addition to computers, in the event of interruptions occurring in 2011, it is necessary to temporarily store the contents.

Multiplication acceleration methods.

The considered approach to multiplication shows that multiplication is a fairly long operation, consisting of N summations and shifts, as well as selecting the next digits of the multiplier. This implies the relevance of the task of maximally reducing the time spent on a multiplication operation, especially for systems operating in real time.

In modern computers, methods for accelerating multiplication can be divided into:

1) hardware;

2) logical (algorithmic);

3) combined.

Hardware methods.

1. Parallelization of computational operations. For example, combining summation and shift in time.

2. Table multiplication.

Physics of Computers 2011 L.A. Zolotorevich

Table multiplication is a fairly common way to implement it. various functions. Let's look at it in more detail.

Let X and Y be 1 byte long integers. We need to calculate Z=X*Y. You can use 65 KB of memory and store the Z values ​​for all possible combinations of X and Y, and use the X and Y factors as the address. It turns out a kind of table like this:

Physics of Computers 2011 L.A. Zolotorevich

Combined methods.

Let's look at an example. Let X and Y be 16-bit numbers. It is necessary to calculate a product of the form: Z=X*Y. It will not be possible to use the table method directly, since a very large amount of memory will be required for these purposes. However, you can think of each factor as the sum of two 16-bit terms, each of which represents groups of high and low digits of the factors. In this case, the product will take the form:

Z= X*Y = (x15 ... x0 )*(y15 ... y0 ) =

= (x15 ...x8 000...0 + 000...0x7 ...x0 )* (y15 ...y8 000...0 + 000...0y7 ...y0 ) =

216 (x15 ...x8 ) (y15 ...y8 ) + 28 (x15 ...x8 ) (y7 ...y0 ) + 28 (x7 ...x0 ) (y15 ...y8 )

+ (x7 ...x0 )*(y7 ...y0 )

Thus, the product is decomposed into simple

8-bit multipliers. These works are 8-bit

Physics of Computers 2011

operands are calculated by the tabular L.A. Zolotorevich method, and then

Features of subtracting binary decimal numbers.

By analogy with subtraction operations in binary code, X-Y operation can be represented as X + (-Y). In this case, a negative number is represented in an additional code, similar to the additional code in binary arithmetic. This code is only used to perform subtraction operations.

The operation algorithm is as follows:

1) Module positive number is represented in straight binary decimal code (8421).

The modulus of a negative number is in complementary code (DC) with an excess of 6.

To obtain a DC you must:

- invert the digit values ​​of all tetrads of a number;

- add 1 to the least significant digit of the least significant tetrad.

Thus, the chain PC(mod) OK OK+1 DC is similar to the chain in binary arithmetic. Only here we get a DC with an excess of 6, because the addition goes not to 10, but to 16.

2) Add operands (X) in PC and (Y) in DC.

3) If, when adding tetrads, a carry occurs from the highest tetrad, it is discarded and the result is assigned a “+” sign, i.e. the result is obtained in direct redundant code. He

is adjusted according to the same rules as when adding modules.

Physics of Computers 2011

L.A. Zolotorevich

Binary Arithmetic (continued)

Features of subtracting binary decimal numbers (BCD).

4) If, when adding tetrads, no transfer occurs from

the highest tetrad, then the result is assigned the sign “-”, i.e.

the result is obtained in excess DC. In this case it is necessary

go to redundant PC (i.e. invert all binary

binary bits decimal number and add to the youngest

category 1).

5) The result obtained in this case is corrected in the PC.

To do this, to those tetrads from which the transfer arose at

fulfillment of point 2 (when summing up), it is necessary to add

Let's imagine |Y| in DC with excess

Let's do the addition:

The absence of transfer from the senior tetrad is a sign that the result was obtained in the DC (i.e. negative). Let's move on to uncorrected excess PC.

Physics of Computers 2011 L.A. Zolotorevich

, Competition "Presentation for the lesson"

Presentations for the lesson

Back forward

Attention! Slide previews are for informational purposes only and may not represent all the features of the presentation. If you are interested in this work, please download the full version.









Back forward

The purpose of the lesson: Develop skills in performing arithmetic operations with binary numbers.

Lesson objectives:

  • Introduce the rules for performing arithmetic operations (addition, multiplication, subtraction, division) in the binary number system, and practice applying the acquired knowledge in practice.
  • Instill skills of independence in work, cultivate accuracy.
  • Develop interest in the subject and self-control skills.

Equipment: interactive whiteboard, projector, presentations: "Battleship", "Binary arithmetic", spreadsheets for practical work and reflection.

Lesson plan:

  1. Organizing time.
  2. Lesson motivation: setting the lesson goal.
  3. Repetition of previously studied material. Presentation "Battleship". (Presentation 1)
  4. Learning new material. Presentation “Binary Arithmetic”. (Presentation 2)
  5. Consolidation of the studied material. Binary Arithmetic Spreadsheet. (Annex 1)
  6. Lesson summary. Reflection. ( Appendix 2)
  7. Homework.

During the classes

I. Organizational moment.

II. Lesson motivation: setting the lesson goal.

III. Repetition of previously studied material. Presentation "Battleship".

To check how you learned the material of the previous lesson, let's play "Sea Battle" . (The game can be played using individual or frontal forms of work. For individual work, you must copy the presentation to the students' computers in advance; for frontal work, you must use an interactive whiteboard).

For a question to appear on the screen, you must click on the corresponding number on the steering wheel. To answer, click on the corresponding cell of the playing field.

When working individually, the result can be assessed as follows:

"5" – 5 boats,
"4" – 5 boats, 1 “past” (orange square)
"3" – 5 boats, 2 “past” (orange squares)

IV. Learning new material. Presentation “Binary Arithmetic”.

(Slide 1)

In order to better master the binary number system, it is necessary to master the performance of arithmetic operations on binary numbers.

All positional number systems are “the same”, namely, in all of them, arithmetic operations are performed according to the same rules:

  • the rules of addition, subtraction, multiplication and division are valid;
  • the rules for performing arithmetic operations are based on addition and multiplication tables.

(Slide 2-3)

Let's look at the rules for adding binary numbers.

(Slide 4-5)

Consider the rules for multiplying binary numbers.

(Slide 6-7)

Consider the rules for subtracting binary numbers.

(Slide 8)

Consider the rules for dividing binary numbers.

V. Consolidation of the studied material.

Let's move on to the practical work.

The practical work assignment is indicated in the “Binary Arithmetic” spreadsheet. Students perform arithmetic operations in writing in their notebooks and enter the results into a table. The table has conditional formatting applied. If the result is correct, the color of the numbers changes; if the result is incorrect, the color of the numbers remains black. Thus, students can immediately work on the mistakes.

"5" – 11- 12 correct answers,
"4" – 8- 10 correct answers,
"3" – 5- 7 correct answers.

VI. Summarizing. Reflection.

Computer science lesson in 8th grade “Binary number system. Binary arithmetic"

Teacher: Zaitseva Galina Georgievna

Municipal secondary school in the village of Raskatovo


Test

1. The number system is...

1) a sign system in which certain rules for writing numbers are adopted.

2) a set of signs.

3) a set of rules for writing numbers.


2. Continue the sentence: “The following number systems are distinguished: …”.

1) algorithmic, unary and non-positional.

2) unary, non-positional and positional.

3) non-positional and positional.


3. The positional number system is...

1) a number system in which the quantitative equivalent of a digit does not depend on its position in the number record.

2) number system with base 10.

3) a number system in which the quantitative equivalent of a digit depends on its position in the number record.


4. A non-positional number system is...

1) a number system in which the quantitative equivalent of a digit depends on its position in the number record.

3) a number system in which the quantitative equivalent of a digit in a number does not depend on its position in the notation of the number.


5. Identify the correct statements.

1) The alphabet of a number system is a collection of numbers.

2) The unary number system is the most ancient and simplest system Reckoning.

3) Nodal numbers are obtained as a result of some operations from algorithmic numbers.

4) Numbers are signs with which numbers are written.

5) Algorithmic numbers are obtained as a result of some operations from node numbers.


Self-test:



Lesson objectives:

To know

O representation of numerical information in the binary system.

Learn to:

perform arithmetic operations in binary system


Binary number system is a positional number system with base 2.

Alphabet of the binary number system:

101101011 2

Subscript is a number that indicates the basis of the system.


The rule for converting integer decimal numbers to the binary number system

To convert a decimal integer to a binary number system, you need to sequentially divide the given number and the resulting integer quotients by 2 until the quotient is equal to zero. The original number in the binary number system is compiled by sequential recording of the resulting residues, starting with the last one.


Compact design

363 10 = 101101011 2


11 2 10 5 2 1 4 2 2 1 2 1 0


Do it yourself:

Examination:


Learn about binary arithmetic

At any positional system arithmetic operations are performed. They come down to using all possible options addition and multiplication of single-digit binary numbers.

Addition table

Multiplication table


Do this with your teacher:

RT No. 55 (1,2),56 (1, 2)

Check:


Homework:

§ 1.1.2, 1.1.6

55(3), 56(3)


Used materials:

Bosova L.L.. Computer Science, 8th grade, 2015.

Bosova L.L. Computer Science 8th grade. Federal State Educational Standard. Electronic supplement to the textbook.

Single collection of digital educational resources http://school-collection.edu.ru/ (128618, 128634)



tell friends