Site Visited 498534 times Page Visited 25 times You are in : Etantonio/EN/Universita/1anno/FondamentiInformatica/Sysop/     

It codifies binary

1) Transform in decimates them n° binary the 101101:

It is necessary to multiply the lsb for 20 to add it to the following figures multiplied for 2p with p = position in the number therefore:

101100(2) = 1*22 1*23 1*25 = 44(10)

 

2) Transform in railroad the n° decimates them 44:

It is necessary to divide the n° for 2 sin when the turning out quotient is greater of 2, to such point will have created a sequence of 0 and 1 that they are the single possible rests of the division for 2 and taking them so that 1° the rest is less meaningful it obtains n° the binary correspondent, in our case:

Dividend

Quotient

Rest

44

22

0

22

11

0

11

5

1

5

2

1

2

1

0

1

0

1

The binary correspondent n° is therefore 101100(2)

 

3) How many bits are necessary in order to codify in railroad n° the 746:

the n° of bits necessary is n = [Log 2 746 ] = 10 where [ ] is to indicate entire the immediately successive one.

 

4) As it is passed from railroad 101100 to the ottale correspondent n°:

It is necessary to consider the bit to leave from less meaningful grouping them in 3 groups of 3 bits and to associate to these bits the correspondent ottale code, in our case therefore:

101 100

5 4

Therefore n° the ottale correspondent is 54(8) .

 

5) As he passes himself from railroad 101100 to the exadecimal correspondent n°:

It is necessary to consider the bit to leave from less meaningful grouping them in 4 groups of 4 bits and to associate to these bits the correspondent exadecimal code, in our case therefore:

0010 1100

2 C

Therefore n° the exadecimal correspondent is 2C(16) .

 

6) Describe the logical tables of the addition and the binary multiplication:

Addizione Multiplication

0 0 = 0 0 * 0 = 0

1 0 = 1 1 * 0 = 0

0 1 = 1 0 * 1 = 0

1 1 = 10 1 * 1 = 1

 

7) As one is carried out binary multiplication:

As a multiplication decimates them that is placing the molteplicandi under to the other and carrying out the product of 1° a bit of 2° the number for 1° the number, then it is gone to head and scale of a place to sx and makes the same multiplication stavolta for 2° the bit of 2° the number and therefore via. The result will occupy a n° of double bit regarding the moltiplicandi.

1011 *

101 =

1011

0000

1011

110111

The result of the multiplication is therefore 110111(2) .

 

8) Describe the modalities of codifies of the numbers denied to you:

Ç$⪠the studied modality was to associate more to the bit on the left the information on the sign of the n° but this method has the problem of double quantity 0, present problem also in the case of codifies in complement to 1 while it is absent in the case of codifies in complement to 2.

 

9) Encode in complement to 1 the n° decimates them 10110:

It is simply necessary to replace the 1 with 0 and viceversa therefore 01001 is obtained:

 

10) On which principle is based it codifies it in complement to 2:

When it is embezzled to n° a second n° obtains an obtainable value also adding to 1° the number the complement to 10 del 2° and neglecting the eventual bringing back, therefore 9 - 3 = 6 7 but also 9 7 = 16 being exactly the complement to 10 of 3. Analogous result is worth subsequently for the binary numbers whose representation in complement to 2 is obtained before gaining the representation in complement to 1 and adding 1.

n° binary 00001011

complement to 1 11110100

complement to 2 11110101

 

11) As the real numbers can be represented:

A possible method is that one in fixed virgola in which they have to disposition x bit for the entire part and y bit for the part decimates them. An other method is that one in mobile virgola in which the virgola is moved so that to its right there is the 1ª number meaningful and this is obtained then multiplying n° for one the power of the 2. It is defined:

Mantissa ž the bits to right of the virgola

Caratteristica ž the exponent which it must be elevated the 2.

The format of a real number is therefore:

1

1

0

1

1

1

0

1

0

1

1

1

0

1

0

0

0

1

0

0

1

1

1

1

1

1

0

0

1

0

1

segno caratteristica sign mantissa

characteristic or esponente mantissa

This representation is said in simple precision, the representation in double precision instead occupies a total of 64 bits, 54 bits for the mantissa (comprised the sign) and 10 bits for the characteristic (comprised the sign).

 

12) Which it is the effect of instruction TRUNC (n° real):

It gives back the entire solo the n° real cutting via the part decimates them without some interest to rounding problems.

TRUNC(7,6) = 7 e TRUNC(-7,1) = -7

 

13) Which it is the effect of instruction ROUND (n° real):

It gives back entire the next one n° real therefore ROUND(7,6) = 8 to the e ROUND(-7,1) = -7

 

14) How much is worth in codifies BCD n° the 123(10) :

In Binary Coded Decimal to every figure it decimates them assigns the binary correspondent n°, codifies it correspondent therefore is constituted sure from a multiple of 4 bits, in our case:

1 2 3

0001 0010 0011

It codifies binary is therefore: 000100100011. It is a waste of bits but it is the ideal for the display.

 

15) Describe the format of code ASCII:

It is constituted from 8 bits of which 8 dedicates you to in particular codifies of the symbols and 1 bit destined to the parity control:

Uneven parity ž if n° di bit 1 of the character is equal, comes added a bit 1 in order to render it uneven.

Parity pari ž if n° di bit 1 of the character is uneven, comes added a bit 1 in order to render it equal.

 

16) Describe the Gray code:

It is a code that is born in order to make yes that from it codifies of a n° to codifies of the n° successive you vary only a bit, this concurs to avoid be not effective in the circuits where the times of commutation are not equal for all the doors.