| |
||
| |
Created it, 06/09/09
Update it, 06/09/24
N° Visitors
1. 5. - METER A FOUR BITS
Let us take again the examination of the synchronous meter of module 16 seen in the preceding theory.
The circuit and the levels of tension on the four exits are represented figure 9.
The circuit has 16 states, it passes from the one to the other to each clock pulse. The states are distinguished between them by observing the level of tension present on each exit.
For example, state 3 is characterized by high levels of tension on the exits Q1 and Q2 and of the bottom grades on the exits Q3 and Q4.
Let us examine now with attention how the various exits for each state vary.
As you can observe it, the Q1 exit changes level with each clock pulse and more precisely its face of rise ; Q2 on the other hand changes all the two impulses, Q3 all the four and Q4 all the eight impulses.
The pulse repetition frequency of clock necessary to make change state a rocker is 1 for Q1, 2 for Q2, 4 for Q3, 8 for Q4, as the table of figure 10 summarizes it.
| Exit | Weight |
| Q1 | 1 |
| Q2 | 2 |
| Q3 | 4 |
| Q4 | 8 |
One can allot to each exit the binary digit 1 if it is on the level H and the binary digit 0 when it is on the level L as represented figure 11.
By comparing this table with that of figure 7, one sees that in the last column of the two tables one finds a numeration in binary code.
Moreover, the weight of each figure corresponds to the weight of each exit.
The meter thus uses the binary code. Its exits give a binary number which, translated into decimal code, directly indicates the state reached by the meter and thus the pulse repetition frequency of clock arrived until this moment.
In practice, the number of each state corresponds to the pulse repetition frequency of clock necessary to arrive in this state on the basis of state 0.
You can see that the exit furthest away from the entry, i.e. Q4 is that of greater weight, it corresponds to the most important bit of the binary number whose weight is 8. One calls this bit “the most significant bit” (figure 12) in summary M.S.B. (initial of the English words “Most Significant Bit”, i.e. “the most significant bit”).
The Q1 exit corresponds to the least important bit : its weight is 1, it is called “the least significant bit” in summary L.S.B. (initial of the English words Least Significant Bit).
1. 6. - DECODER FOR METERS
We saw that the majority of the meters count in binary code.
It is however useful, and even necessary, to decode the exits by sending the signals corresponding to earth phantom circuits which, without deteriorating transmitted information, transform the basic code into another, of more convenient exploitation.
One can, for example, with a circuit adapted decoder, to obtain directly instead of the four usual bits, 16 information, 1 or 0, available out of 16 different exits and to thus order the lighting of LED representing the decimal codes 0 to 15.
In figure 13, you can see the synoptic diagram of the system meter decimal binary-decoder.
From the circuit point of view, a decoder of this type is not very complex. At each exit of the meter corresponds a network of doors and reversers suitably chosen. For example for number 7, there will be the network of figure 14.
As you can notice it the level at the exit of AND is H only when Q1, Q2, Q3 are on the level H and Q4 on the level L. This occurs for the combination 01112 which into binary corresponds to 710.
Sometimes, it is not necessary that all the 16 exits are present. It is then enough to decode the state which only interests us. When one counted for example a certain number of events (coins on a travelling carpet, people in a coin…), it can be necessary to announce it and carry out an action for example (to stop the escalator or to start ventilation).
In this precise case, only one circuit prepared to decode the selected number is necessary.
1. 7. - THE
HEXADECIMAL
CODE
It is rather current to meet digital circuits using four bits.
The meter examined in the preceding paragraph operates on four bits. The registers, the comparators and other components function on 4, 8, 16 bits or other multiples of 4.
Inside the computers also, information is put in the form of a group of a succession of bits.
Currently, the most diffused microprocessors function on 8 bits. But of other microprocessors also use 16 or 32 bits. The large computers function with 32 bits for I.B.M. and 48 bits for Control Dated.
But in all the cases, we find successions of bits with 1 or 0 or 4 of 48.
In order to simplify these writings which would be tiresome by means of the binary code, one uses the hexadecimal code or codes at base 16.
With this code, one can replace a group of 4 bits by only one character.
In the preceding meter, 4 bits could represent 16 distinct states, i.e. we could count from 00002 to 11112.
The hexadecimal system, uses 16 signs to him: the first ten signs well-known 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 to which one added A for 10, B for 11, C for 12, D for 13, E for 14, F for 15. You can find this in the table of figure 15.
| Numbers | Decimal code | Binary code | Hexadecimal code |
| Zero | 0 | 0000 | 0 |
| One | 1 | 0001 | 1 |
| Two | 2 | 0010 | 2 |
| Three | 3 | 0011 | 3 |
| Four | 4 | 0100 | 4 |
| Five | 5 | 0101 | 5 |
| Six | 6 | 0110 | 6 |
| Seven | 7 | 0111 | 7 |
| Eight | 8 | 1000 | 8 |
| Last nines | 9 | 1001 | 9 |
| Ten | 10 | 1010 | A |
| Eleven | 11 | 1011 | B |
| Twelve | 12 | 1100 | C |
| Thirteen | 13 | 1101 | D |
| Fourteen | 14 | 1110 | E |
| Fifteen | 15 | 1111 | F |
As opposed to what one can think, the hexadecimal code does not represent a complication, but on the contrary a simplification because it makes it possible to transcribe in a shorter way the binary numbers generally rather long.
Indeed, it is possible to pass from the binary code to hexadecimal with a great facility.
Let us take for example the binary number 11010011 and transform it into a hexadecimal number.
The transformation can be obtained by gathering the bits from right to left four to four and by replacing each group by the hexadecimal figure correspondent who is in the last column on the right of figure 15 as indicated below :
The hexadecimal number thus obtained can be broken up as follows :
(D x 161) + (3 x 160) = (1310 x 1610) + (310 x 110) = 20810 + 310 = 21110
The reverse transformation is quite as simple: it is indeed enough to transform each hexadecimal figure into group of four bits corresponding as in the following example :
1. 8. - OTHER CODES 4 BITS
The binary notation which, as we saw, is adapted perfectly to the use in a digital system electronic, is however not very handy for the man, because it is accustomed with the decimal notation.
This difficulty is particularly felt during the loading or of the reading of the data provided to a system with numerical control or a calculator.
In fact, the data expressed with the pure binary system are not instantaneously comprehensible (by the man), the passage between the binary system and the decimal system being rather complicated.
To overcome these disadvantages, of the systems of binary digital coding of the decimal numbers were elaborate.
In these codes, with each decimal digit, one makes correspond a combination of binary digits.
To express the first ten Arab characters with binary numbers, it is advisable to have at least four digits. With these four binary digits, one can have the sixteen following combinations:
| 0000 | 0100 | 1000 | 1100 |
| 0001 | 0101 | 1001 | 1101 |
| 0010 | 0110 | 1010 | 1110 |
| 0011 | 0111 | 1011 | 1111 |
Since the bit configurations available are in quantity larger than the decimal characters, it is possible to choose several systems for the representation of the decimal digits. These various systems are called codes and are represented figure 16.
One distinguishes two kinds of codes: “balanced” codes and “not balanced” codes.
In general, the codes “are balanced” when there are numbers which indicate the “weight” of the binary digits of the corresponding groups.
By multiplying these numbers by the corresponding binary digits, one obtains decimal equivalence.
All the other codes in which one cannot locate the weight of the binary digits of the corresponding groups are called “not balanced” and are elaborate on a basis with mathematical development complexes or more simply are characterized by especially made tables.
Various codes were imagined, having various logical and arithmetic properties. The choice of one or other type of code depends exclusively on the applications for which it is intended.
In the table of figure 16, some of the most current codes are deferred.
1. 8. 1. - CODES B - C - D
A type of largely widespread code is the binary coded decimal code generally called “B.C.D.” for “Binary Coded Decimal”.
Usually, the binary code is adapted better for the digital circuits, but it is painful to especially translate a binary number into decimal when one has a great number of bits.
Code B.C.D., used in partnership with adapted decoders, on the other hand makes it possible to easily translate into binary expression the numbers decimal and vice versa.
Code B.C.D. is in the following way made up : each figure of the decimal number is coded in a pure binary number of four bits.
The figure 17-a shows coding B.C.D. of the decimal numbers from 11010 to 12510.
17-a. - Numbers 11010 to 12510 coded in B.C.D.
| Decimal code | Code BCD | Code BCD | Code BCD |
| 110 | 0001 | 0001 | 0000 |
| 111 | 0001 | 0001 | 0001 |
| 112 | 0001 | 0001 | 0010 |
| 113 | 0001 | 0001 | 0011 |
| 114 | 0001 | 0001 | 0100 |
| 115 | 0001 | 0001 | 0101 |
| 116 | 0001 | 0001 | 0110 |
| 117 | 0001 | 0001 | 0111 |
| 118 | 0001 | 0001 | 1000 |
| 119 | 0001 | 0001 | 1001 |
| 120 | 0001 | 0010 | 0000 |
| 121 | 0001 | 0010 | 0001 |
| 122 | 0001 | 0010 | 0010 |
| 123 | 0001 | 0010 | 0011 |
| 124 | 0001 | 0010 | 0100 |
| 125 | 0001 | 0010 | 0101 |
As you can note it, code B.C.D. is a synthesis of the decimal code and binary code.
Within each group of 4 bits, the binary code remains valid and we find weights 1, 2, 4, 8. On the other hand, for the weight of the groups the ones compared to the others, weighting is that of the decimal system as the example of the figure 17-b indicates it.
The advantage offered by the method of coding B.C.D. is to allow the use of digital circuits which work in binary code while keeping a decimal weighting for each figure expressed into binary.
For this reason, all the pocket calculators use code B.C.D.
There is however a disadvantage with this system of coding, indeed, this one requires a number of bits higher than that necessary in binary code.
For example 402210 will be written :
into binary : 1111 1011 01102, is 12 signs.
in B.C.D.: 0100 0000 0010 0010BCD, is 16 signs.
In the major part of the cases, it becomes too expensive to use this code, indeed, each additional bit requires additional components.
1. 8. 2. - AIKEN CODE
It is a “balanced” code 2421. For the decimal digits 0, 1, 2, 3, 4, it agrees with code B.C.D., while for the decimal numbers 5, 6, 7, 8, 9, it agrees with numbers 11, 12, 13, 14, 15 of the pure binary code.
This code with the property to be car-complementary, which makes it possible to obtain the complement of 9 the codified numbers, by replacing the 0 by 1 simply and the 1 by 0.
Let us take for example the decimal digit 2 codified 0010, by reversing the binary digit 0010, one obtains 1101 groups corresponding to the figure 7 which is the 9 complement of 2. This property is useful in the calculation of the subtraction.
For example, number 63 codes $aiken of it is written of this manner: 1100 0011.
1. 8. 3. - CODE + 3
This code is also called Stibiz of the name of its inventor and it is a code “not balanced”.
It uses the combinations of four digits of normal binary ranging between the decimal numbers 3 and 12.
Each number is obtained by adding 3 to each figure of the decimal number and by coding it in B.C.D.
In this system the combinations 0000 and 1111 do not appear. For example, number 63 codes + 3 of them is written 1001 0110.
This code, also not balanced to him, with the property to present in the passage of a number at the following, the variation of only one “bit”, i.e. of only one figure of the binary group. It presents a weaker risk of risks into sequential.
In this code, the decimal number 63 is written 0101 0010. Moreover, described codes, there is the different one having varied properties but which will not be examined because they leave the framework of the lessons present in the whole of the courses.
| Following
page |
![]()