Digital processing (microprocessor)
This article is useful for the pupils of colleges and technical schools. The Microprocessor, brain of the computer, carries out all calculations.
Numbering system
Code
A decimal number can be represented by its equivalent in a different code such as:A code is a whole of rules of representation of data which can be: numerical, alphabetical, or alphanumeric. In addition to the decimal system, the principal numbering systems which one uses in the field of the data processing are: binary systems, octal and hexadecimal. When a code applies to the manner. to state the numbers, it defined a numbering system.
Example - the decimal number 12 is represented:
- by the number 1100 in the binary code,
- by the number 14 in the octal code,
- by the letter C in the hexadecimal code.
Base
A base B characterizes a numbering system in which any number NR can be written: NR = mnBn + mn-1Bn-1 + M1B + m0B0 with all the coefficients m < B.
Examples
- the number 341 (8) in octal base is written: 3 × 8 ² + 4 × 81 + 1 × 80
- the number 3AF8 (16) in hexadecimal base is written: 3 × 163 + has × 162 + F × 161+8 × 160
Numerical table
Weighting
To represent a NB number of N figures (or symbols), in a base B given, consists of the writing on line of these N figures in way such as: NB = (§) n-1… (§) i… (§) 5 (§) 4 (§) 3 (§) 2 (§) 1 (§) 0
With:
§: any of B figures or symbols of the base, N - 1,…. I, 5,4,3,2,1,0 indices indicating the row or the position of order of the figure starting from the line.
Weighting allows the attribution of a numerical value or weight each row. This weight P depends on the base in which the number is represented and has as a value: P=Brang
For base 10, decimal system:
The pure binary code or natural binary code is a fixed-count code in which the weights are represented by the successive powers of two. The decimal value of the binary number represented is obtained directly by addition of the affected weight to each bit of value 1.
In the pure binary code the passage from one combination to another involves sometimes the simultaneous change several bits. It is for example the case for the transition from the decimal equivalent 3 to the decimal equivalent 4 for which the bits of weight 1 and 2 pass from 1 to 0 and the bit of weight 4 passes from 0 to 1.
To avoid this disadvantage, causes risks when the code is used for the representation of physical sizes with continuous variation, information of position for example, it is necessary to imagine codes for which the passage of one combination to following implies only the modification of a bit and one. Such codes are called " codes réfléchis".
Among those, the code of Gray is employed the most.
Plus infos on the Code of Gray are available on Internet. See on Google.
A considered code which is a code not balanced cannot be used for the arithmetic operations.
The hexadecimal representation or representation at base 16 is a condensed notation of the binary numbers. By noticing that 24 = 16, one can represent a binary byte using one of the 16 symbols of the hexadecimal system. In this system the first ten symbols are identical to those used in the decimal system:
0,1,2,3,4,5,6,7,8 and 9, and the last six correspond to the first letters of the alphabet Latin:
With, B, C, D, E and F, which are worth respectively:
10,11,12,13,14 and 15 bases 10 of them.
To represent into hexadecimal a binary number, it is enough to cut out it in group of four bits. Each bit of these groups having a weighting spreading out from 20 to 23, their nap provides the hexadecimal value of each group.
That is to say the binary number 1011100110101100 to convert into hexadecimal. Cutting in four-bit bytes of this number gives: 1011 1001 1010 1100
After weighting, the sum S, bit by bit of each group of four bits are:
The hexadecimal number corresponding to the binary number 1011100110101100 is: B9AC
To convert into binary a hexadecimal number, it is advisable to replace each hexadecimal symbol by its binary four-bit byte are equivalent.
The three binary four-bit bytes equivalent to the hexadecimal number 8D6 are:
The binary number corresponding to the hexadecimal number 8D6 is: 1000 1101 0110
As the hexadecimal representation the octal representation or representation at base 8 is a condensed notation of the binary numbers. By noticing that 2 ³ = 8, one can represent a binary triplet using one of the 8 symbols of the octal system. These eight symbols are identical to the first eight digits of the decimal system, that is to say: 0,1,2,3,4,5,6 and 7.
To represent into octal a binary number, it is enough to cut out it in group of three bits or triplet. Each bit of these groups having a weighting spreading out 20 with 2 ² their nap provides the octal value of each group.
That is to say the binary number 110101100 to convert into octal. Cutting in triplets of this number gives: 110.101.100
After weighting, the sum S, bit by bit of each group are:
The octal number corresponding to the binary number 110101100 is: 654
In the decimal binary representation coded with each decimal element a four-bit byte representative of its binary equivalent corresponds.
As follows:
The Decimal Coded Binary code (BCD) is a fixed-count code.
The weights of the representative bits are:
The method consists in breaking up the number into decreasing powers of 2 on the basis of the row highest, that is to say: 1010 (2) = 10 (10)
The method consists in breaking up the number into decreasing powers of 16 on the basis of the row highest, that is to say: BA8 (16) = 2984 (10)
One carries out successive divisions by 16 (see more in top).
The method consists in breaking up the number into decreasing powers of 8 on the basis of the row highest, that is to say:
777 (8) = 7 × 8 ² + 7 × 81 + 7 × 80 777 (8) = 511 (10)
One carries out successive divisions by 8 (see more in top).
Example
In the decimal number 425, figure 5 is in position of order 1 or row 0, figure 2 in position of order 2 or row 1 and quantifies it 4 in position of order 3 or row 2.
4 2 5 number
2 1 0 row
0 either 1, it is the row of the units,
Note
In the binary system one does not speak any more a unit, of ten or hundred but bit (contraction of English binary digit, which means binary row). One distinguishes thus bit 0, bit 1, bit 2, bit 3… the French equivalent of bit is character binary or eb , this term is employed relatively little.
Pure binary code
Note
A group of eight bits is called byte (in English byte off 8 bits ). A group of four bits is called four-bit byte (in English byte off 4 bits ).
Example
The binary number 110011 has as a value: 1 × 25 + L × 24 + 0 × 2 ³ + 0 × 2 ² + 1 × 21 + 1 × 20
Maybe into decimal: 32 + 16 + 0 + 0 + 2 + 1 = 51
Code of Gray (considered binary code)
Note
Hexadecimal representation of the binary numbers
Transcribing
Passage de la bases 2 at base 16
Example
Passage de la bases 16 at base 2
Example
Octal representation of the binary numbers
Decimal coded binary representation
Example
The decimal number 2001 (10) becomes in BCD: 0010 0000 0000 0001.
Conversely, number BCD 1001 0101 0001 0111 becomes into decimal 9517 .
Recapitulations
Summary table of conversion of the systems
Récapitualtif of the methods of conversion
Binary to decimal conversion
Decimal to binary conversion
One carries out successive divisions by 2 (see more in top).
Conversion hexadecimal - decimal
Conversion decimal - hexadecimal
Conversion octal - decimal
Conversion decimal - octal
Arithmetic operations bases 2 of them
The most frequent operations bases 2 of them are the addition and the subtraction. These operations are carried out same manner as the decimal operations by using tables of addition and subtraction much simpler.
Binary addition
The addition is the operation which consists in carrying out: initially, the Si sum of two binary digits of the same row such as Ai and Bi for example, then, the second time, a second amount enters the result previously obtained and the value of the carryforward or Ri-1 reserve, resulting from the downstream addition of row I - 1.
Example
To carry out the addition of two binary numbers has and B such as:
Decomposition of the procedure:
110 (6 into decimal)
011 (3 into decimal)
End result
The final result is thus: 1001 are 9 into decimal (6 + 3 = 9).
See too
External bonds
No external bond for the moment.
Random links: Archeozoology | Inference of the types | Segismundo Moret | Stanley G. Weinbaum | Lisburn | Drapeau_d'Ottawa