• Aucun résultat trouvé

Épreuve de section européenne

N/A
N/A
Protected

Academic year: 2022

Partager "Épreuve de section européenne"

Copied!
1
0
0

Texte intégral

(1)

Baccalauréat, série S, spécialité mathématiques ou ISN Session de juin 2013

Épreuve de section européenne

Binary subtraction and the NOT operator

Just as a decimal number is decomposed as powers of ten (for example 247 = 2×102+ 4× 101+ 7×100), a binary number is decomposed as powers of two. For example, the binary number 1101 denotes the quantity

1×23+ 1×22+ 0×21+ 1×20= 8 + 4 + 1 = 13.

Computers carry out operations exclusively on binary numbers. For example, in binary0+0 = 0, 1 + 0 = 0 + 1 = 1and 1 + 1 = 10. This last operation will be useful later on in this text.

A binary number made of 8 digits (all 0s or 1s) is called a byte.

The computer performs the subtraction of one number from another by changing the number subtracted into its complement and adding. In binary, the complement of a byte is given by the operator NOT. (There are occasional problems with the generation of extra `carry' numbers at the end, but simple renements cure them.) For example, if the computer is asked to calculate 243−95, it will proceed as follows (note that 243 and 95 are respectively11110011and01011111 in binary) :

11110011−01011111 is the same as

11110011 +NOT(01011111) which is

11110011 + 10100000 that is

110010011

. The extra 1 at the end (the rst digit on the left), which is the carry of the last1 + 1addition, is moved round and added at the beginning (one of the renements mentioned above), making the number we are seeking

10010100 which is indeed equal to 148 = 243−95.

Adapted from Number, John McLeish, 1991

Questions

1. Check that the binary notations of243and95 are respectively11110011 and01011111. 2. What is a byte ? What is the greatest decimal number that can be written with a byte ? 3. The exampleNOT(01011111) = 10100000shows that the complement of a byte can easily

be obtained graphically. Deduce from this the binary value of NOT(00101001).

4. Give the decimal values of the binary numbers 00101001 and NOT(00101001). How does this result explain the name `complement' for the operator NOT ?

5. Use the showcased method in the text to carry out the subtraction 52−41.

2013-44 Binary subtraction and the NOT operator

Références

Documents relatifs

Throughout this paper, we shall use the following notations: N denotes the set of the positive integers, π( x ) denotes the number of the prime numbers not exceeding x, and p i

The ration of the number of revolution of the driver gear to the number of revolution of the driven gear is called the gear ration.. Le rapport de réduction peut être changé

In order to do so, compare the free energy of a perfectly ordered system with the free energy of a partially disordered case that introduces the less energetic frustrations

We proved for a model problem that truncation of the unbounded computational domain by a Dirichlet boundary conditions at a certain distance away from the domain of interest is

Instrumentation 2x Alto Saxophone 2x Tenor Saxophone Baritone Saxophone 4x Trumpet / Flugelhorn 3x Tenor Trombone Bass Trombone Electric Guitar Bass Guitar

In [1], Ambroˇz, Frid, Mas´akov´ a and Pelantov´ a estimated the number of all words arising from three- interval exchange, which continues the same line since Sturmian words

d) Accidents et complications du drainage thoracique : ... TRAITEMENT CHIRURGICAL ... OPTIONS DU TRAITEMENT CHIRURGICAL : ... LA PLACE DU TRAITEMENTMEDICAL : .... Table des

In order to simplify the process of converting numbers from the modular representation to the positional representation of numbers, we will consider an approximate method that allows