Вы находитесь на странице: 1из 88

.. , ..

.. , ..



1

,


., - . ..

2005

681.3
32.973.20273
-65
:
(. . .. ..);
., . . .. ( )
: .., ..
-65 . . 1.:
/ .. , .. . 2- ., . . : -, 2005. 87 .
ISBN 5-321-00516-8


, , , , .

230100
. 11, . 30.

" ".

681.3
32.973.20273

ISBN 5-321-00516-8


-, 2005
(. .)

1. ..... 5
1.1. .................................................................................................5
1.2. ............................................................................................7
1.3. ..............................................................................8
1.4. ()
....................................................................................................11
1.5. ...............................................................................................14
1.6. ..........................................................17
1.6.1. ........................................................................................................19
1.6.2. ................................................................................................20
1.7. ........................................................................................................20
...........................................................................21

2. .......................................... 22
2.1. .......................................................22
2.2. ................................................................22
2.2.1. ....................23
2.2.2. ...................24
2.2.3. - .................................26
2.3. ......................................................26
2.4. ..........................................27
2.5. .................................................................................28
2.5.1. ..................................................................................................28
2.5.2. ................................................................................................28
2.5.3. ...............................................................................................29
2.5.4. .....................................................................................................30
2.6. , .....................................31
2.6.1. ...............................................................................................31
2.6.2. ..........................................................................................32
2.6.3. ..........................................................................33
2.6.4. ...................35
2.6.5. ...................................36
2.6.6. ..................................................37
2.6.7. ...................................................................................................37
2.6.8. .................................................................38
2.6.9. .............................................39
2.7. . .....................................................................40
2.7.1. ...................................................40
2.7.2. ............................................................41
2.7.3. () ................................................................48
2.7.4. .......................................................................................49
2.7.5. .......................................................50
2.7.6. .........................................51
3

2.8. ............................................................................52
2.8.1. - .......................................52
2.8.2. - ..................56
2.8.3. - .................58
2.8.4. - ........................59
2.9. ...................................................................59
2.10. - .......................60
2.11. ..................................................................61
...........................................................................62
2 .....................................................................63
1. ......................................................................63
2. ...........................................................................................................................63
( 2) ..................66

3. ...... 72
3.1. ()............................................................75
3.2. .........................................................................77
3.2.1. .........................................................................78
3.2.2. ...................................................80
...........................................................................85
3 .....................................................................85

1.
. , . XVII
, . , ,
.
, . ,
, .
30- , , . 30-
, .
(0, ,
, ,
" ".
50- , , ,
, " ",
, : ,
, , , .. ,
,
, :
- (.. );
- (.. );
- (.. , ).
" " , , .

. , ( , , ), .
1.1.
,
.
, , ,
, .
, , . , 5

( ),
, :

;
;
;
.
, , .. , , , - .
() ().

( ), , . , ,

, .. .
, , .
, , . , . , , . , ,
. , ,
.

, .. , .
,
.
,
. , .
, .
, .
()
. . . . 70-
, ,
.

1.2.
, , .
.


. ,
.
( 1500 ).
1646 (). . 1646 , . 1673 , . .
.
( ) .
1820 ( )
. ,
,
.
1834 . ,
. . . , "" , 100 .
:
("" 1000 50 ), (""), , .

(1804),
. , . , . ,
.
( 1871 ), .
(50- )
. .
XIX XX -
. ,
1888 . ,
- . 1898 , . : 1913 , ; 1921
, , .
7


30- 40- . 1936 -1937 . () . 1941 ( ). .
.
. ,
, .. .
1937 . () . 1944 IBM "-1". 1947
"-2". 16000 .
, "" .
,
, . , , ..
,
, . , (
1918 -). ,
. . .
1946 ""
. 18000 1500 . ( )
.
, . .
"" .
1950 . 1949
"", . .
"" "" . 50-
, , .
,
. , 1952 .
.

.
1.3.
.
,
.
, 8

. (
) ( ).
,
, .
, ( ), , . , ,
. , , ( ),
,
.
, , , .
, .. ,
, . 1.1 ( , ).

()

()

(,

())

()

()

. 1.1.

,
.
, .. ,
.
9

, ,
, , .
, (),
() (), .
, , , , , .. ,
. , . . () , , . . .
.

.
.
() , , , , , , , . , ,
.
, .. .

. (,
) - , , , ,
.. .
. ,
() .
, , , , ..
. (). :
,
.
" " . (,
, IX .)
10

, . .
, . , , . ,
, (
).

, .
(
.).
. , , . ,
. ,

.
, . , ,
.
, . , .
1.4. ()

,
, , ,
..

(hard & soft).
.
,
. .
. , , .
, , . , . , , .
,
, ,
.
, .
11

, .
, . ,
, ,
() .
() , , . . 1.2 .
() , , ,
, .

BIOS



. 1.2.

12

, .
,
.. , .
, , , , ..
. , BIOS (Basic Input / Output System /).
,
. ( , , .)
, . , . .
- , ( ,
, ..).
- ,
(, , ..).
.
. .
.
, (..
). , .. , ,
. (, , ,
.)
,
, .. ( ) () .
, , .
- . , .

, (-,
-), (
, , .).
, , .
.
13

,
, .
() .
, , , . , ,
, ,
.
1.5.
: , .
50 ,
.
,
"" "", 1949-1950 . 50- ,
. ,
.
.
(1950-1960 .)
,
, , , .
.
- ,
.

, ,
, , ..
. 10-20 1 (1024 ).
.
(1960-1965 .)

. -
.
, .
( 500 /) (16-32 ). , , . (, , ) .
, . ( , ).
,
: ,
, , ..
14


.
, , , () .
, /,
. .
, . .
( ). .
(1965-1970 .)
, . . , , () .
, ,
.
( ),. , .
, , .
, . , ,
.. 70- . :
-
, ;
- , - , ..
( 1970 .)
, .
. . . . , , .
, , .
15

, , , .
70- .
( 1968 . Intel , ).
, , .. .
, , , . , , .
70-
, , , / , (
) , ( ).
, , .
, ,
, , ( ), , , .. .
1976 . Apple Comp (
), "".
, ,

. . 1985 ,
200106 10106 .
, -.
, ..
, .
4-
, ,
.
/ .
4- "-2" 100106 / -2000, 64 , . 200106 /. 16

(
). , , , , , ..
, , , " ".

,
.
1979
, JIPDEC. 1981 . JIPDEC
,
- -
1991 . .
, . JIPDEC
, " " (1981 .), " ".
, ,
,
.
, , . ,
, .
, . , , , .
, . , , , . ,
,
, , , . , ,
, , , , ,
..
.

(), 70- .
1.6.
,
, :
-
,
( ) (
17

) ,
;
- - , .
() . .
, , , , ,
.. . ,
, . .
, , (-) , . , ,
( ), .
, . , , -
, , .
(mainframe),

.
- , . ,
, , . (3-4 ) ,
. 80- , .
( IBM) , , ,
.
- , 70 , , ,
(, ), IBM 360/370. 200 / ( 1030)
5000 / ( 1065) .

"", "" ,
. . 1.3.
(),
. ,
().
.
18


/, . () , .
.

""

""

. - ;
;
-
. 1.3.

1.6.1.
, , , .
, -, - .
- , ,
.
( 1-2 ).
, . , ,
. , - ""
, .
- , ( ,
.).

. .
, - ,
19

: .
,
, .
- , , ( , ..), , () .
: , , , ,
.
, , .
1.6.2.
,
, .
, , .
.
,
(IBM
360/370). 1, 2, -205, "", -2000, ..
. ,
, .
.
1.7.
,
60- , , , .
(8-16 32-64
),
( ), ,
.
, , , , , . , , ,
,
.
, -

, , - .. - , 70- , , .
20

. 1.4.

()

. 1.4.
-
-.
( ),
, . , . .
,
.

200-800 ,
. , , ,
(, ).
, . - - , ,
. , - . .

1. , .
2. .
3. .
4. ?
5. .
6. .
7.
?
21

2.
2.1.
, . .
.

. ,
, , .
.:
,
.
S , , . ,
S:
X = r S r + r 1S r 1 + ... + 1S 1 + 0 S 0 + 1S 1 + 2 S 2 + ... .

S ,
. .
X = r r 1... 1 0 1 2 ...
, (),
, .
, S.
.
( S = 10) 6321.564.
:

103
6

102
3

101
2

100
1

10-1
5

10-2
6

10-3
4

,
. , , , . : 1101(2),
369(10), BF(16) ..
2.2.
S = 2, ..
: 0 1. .
( 3,3
) , .
,

, .
.
:
X = r 2 r + r 1 2 r 1 + ... + 1 21 + 0 2 0 + 1 2 1 + 2 2 2 + ... , i = 0,1 .

2 1/2.
22

.
101101(2).
32 16

4
3

2
2

2
0

1
1

2 0 = 45 (10 ) ,
1

.. 1 2 5 + 0 2 4 + 1 2 3 + 1 2 2 + 0 21 + 1 2 0 = 45 (10 ) .
,
. (2), .
: 1/2, 1/22, 1/23, 1/24, 1/25 1/2, 1/4, 1/8, 1/16.
: 2-1 = 0.5, 2-2 = 0.25, 2-3 = 0.125, 2-4 = 0,0625.
,
1101101.10111.
, , .
. () ,
().
. , .
2.2.1.
, .
.
11001100(2) .
1 1 0 0 1 1 0 0

27

25

24

22

20

0
0
4
8
0
0
64
128

204(10)

101.011(2)
:
1 0 1 . 0 1 1

22

21

2-1

2-2

2-3

0.125
0.25
0
1
0
4
5.375(10)

,
.

23

2.2.2.
, ,
.
(S = 2).
, , ,
. ( )
.
.
.
10(10) .

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

.. 10(10)=1010(2)

, , , . ,
. , 10(10) :
10 2
10(10)=1010(2)
10 5 2
0 4 2 2
1 2 12
0 00
1

.
57(10) .
57 2
57(10)=111001(2)
56 28 2
1 28 14 2
0 14 7 2
0 6 3 2
1 2 1 2
1 0 0
1

( ) . .
.
0.375(10) .
1. S = 2: 2*0.375 = 0.75.
2. , 0. , 1. 0.75<1,
=0.

24

3. 2. , . : 2*0.75=1.5.
4. 1.5>1, , 1.5, .. 0.5: 2*0.5=1.
5. , 1 ( ), .
, 0.375(10) = 0.011(2).
S = 2 ,
,
.
.
0.34375(10) .
2 * 0.34375 = 0.6875 0 ()
2 * 0.6875 = 1.375
2 * 0.375 = 0.75
2 * 0.75 = 1.5
2 * 0.5 = 1.0
2*0

1
0
1
1
0

, 0.34375(10) = 0.01011(2).
.
0.3(10) .
2 * 0.3 = 0.6 0 ()
2 * 0.6 = 1.2 1
2 * 0. 2 = 0. 4 0
2 * 0.4 = 0.8 0
2 * 0.8 = 1.6 1
2 * 0.6 = 1.2 1
2 * 0. 2 = 0. 4 0
2 * 0.4 = 0.8 0

, , .. 0.3(10) = 0.01001100(2).
, ,

.
, (.. , , ). ,

, .
25

2.2.3. -
S = 10, , . .
, - . .
, ,
. ,
, .
-
.
.
572.38(10) - .
5

2.

8 (10 ) = 010101110010.00111000( 210 )

0101 0111 0010 0011 1000

: - ( ) ( ),
, .
.
- 10010.010101(2-10) .

0001 0010 . 0101 0100 ( 2 10 ) = 12 .54 (10 )


1
2
5
4
-
, .
2.3.
, ..
S = 8. :

X = r 8 r + r 1 8 r 1 + ... + 1 81 + 0 8 0 + 1 8 1 + 2 8 2 + ... ,
j = 0,7 .
.
(,
, ). ,
0-255, 0-99999999 ( 27 ).
8=23, . ( ) (
) () () .
.
26

.
10101011111101(2) .
010 101 011 111 101( 2 ) = 25375 ( 8 )
2
5
3
7
5

.
1011.0101(2) .
001 011. 010 100 (2 )
1

= 13.24 (8 )


().
2.4.
S = 16. :

X = r 16 r + r 116 r 1 + ... + 1161 + 0 16 0 + 116 1 + 2 16 2 + ... ,


i = 0,9, A, B,C, D, E, F .
A(16 ) = 10(10 )
D(16 ) = 13(10 )

B(16 ) = 11(10)
E(16 ) = 14(10 )

C(16) = 12(10)
F(16 ) = 15(10) .

, , 4- , .. , 16=24. .
.

.
10101011111101(2) .
0010 1010 1111 1101( 2 ) = 2 AED(16 )
A
E
D
2

.
11101.01111(2) .
0001 1101. 0111 1000 ( 2 ) = 1D.78 (16 )
D
1
7
8
,
, , .
,
,
.
.
, ,
,
27

. , 4, 8, 16, 32 64 , .. , 4.
, 3 , 12
( PDP-8 DEC).
2.5.
.

0+0 =0
0 +1= 1

00 =0
1 0 = 0

0*0 = 0
1* 0 = 0

1+ 0 = 1
1 + 1 = 10

1 1 = 0
10 1 = 1

0 *1= 0
1* 1 = 1

2.5.1.
,
() .
, . , , .
.
.
( 1 ).
()
1
2

11
099(10)
095(10)
194(10)

1111111
01100011(2)
01011111(2)
11000010(2)

,
.

2.5.2.
. , , . , 1 . .
.
.
( 1 ).
()

1
109(10)
049(10)
060(10)

01100000
01101101(2)
00110001(2)
00111100(2)
28

2.5.3.
, .
, . . , 0 ( 0), ,
( 1).
. , , ( ). ,
.
.
17(10)*12(10) .
17 (10)=00010001 (2); 12 (10)=00001100 (2)
00010001
* 00001100
- 2
+ 10001
10001
- 3
11001100 = 204 (10)

, .
.
Z = X * Y = sign(Z) * X * Y ,
+, sign(X) = sign(Y)
sign(Z) =
, sign(X) sign(Y) .

,
, . , . , .. ,
.. (..
, ). , ( ),
.
X Y.

: ( 29

) ( ).

.
X*Y=1101(2)*1011(2)=13(10)*11(10)= 143(10).
Pi i- .
1. :
Y=

1011
1101
11010
0000
11010
110100
+
1101
1000001
10000010
+
1101
+

10001111

P4
1
P3
P4 + P3
1
P2
P4+P3+P2
1
P1
P4+P3+P2+P1 () = 143(10)

2. :
Y=

1011
1101
+

01101
1101
100111

P1
1
P2
P1 + P2

100111 1
0000
P3
100111 P1+P2+P3

0100111 1
1101
P4
10001111 P1+P2+P3+P4 ()=143(10)

2.5.4.
, , , ,
, . , .
.
204(10) /12(10) .
204(10)=11001100(2); 12(10)=1100(2)
11001100 1100
-1100
10001, .. 10001(2)=17(10)
01
0
011
0
110
0
1100
1100
0

30

, ,
,
. ,
,
.

.
1100.011(2)/10.01(2).

- 1100011 10010
10010
101.1
-11011
10010
- 10010
10010
0

2.6. ,

.
( ) , .
, .
, .
. ,
. , . , .

, , ..
( ) .

2.6.1.
, . , 0,
, 1.
, ().
.
28(10). 0011100(2) (
7 ). , . 2.1.
+28(10)=00011100(2)
0

28(10)=10011100(2)
1

. 2.1. :
;

31

, , : , .
. , .
, .

2.6.2.
(), , , , .
, .
0, 1.
. 2.2 .
+28(10)=00011100(2)
0

28(10)=11100011(2)
1 .

. 2.2. :
;
, .
, ,
-. . ,
: +0 -0, .. ( ) (+0) = 000...0, ( ): (-0) = 111...1.
,
.
( -=+(-)).
:

, ;
( ) .

.
-3(10) -2(10).

-3(10) 1 011
+
+
-2(10) 1 010

.
.


1 100
+
1 101
11 001 =1010 1, ,
.


: 1101 -5(10).

32

.
7(10)-3(10).

7(10)
0 111 .
+
+
-3(10) 1 011 .

0 111
+
1 100
10 011 =0100
0, ,

+4(10)
.

,
.

2.6.3.
() .
(), () 1. (), , . . 2.3 .
(-)
(
)

+1

(-)

+1

(
)

+1

(-)

+1

(-)
. 2.3.
.
-5(10) ( ).

1 101 (-)
1 010 (-)
+
1
1 011 (-)

1 011 (-)
1 100 (-)
+
1
1 101 (-)

.
-5(10) ( ).

0 101 .
1 010 (-)
+
1
1 011 (-)

1 011 (-)
0 100
+
1
0 101 .

( : +0 -0),
-0 .
33


-2k-1 +2k-1-1, k
, . , -128 +127 0
255 ( ). .2.1
4- 0000 1111
. , 4
-8 +7 0 +15.
.
2.1

4 -



0000
+0
0
0001
+1
1
....

...
...
0110
+6
6
0111
+7
7
1000
-8
8
1001
-7
9
1010
-6
10
....

...
...
1110
-2
14
1111
-1
15
.
. , . , (0 1, 1 0).
.
-44(10) (10101100 (2)) .
1

0101

100

1 0101100

1010

100

1 1010011
+
1
1 1010100

0101

100

.
-44.

0 0101

100

1 1010

100


(-44)

, .
34

2.6.4.

(), () () . . 2.4.

0 ..
0 ..
0 ..

1 ..
1 ..
1
+1

. 2.4. :
;
. , ( ) ,
, .
. ( ) .

.

. , ,
.
:
: ;
: .
, .

.
58-23.
58(10) 0011 1010(2)
-28(10) 1001 0111(2)
1110 1001(2)
0011 1010
1110 1001
1 0010 0011(2)

-
-
-

- (
)
.
.
() = 35(10)

.
26-34.
26(10) 0001 1010(2)
-34(10) 1010 0010(2)
1101 1110(2)

0001 1010
1101 1110
1111
1000(2)
0

-
-
-

. ,
1.

35

. , :
1111 1000(2)

()

1000 0111 ,
+
1
1000 1000(2)
() = - 8(10)

.
-5-1.
-5(10) 1101 () 1011 ()
-1(10) 1001 () 1111 ()
1011
+
1111
1 1010 (2)

.
,
1.

, :
1010(2)

()

1101
( )
+
1
1110(2) () = - 6(10)

2.6.5.
,
, , .. , , . , ,
.

( )

( ).
,
.
, , .
. ,
, -4 +3. 1 2 .
1. .
2+1=3
2(10) 010(2)
1(10) 001(2)

010(2)
001(2)
0 011(2)
+

= 3(10)

, .
, 3.

36

2. .
-3-1=-4
-3(10) 111(2) 101(2)
-1(10) 101(2) 111(2)

101(2)
+111
(2)
1 100(2)
1

=-4(10)


, .
, -4.
3. .
( ).
2+2=4
2(10) 010(2)
2(10) 010(2)

010(2)
+010
(2)
0 100(2)

= ?(10)

, , .. , .
4 . -4.
4. .
( ).
-3-2=-5
-3(10) 111(2) 101(2)
-2(10) 010(2) 110(2)

101(2)
+110
(2)
1 011(2)

=?(10)

-5 3- .
+3.
, . ,
. , .

2.6.6.
,
. 5.4. . " ". ""
. ,
. ,
.
2.6.7.
, . 2.5.

.
37

. 2.5.

(. 2.6).
( N- ).

N-1 N-2 N-3

N-1
N-2
N-3
-2
2
2

...

...

. 2.6. N

.
1110 .
1 1 1 0(2) () = -8+4+2 = -2(10)

-23 22 21 20

, :
1 110

1 001
+
1
1 010

, .. 1010(2) = -(0+21+0) = -2(10)

.
101100 .
101100(2) () = -25+23+22 = -32+8+4 = -20(10)
:
1 01100

1 10011
+
1
1 10100
, ..

110100(2)=-(24+22)=-20(10)

2.6.8.
, ,
: 00,
11. (
) . 38

00 11, ,
01 10 . . 2.6.5.
2+1=3
0010
+ 0001
0011

2+2=4
+

0010
0010
0110

-3 - 1 = -4
1101
+ 1111
1100

-3 - 2 = -5
+

1101
1110
1011

, , , .
.

2.6.9.
, , - ,
(1-2 ). , 1 . -128 127. , .
(16 ) -32768 32767.
. (1 23 ).
-8388608 8388607, .. .


. .
. ,
. .
,
. ,
, . , . .
,

. ,
(
, ).
39

2.7. .

N . N- .
.
. , ,
.
:
(),
();
() (), :
- ( |X| < 1);
- ().

2.7.1.
, . , ,
(
). , .

. , , , IBM-360/370
, .
,
32- , IBM-360 (. 2.7). 32- , , .
30

2 2

29

...

2 2

...

30 31

1 2

. 2.7.
(32 ),
(16 ).
.
.
.
- (16 ),
(. 2.8),
, .
, - (16 8 ), (32
16 ).
(8 ) . , ,
, (1,2,4 ).
40

14

2 2

13

15 14 13
6

2 2

7 6 5

...

2 2

...

1 0

...

2 2

...

1 0

. 2.8. -

(
, .. ). N , N-1 ( ).
, ,
N-2

|X|max = 1 1 1 1 . . . 1
+
1
N-1
N-1
N-1 1 0 0 0 0 . . . 0 =2 ; |X|max +1 = 2

, |X|max = 2N-1 -1 0 |X| 2N-1 - 1.


-2N-1.
(N ) .
N- :
-2N-1X 2N-1-1 .
. 2.2 8-, 16- 32 .
N
Xmax
Xmin

8
127
-128

16
32767
-32768

2.2
32
2147483647
- 2147483648


, ,
, .
. , , ,
. .
2.7.2.
, . -

41

, . , . , ( ).
:
X = Sp*q;

|q|<1,

q ( ),
p ( ),
S ,
Sp .
q p S . .
, X. , (, .).
p
, .
p R=2k, k , . P=P+R .
, p.

. , q 1>|q|1/S, ..
S- ,
. , ,
0.00726*10-3 , 0.726*10-5 .
.
, . . 2.9
- .

...

N-1
P
1

0
q

k+1

N-k-2

. 2.9. -
r S- .
:
- r ;
- P r ;
- r .
, .
.
.
:
1

001*0.010=(2 *0.25)(10)=0.5(10)
p
q
:

42

p=p-1;

q - 1

000*0.100=(20*0.50)(10)=0.5(10)
p q

.
.
:
3

011*0.011=(2 *0.375)(10)=3(10)
p
q

:
p=p-1;

q - 1

010*0.110=(22*0.750)(10)=3(10)
p q

, ,
.
:
- ;
- P .
S, 2, .. S=2W.
, q ,
W S=2W. , , S = 2, 16.
S>2 :
- ;
- ,
( S=16 4 ).
.
(S=16):

X=1000 * 0.0000 0101 = 168*5/162=5*166(10)


0
5(10)
8(10)
: 1/16 1/162

. q , .. 4 , P 1.

X=0111 * 0.0101 = 167*5/16=5*166(10)


5(10)
7(10)
: 1/16
,
S , P. q.
q ,
. S, 2,
q.
.
43

, ,
,
q. 32- , (S=16)
(S=2) .
S=16 . 2.10.

P
17

d1
d2
811 1215

...

d5
d6
2427 2831

d , 4
. 2.10. S=16

q 24 . N 32 . (64 ) (128 ).
P 7 ( ).
, k (k = 6). P 0 2k-1 0 63, = (-64) (+63).

PCM = P + R = 2 k 1 + 2 k = 2 k +1 1 .
, S=16 P = 0 127.
, .
S=2 . 2.11.

31

P
30...23 22

q (23 )
...

. 2.11. S=2

N 32 . , N = 64 . 8
. ,
P = 0...255 P = -128...+127 .
,
q , , .,
q 24
( ) 56 ( ).
.
S ,
P.
(S=2):
(k=7) Xmax=2127 1038 .
44

(S=16):
(k=6) Xmax=1663 1076 .
S
. S=16, S=2 q 24 :
S=2: 24 ,
;
S=16: (N = 32)
, .. q ,
.
, .
8- :
0.0001 0101 1111
0.1010 1111 1

S=16
S=2

S=16 , d1 .
. S=2
.
S=16 .

( ).
.
ANSI/IEEE 754-1985 Standard for Binary Floating-Point Arithmetic.
: (single 32 )
(double 64 ). IEEE 754
, (79 ).
, , , , .

: 23- f, 8- e, s (. . 2.12).
s

e[30:23]
31 30 . . . 23 22

f[22:0]
...

2.12.

. 2.3
.
2.3

s
e-127
(-1) 2
1.f
0 < e < 255
( )
(-1)s 2-126 0.f
e= 0; f 0 ( , )
( )
(-1)s 0.0 ( )
e= 0; f = 0 ( )
INF ( )
e= 255; f = 0 ( )
e= 255; f 0 ( , ) NaN (Not-a-Number)
( ) ,
. 23- 24 .
45


: 53- f, 11 e, s. 32 , . 2.13. x86
, , , SPARC
.
s

e[52:62]
63 62 . . . 52 51

f[51:32]
...

f[31:0]
...

31

32

. 2.13.

. 2.4
.
2.4

0 < e < 2047
e = 0; f 0
e = 0; f = 0
s = 0; e = 2047; f = 0
s = 1; e = 2047; f = 0
e = 2047; f 0

(-1)s 2e-1023 1.f ( )


(-1)s 2-1022 0.f ( )
(-1)s 0.0 ( )
+INF ( )
-INF ( )
NaN (Not-a-Number)

( ) ,
. 53- 54 .
(SPARC )
: 112- f,
15- e, s.
32- , . 2.14. SPARC
.
s

e[126:112]

f[111:96]
...

127 126 . . . 112 111

96

95

f[95:64]
...

64

63

f[63:32]
...

32

31

f[31:0]
...

. 2.14. (SPARC )

. 2.5

SPARC.

46

2.5

0 < e < 32767
e = 0; f 0
e = 0; f = 0
s = 0; e = 32767; f = 0
s = 1; e = 32767; f = 0
e = 32767; f 0

(-1) 2
1.f ( )
s
-16382
0.f ( )
(-1) 2
s
(-1) 0.0 ( )
+INF ( )
-INF ( )
NaN (Not-a-Number)
s

e-16383

(86 )
4- : 63- f,
j, 15- e, s.
86 8- . UNIX System V Application Binary Interface Intel 386
Processor Supplement (Intel ABI) , 32- , 16
, . 2.15.
95

...
j

63 62

e[78:64]

80 79 78

...

f[62:32]
...

64

32

f[31:0]
31
0
...
. 2.15. (86 )
. 2.6
86.

2.6

j = 0; 0 < e < 32767
j = 1; 0 < e < 32767
j = 0; e = 0; f 0
j

= 1; e = 0

j = 0; e = 0; f = 0
j = 1; s = 0; e = 32767; f = 0
j = 1; s = 1; e = 32767; f = 0
j = 1; e = 32767; f 0


(-1)s 2e-16383 1.f ( )
(-1)s 2-16382 0.f ( )
(-1)s 2-16382 0.f (
)
(-1)s 0.0 ( )
+INF ( )
-INF ( )
quiet signaling NaN

IBM S/360 (HF) ESA/390 ( S/390)


BFP, IEEE 754. 3 ,
87 .
BFP ESA/390 , 1998 .
12 FR ( FR 16). -

47

, .
8 ,
, 4 HFP BFP.
HFP- 26 , BFP-. , ,
.
NEC SX-4 ( 1995 ) 32-, 64-.
IEEE 754 ( 32-, 64- ). , SX-4 128- , PVP-
Cray IBM. SX-4
, .
2.7.3. ()
Z=XY , |X||Y|.
:
Z = X Y = q x S Px q y S

Py

qy

= S Px q x (Px Py ) = q z S Pz .
S

:
,
, S- ,
(Px-Py), .. ;
() ,
();
;
.

.
() Z=X+Y S = 2.
PX
X 010

qX
0.11

2 *0.75=3 (10)

PY
Y 001

qY
0.10

2 1 *0.5=1 (10)

1.
2.

010

3.

010
PZ
011

4.

Z=011

0.01
+0.11
1.00
1.00
qZ
0.10

- Y
- qx
- Z
- Z

0.10 = 2 3 * 0.5= 4 (10)

q
, .. , .

48

,
, ,
() ( ).

2.7.4.
Z = X Y .
:
Z=X*Y=qxSPx*qySPy= qxqyS(Px+Py)=qzSPz .
:
;
;
;
, , :

Z = X * Y = sign(Z) * X * Y ,
+, sign(X) = sign(Y)
sign(Z) =
, sign(X) sign(Y) .
,
. , ,
. ,
.
.
:
;

;
.
.
.
. , . ( ) : " " " ".
, , ,
.
, . .
" "
, .

49

.
Z=X*Y=0.1101(2) * 0.1011(2) = 0.8125(10) * 0.6875(10) = 0.55859375(10).
X= 0. 1 1 0 1
Y= 0. 1 0 1 1
0.1101
0.0110 1
+
0.1101
1.0011 1
0.1001 11
+
0.0000
0.1001 11
0.0100 111
+
0.1101
1.0001 111
0.1000 1111
+
0.0000
0.1000 1111

P1
1
P2
P1 + P2
1
P3
P1+P2+P3
1
P4
P1+P2+P3+P4
1
-

, Z=0.1000(2)=0.5(10), .
( )
, . ,
X, . ,
, 0.1000(2).
: 1, 1. 0.1001(2).
:
X Y 0, Z=0;
PX PY PZ<0, , Z , Z 0 ;
PX PY PZ>0, , Z ,
qZ .

2.7.5.
,
, N , .
, , , .
:
;
();
.
50


1. . ,
.
2. .
. .
X Y 1 . Z=X*Y. 65 Z X Y, X Y .
:

00...00

00...00

000...000

8
.........

8
.........

16
.........

.........
11..11

.........
11..11

.........
111..111

65


. : S=16
(4 ).
4 . , , .

. X Y 16- . Z=X*Y. ,
.
16- ,
.

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

= (x15...x8000...0 + 000...0x7...x0)* (y15...y8000...0 + 000...0y7...y0) =


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

, 8- . 8- , 16,8,8,0 .

2.7.6.
. ,
.

51

2.8.
. , ,
- ,
. . ,
-
. - ,
0...9 4- (
0000 1001). 8421 (, ).

.
- .

(3

0011 0100

7 )(10)
0111

( 347 )(10)=001101000111(2-10)
- 1 , .. 1
0 99.
- .
.
, ,
. , Z=X-Y X<0 Y<0. |Z|=|Y|-|X|, |Z| .
2.8.1. -
- . -
, . - , ,
. .
, 0000 1001, j , 9, ,
- .
.
Zj=Xj+Yj = 3(10)+5(10), j
Xj 0011
1000(2-10)=8(10)=1000(2)
+
Yj 0101
Zj 1000(2-10)

j- Zj 10,
. , . .
1.

Zj=10...15 = (1010...1111)
52

, .. 1 (j+1) .
:
8
r3
1
1

4
r2
1
-

2
r1
1

1
r0
-

1
, ,
Zj10

f = (r3 r2 ) (r3 r1 ) = 1.
.
Zj=Xj+Yj = 5(10)+7(10) , j .
Xj 0101
+
Yj 0111
Zj 1100(2-10)

5
+
7
1 2(10)

..

j+1

j ,
Z j = Z j 10 . 1
, Z j = Z j + 16 . ,

Zj = Zj - 10(10) + 16(10) = Zj + 6(10).

Zj 1100+0110
Zj 1100
.., Zj=0010
+
1 j+1
6(10) 0110
Zj 1 0010 =12(10)

2.
Zj=16,17,18 = (8+8, 8+9, 9+9)
1 16(10).
10. , 6.
.
Zj=Xj+Yj = 8(10)+9(10) = 17(10), j .
Xj

1000

Yj
1001
Zj 1 0001 (2-10)

Zj

6(10)
Zj

1 0001
0110
1 0111 =17(10)

, , :
-
f=1, ( 6(10)).
, .
53

.
Z = X + Y = 927 + 382 = 1309.

X 1001 0010 0111


Y 0011 1000 0010
Z 1100
. . 1010
. . 1001
2- 3- . . . . . .

+ 0110
- 2-
, f=1
1 0000 1001
1101 0000 1001
+
0110
- 3-
Z 1 0011 0000 1001
Z =0001 0011 0000 1001(2-10) = 1309(10)
- -.
:
1. 6, .. - 0110. . .
2. -
.
3. Zj 10,
(), Zj16. - 8421 .
, ,
,
, .
4. - , 6. :
0110(2) = 6(10);
16(10) , .. 10(10) = 1010(2).
.
.
.
Z = X + Y = 132 + 57 = 189.
X 0001 0011 0010
+
Y 0000 0101 0111
Z 0001 1000 1001 - Z
. Z (6(10)):

54

Z 0001 1000 1001


+
0110 0110 0110
Z6 0111 1110 1111 - . Z

, +6 (X
Y). .
Z6 - ,
Z6.
10(10)= 1010(2):
Z6 0111 1110 1111
+
1010 1010 1010
Z 0001 1000 1001

1
1
1
Z=0001 1000 1001(2-10)=189(10)

.
Z = X + Y = -93(10) - 48(10) = -(93+48)(10) = -141(10).
X 0000 1001 0011
+
Y 0000 0100 1000
Z 0000 1101 1011

- Z

.
Z (6(10)):
Z 0000 1101 1011
+
0110 0110 0110
Z6 0111 0100 0001
1

- . Z

1 -

, +6 (X
Y). . ,
( ):
Z6 0111 0100 0001
+
1010
Z 0001 0100 0001

1

Z = -(0001 0100 0001)(2-10) = -141(10)

.
Z = X + Y = 99(10) + 99(10) = 198(10).

X 1001 1001
+
Y 1001 1001
Z 1 0011 0010
1

- Z

1 -

. :
55

Z 0001 0011 0010


+
0110 0110 0110
Z6 0111 1001 1000

- . Z

6 ,
. , , , :

Z6 0111 1001 1000


+
1010
Z 0001 1001 1000
1


Z=0001 1001 1000(2-10)=198(10)
2.8.2. -
X-Y
X + (-Y). , .
. ( , ) .

:
1. (8421).
() 6.
:
- ;
- 1.
, (mod) +1
. 6, 10, 16.
2. (X) (Y) .
3. , , "+", ..
. ,
.
4. ,
"-", .. .
(..
- 1).
5. .
, 2 ( ), 10(10) 1010(2). . ,
, .
, (X - Y = Z, |X||Y|), .. Z0 Z . , Z ,
:
56

) ;
) ;
) Z0 (.. . ,
), Y. Y
, () Z , X Y.
.
Z=X-Y=49(10) -238(10) =-189(10).
X 0000 0100 1001
Y 0010 0011 1000

|Y| 6:
Y 1101 1100 0111
+
0001
Y 1101 1100 1000

:
X 0000 0100 1001
+
Y 1101 1100 1000
Z 1110 0001 0001
1

- Z

, (.. ).
:
Z 1110 0001 0001
Z 0001 1110 1110
+
0001
Z 0001 1110 1111

- Z

. 5 :
Z 0001 1110 1111
+
0000 1010 1010
0001 1000 1001

|Z|= (0001 1000 1001) = 189(10)

, .. ,
(-). :
.
Z=X-Y=143(10) -58(10) =85(10).

Z= -(0001 1000 1001) = -189(10)

X 0001 0100 0011


Y 0000 0101 1000

|Y| 6:
Y 1111 1010 0111
+
0001
Y 1111 1010 1000

57

:
X 0001 0100 0011
+
Y 1111 1010 1000
Z 0000 1110 1011

- Z
-

, (.. ).
. 3 :
Z 0000 1110 1011
+

1010 1010
0000 1000 0101

Z= 1000 0101(2-10)=85(10)

2.8.3. -
- .

:
1. .
2. ,
, ,
.
3. ,
, . 2, () . ,
" " " ".
4. , - 6
(.. 0110 ,
f=1).
.
Z = X * Y = 25(10) * 13(10) = 325(10).
Y = 13(10) = 0001 0011(2-10).
X = 25(10) = 0010 0101(2-10);
" ". . 1
P0=0. ( Pi).

Y = 0001 0011
1(10)

+
3(10)

X = 0010 0101
0000 0000
+
0010 0101

0010 0101 0000


+
+

P0=0
P1 (1- . .)
1=P0 + P1=P1 -

0010 0101
P2 (2- . .)

0010 0101
0010 0101
58

- ,
3(10),
. P2, , P2:

P'2 .

0010
+0010
0100
+

0101
0101
1010
. .

2
2
, 2
(f=1)


P2 .

...
0000 0110
0101 0000
+0010 0101

P2

0111 0101

2.

, 2
2

, , ,

P2 = 0111 0101.
,
.. :
P1

0010 0101 0000


+
0111 0101
P2
2=P1+P2 0010 1100
. . 0101
+
...
0000 0110 0000
2=P1+P2 0011 0010 0101




. (f=1)

: Z = 0011 0010 0101(2-10) = 325(10).


, , f=1.

2.8.4. -
, , .
.
, .
2.9.
, , .
:
:
- , ( );
:
- , PZ>Pmax;
- , PZ<Pmin ( ).
. :

59

- , ,
, ;
-
.
2.10. -
.
, , .. .
. 28=256 . ,
. . , . , , ,
, ,
, , .

ASCII, . ASCII
7 , .. 27=128 , :

0 - 0011 0000
1 - 0011 0001
2 - 0011 0010
...
9 - 0011 1001

A - 0100 0001 - 41(16)


B - 0100 0010 - 42(16)
...
Z - 0101 1010 - 5A(16)
+ - 0010 1011 - 2B(16)
= - 0011 1101 - 3D(16)


.
, .
. , -
(), 8- (-8). 7- -7
, -7 ASCII.
-8 8- , .
. ,
. , , , .
,
.

60

8- 16- , . Unicode, Unicode Consortium. Unicode Consortium ,


Unicode, , .
Unicode ,
, , . Unicode
, Apple, HP,
IBM, JustSystem, Microsoft, Oracle, SAP, Sun, Sybase, Unisys, .

, , , XML, Java, ECMAScript (JavaScript), LDAP, CORBA 3.0,
WML . Unicode ISO/IEC 10646, .
, . Unicode

. , Unicode
.
Unicode
, -, ,

. Unicode - , - .
.
2.11.

. , , ,
. .
, .

1. . .1. . 3- ., .
. / . ; . .. .; .; : , 2000. 729 .
2. . .2: . 3- ., .
. / . ; . .. .; .; : , 2000. 832.
3. : .. . .: . ..
, 2001. 328 .
4. :

:
/ ., .; .: , 1999. 256 .
5. : . .
3- ., . . / .. ;.: , 1991. 592 .

61

6. : .
. / .., .. .: , 1991. 303 .
7. : . / .. ; .: , 1988. 368 .
8. / . ; . .. . .: , 1984. 334 .

1. ?
2. , ?
3. -?
4. , ?
5. ,
?
6. ?
7. ?
8. ?
9. .
10. .
11. .
12. , ?
13. .
14. ? ?
15. ?
16. , .
17. ?
18. ?
19. ? .
20. ?
21. - ?
22.
?
23. ?

62

2
:
1 .
2 .
.

1.
1. ,
.
2.
. . 2.7 n-1 , n . ,
2.7
an
0
1
2
3
4
an-1
0 1,5,9,13,19
2,6,10,14,20 3,7,11,15,21 4,8,12,16,22 1,7,12,17,23
1 3,8,10,18,20 4,6,12,13,22 2,7,9,16,23
1,5,11,14,21 3,6,9,14,19
2 1,6,9,18,19
2,5,10,17,20 1,8,11,16,21 3,5,9,18,22
2,7,9,17,19
3 1,5,9,13,19
2,6,10,14,20 3,7,11,15,21 4,8,12,16,22 1,7,12,17,23
4 3,8,10,18,20 4,6,12,13,22 2,7,9,16,23
1,5,11,14,21 3,6,9,14,19
5 1,6,9,18,19
2,5,10,17,20 1,8,11,16,21 3,5,9,18,22
2,7,9,17,19
6 1,5,9,13,19
2,6,10,14,20 3,7,11,15,21 4,8,12,16,22 1,7,12,17,23
7 3,8,10,18,20 4,6,12,13,22 2,7,9,16,23
1,5,11,14,21 3,6,9,14,19
8 1,6,9,18,19
2,5,10,17,20 1,8,11,16,21 3,5,9,18,22
2,7,9,17,19
9 1,5,9,13,19
2,6,10,14,20 3,7,11,15,21 4,8,12,16,22 1,7,12,17,23
an-1
0
1
2
3
4
5
6
7
8
9

an

5
2,8,9,15,19
4,7,10,13,20
1,6,10,14,22
2,8,9,15,19
4,7,10,13,20
1,6,10,14,22
2,8,9,15,19
4,7,10,13,20
1,6,10,14,22
2,8,9,15,19

6
3,5,10,16,20
1,6,12,14,23
3,7,12,16,19
3,5,10,16,20
1,6,12,14,23
3,7,12,16,19
3,5,10,16,20
1,6,12,14,23
3,7,12,16,19
3,5,10,16,20

7
4,6,11,13,21
2,7,11,15,20
4,7,12,15,23
4,6,11,13,21
2,7,11,15,20
4,7,12,15,23
4,6,11,13,21
2,7,11,15,20
4,7,12,15,23
4,6,11,13,21

8
1,8,11,17,22
3,5,11,18,21
2,5,10,13,23
1,8,11,17,22
3,5,11,18,21
2,5,10,13,23
1,8,11,17,22
3,5,11,18,21
2,5,10,13,23
1,8,11,17,22

9
2,5,12,18,23
4,8,10,15,22
4,6,9,17,21
2,5,12,18,23
4,8,10,15,22
4,6,9,17,21
2,5,12,18,23
4,8,10,15,22
4,6,9,17,21
2,5,12,18,23

2.
1. , , , , .
2. , .. " " " ".
3. .
4. ,
.
5. . . 2.8 n-1
63

, n . . 2.8 , . 2.9.
2.8
an-1
0
1
2
3
4
5
6
7
8
9

an

1
28
21
29
20
11
19
17
14
3

19
2
35
24
9
36
10
25
2
16

34
31
3
11
12
21
13
1
22
4

27
4
12
36
8
35
7
15
5
18

5
13
22
28
22
14
23
34
35
6

14
6
33
25
5
32
6
33
8
19

20
15
7
30
15
24
16
27
36
7

30
8
16
29
4
33
3
29
9
13

9
32
23
17
27
18
26
12
21
10

26
10
18
34
1
31
2
20
11
17

1. ,
1- . .
2 .
2. ,
2 : 4 , 8 . . . .
3. ,
- .

1 ()

X+Y
X-Y
X*Y
1
01
02
03
04
05
06
07
08
09

2
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y

3
15
33
32
67
17
37
30
63
19
41
28
59
21
45
26
55
23
49

4
15
33
32
67
17
37
30
63
19
41
28
59
21
45
26
55
23
49

5
15
33
32
67
17
37
30
63
19
41
28
59
21
45
26
55
23
49

2 ()

2.9
3 (2-10)

X+Y

X-Y

X*Y

X+Y

X-Y

X*Y

6
15.33
33.15
32.67
67.32
17.37
37.17
30.63
63.30
19.41
41.19
28.59
59.28
21.45
45.21
26.55
55.26
23.49
49.23

7
15.33
33.15
32.67
67.32
17.37
37.17
30.63
63.30
19.41
41.19
28.59
59.28
21.45
45.21
26.55
55.26
23.49
49.23

8
15.33
33.15
32.67
67.32
17.37
37.17
30.63
63.30
19.41
41.19
28.59
59.28
21.45
45.21
26.55
55.26
23.49
49.23

9
153
331
326
673
173
371
306
633
194
411
285
592
214
452
265
552
234
492

10
153
331
326
673
173
371
306
633
194
411
285
592
214
452
265
552
234
492

11
153
331
326
673
173
371
306
633
194
411
285
592
214
452
265
552
234
492

64

1
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

2
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y
X
Y

3
24
51
25
53
22
47
27
57
20
43
29
61
38
54
31
65
16
35
13
31
18
72
15
48
41
58
22
81
19
74
46
73
38
62
14
51
23
36
34
71
19
64
42
69
35
68
21
75
17
66

4
24
51
25
53
22
47
27
57
20
43
29
61
38
54
31
65
16
35
13
31
18
72
15
48
41
58
22
81
19
74
46
73
38
62
14
51
23
36
34
71
19
64
42
69
35
68
21
75
17
66

5
24
51
25
53
22
47
27
57
20
43
29
61
38
54
31
65
16
35
13
31
18
72
15
48
41
58
22
81
19
74
46
73
38
62
14
51
23
36
34
71
19
64
42
69
35
68
21
75
17
66

6
24.51
51.24
25.53
53.25
22.47
47.22
27.57
57.27
20.43
43.20
29.61
61.29
38.54
54.38
31.65
65.31
16.35
35.16
13.31
31.13
18.72
72.18
15.48
48.15
41.58
58.41
22.81
81.22
19.74
74.19
46.73
73.46
38.62
62.38
14.51
51.14
23.36
36.23
34.71
71.34
19.64
64.19
42.69
69.42
35.68
68.35
21.75
75.21
17.66
66.17

7
24.51
51.24
25.53
53.25
22.47
47.22
27.57
57.27
20.43
43.20
29.61
61.29
38.54
54.38
31.65
65.31
16.35
35.16
13.31
31.13
18.72
72.18
15.48
48.15
41.58
58.41
22.81
81.22
19.74
74.19
46.73
73.46
38.62
62.38
14.51
51.14
23.36
36.23
34.71
71.34
19.64
64.19
42.69
69.42
35.68
68.35
21.75
75.21
17.66
66.17
65

. 2.9
8
9
10
11
24.51
245
245
245
51.24
512
512
512
25.53
255
255
255
53.25
532
532
532
22.47
224
224
224
47.22
472
472
472
27.57
275
275
275
57.27
572
572
572
20.43
204
204
204
43.20
432
432
432
29.61
296
296
296
61.29
612
612
612
38.54
385
385
385
54.38
543
543
543
31.65
316
316
316
65.31
653
653
653
16.35
163
163
163
35.16
351
351
351
13.31
133
133
133
31.13
331
331
331
18.72
187
187
187
72.18
721
721
721
15.48
154
154
154
48.15
481
481
481
41.58
415
415
415
58.41
584
584
584
22.81
228
228
228
81.22
812
812
812
19.74
197
197
197
74.19
741
741
741
46.73
467
467
467
73.46
734
734
734
38.62
386
386
386
62.38
623
623
623
14.51
145
145
145
51.14
511
511
511
23.36
233
233
233
36.23
362
362
362
34.71
347
347
347
71.34
713
713
713
19.64
196
196
196
64.19
641
641
641
42.69
426
426
426
69.42
694
694
694
35.68
356
356
356
68.35
683
683
683
21.75
217
217
217
75.21
752
752
752
17.66
176
176
176
66.17
661
661
661

X
Y
X
Y

35
36

35
52
28
83

X
Y

35
52
28
83

35
52
28
83

35.52
52.35
28.83
83.28

35.52
52.35
28.83
83.28

35.52
52.35
28.83
83.28

. 2.9
355
355
355
523
523
523
288
288
288
832
832
832

( 2)
1 ()
2 ()
3 (2-10)

X+Y

X-Y

X*Y

X+Y

X-Y

X*Y

X+Y

X-Y

X*Y

18
33

18
33

18
33

18.33
33.18

18.33
33.18

18.33
33.18

183
331

183
331

183
331

1. ,
1- . .
2 .
1. Z = X+Y = 18(10) + 33(10) = 51(10).
Y = 33(10) = 0010 0001(2).
X = 18(10) = 0001 0010(2);
:
()
X
Y
(X+Y)

0001 0010
0010 0001
0011 0011(2) = 51(10)

: Z = 0011 0011(2) = 51(10) .


2. Z = X-Y = 18(10) 33(10) = -15(10).
X = 18(10) 0001 0010(2)
Y = -33(10) 1010 0001(2)
1101 1111(2)
0001 0010
+
1101 1111
0 1111 0001(2)

-
- (-)
-

. ,
1.

. , :
1111 0001(2)

()

1000 1110 ,
+
1
1000 1111(2)
() = - 15(10)

: Z = 1000 1111(2) = 15(10) .


3. Z = X*Y = 18(10)*33(10) = 594(10).
Y = 33(10) = 0010 0001(2).
X = 18(10) = 0001 0010(2);
66

:
Y=

00 10 0001

00010010

P1

000010010

00000000

P2

000010010
0000010010

P1 + P2
1

00000000

P3

0000010010
00000010010

P1+P2+P3
1

00000000
00000010010
000000010010
00000000

P4
P1+P2+P3+P4
1
P5

000000010010
0000000010010

P1+P2+P3+P4+P5
1

00010010
0001001010010
00001001010010

P6
P1+P2+P3+P4+P5+P6
1

2
:
Z = 0000001001010010(2) = 594(10).

2. ,
2 : 4 , 8 . . . .
X = 18.33(10); Y = 33.18(10).

, 0.33(10), :
2 * 0.33 = 0.66 0 ()
2 * 0.66 = 1.32 1
2 * 0.32 = 0.64 0
2 * 0.64 = 1.28 1
2 * 0.28 = 0.56 0
2 * 0.56 = 1.12 1
2 * 0.12 = 0.24 0
2 * 0.24 = 0.48 0

, 0.33(10) = 0.01010100(2), a X = 18.33(10) = 00010010.01010100(2).


X , 8 ( ):
67

X= 0000*10010.011 .
qx
Px

X:
P x=x+5;

qx - 5

X= 0101*0.10010011.
q x
p x

Y, 0.18(10), :
2 * 0.18 = 0.36 0 ()
2 * 0.36 = 0.72 0
2 * 0.72 = 1.44 1
2 * 0.44 = 0.88 0
2 * 0.88 = 1.76 1
2 * 0.76 = 1.52 1
2 * 0.52 = 1.04 1
2 * 0.04 = 0.08 0

, 0.18(10) = 0.00101110(2), a Y = 33.18(10) = 00100001.00101110(2).


Y , 8 ( ):
Y= 0000*100001.01 .
qy
Py

Y:
P y=y+6;

qy - 6

Y= 0110*0.10000101.
q y
p y

1. Z = X+Y = 18.33(10) + 33.18(10) = 51.51(10).


PY
Y 0110

qY
0.10000101

PX
X 0101

qX
0.10010011

1. 0110
2.
3. 0110
PZ

0.01001001
0.10000101
0.11001110
0.11001110
qZ

- X
- qY
- Z

: Z = 0110 * 0.11001110(2) = 2 * 0.8046875 = 51.5(10)


2. Z = X-Y = 18.33(10) + 33.18(10) = -14.85(10).
68

: Z = (-) 0110 * 0.00111100(2) = - 26 * 0.234375 = - 15(10)


3). Z = X*Y = 18.33(10)*33.18(10) = 608.1894(10).
X=

PX
0101

qY
PY
Y= 0110 0.10000101

qX
0.10010011 ,

( ):
qX = 0.1 0 0 1 0 0 1 1
qY = 0.1 0 0 0 0 1 0 1
10010011
01001001 1
+
00000000

P1
1

01001001 1
00100100 11
+
10010011
10110111 11
01011011 111

1+2
1
P3
1+2+3
1

4 4
00000101 1011111
+
10010011
10011000 1011111
01001100 01011111
+
00000000
01001100 01011111

69

4
P4
1+2+3+4
1
5

:
+

0101
0110

- PX
- PY

1011 - PX + PY

:
P Z = Z -1; qZ - 1
1010 0.10011110 .
p Z q Z

Z = 1010 * 0.10011000(2) = 210 * 0.59375(10) = 608(10).

3. ,
- .
1. Z=X+Y= 183(10) + 331(10) = 514(10).
X = 183(10) = 0001 1000 0011(2-10); Y = 331(10) = 0011 0011 0001(2-10).
+
+

0001 1000 0011


0011 0011 0001

-X
-Y

0100 1011 0100

- X+Y

0000 0110 0000

- 2-

0101 0001 0100

- X+Y

. .

Z = 0101 0001 0100(2-10) = 514(10).

2. Z = X Y = 183(10) 331(10) = -148(10).


|Y| 6:
Y 1100 1100 1110
+
0001
Y 1100 1100 1111

:
X 0001 1000 0011
+
Y 1100 1100 1111
Z 1110 0101 0010 - Z
1

, (.. ).

:
Z 1110 0101 0010
Z 0001 1010 1101
+
0001
Z 0001 1010 1110

- Z

70

. 5
- :
Z 0001 1010 1110
+
0000 1010 1010
0001 0100 1000

|Z|= (0001 0100 1000) = 148(10)

, .. ,
(-).
:

Z = - ( 0001 0100 1000)(2-10) = -148(10).

3. Z = X * Y = 183(10) * 331(10) = 60573(10)


X = 183(10) = 0001 1000 0011(2-10); Y = 331(10) = 0011 0011 0001(2-10).
"
". . 1
P0=0. ( Pi).
Y = 0011 0011 0001

X = 0001 1000 0011


+

1(10)

0000 0000 0000


0001 1000 0011
0001 1000 0011
0000 0001 1000 0011

+
+

3(10)

P1 (1- . .)
1=P0 + P1=P1 -

0001 1000 0011


0001 1000 0011

P2 (2- . .)

0001 1000 0011

+
3(10)

P0=0


+
+

0001 1000 0011


0001 1000 0011

P3 (3- . .)

0001 1000 0011


, 3(10), . P2 ( P2 = 3 ), , P2:

P'2 .

+
+

P2

0001 1000 0011


0011 0000 0110

2
, 2
()

0000 0110 0000


P2 .

0001 1000 0011

0011 0110 0110

, 2

0001 1000 0011

0101 0100 1001

2,

71

, ( ) ,
,

P2 = 3 = 0101 0100 1001(2-10).


, , .. .

P1

0000 0000 0001 1000 0011


0000 0101 0100 1001
0000 0101 0110 0001 0011 1 + 2
+
1
()
0000 0000 0000 0110 0000
2=P1+P2 0000 0101 0110 0111 0011 1+2
P2
2=P1+P2

P3 0101 0100 1001

3=P1+P2+P3 0101 1001 1111


. . 0111 0011
+

1 + 2+ 3
(f=1)

0000 0110 0110 0000 0000


3=P1+P2+P3 0110 0000 0101 0111 0011

1+2+3

: Z = 0110 0000 0101 0111 0011(2-10) = 60573(10).

3.
, , , ,
, ( ).
, , , - ( ).
, -, ,
. , -
,
- . ,
.
(, , ), . ,
, .
:
- ;
- ;
- ;
- ;
- ;
- ;
- +1 -1 ( ).
72

.
:
- ;
- ;
- .
, , () ().
.
,
.
.. ,
.
, , ,
, .., .. . ,
, , , ,
. , .
. 3.1.
,
, .
, : R2 0, () 1 .. , ,
, .
n , n S1,...,Sn, . ,
.. , .
.

X
.
S1

P1

Pm

Sn

(+, -, /, * ..)

.
Z

;
;

. 3.1.

73

S1,...,Sn
( ), ,
P1,...,Pm,
.
, , - , .
.
, ,
(, , ),
, . :
1.
, .. "".
, ' ', ,
, .
.
.
,
, , -
,
- . .
, , 70- 4-5 , . .
, ,
() .
:
- - ;
- - ;
- ( );
- ( );
- ( );
- ( ).
,
, , . , .
2.
,
, , .
3.
, . ,
. 3.2. , (.. ), - ,
.
74

-
. 3.2.

4. ,
, .
5.
:
- ;
- ;
- (. . 3.2) , , , ;
- , , , , , , .
3.1. ()
" " ,
(, ,
) .
, , ,
( ) .
, ,
.
, , :
- ;
- () ;
- ;
- ;
- ( );
- : ,
( ),
( ) ...

, -, , .
.
(. 3.3) , ,
. , -

75

, .
X

X ; S ; Z
; P
. 3.3.

, , . , ,
, .

,
. - , .
(), -
.
, , , ,
.
, .

. , , (). ,
, , ( ).
. ,
. . (
). ,
(). , , , , ( ).

. 3.4.

76

, . .

. 3.4.

3.2.
, (. 3.5)
, (+, -, /, * ..). , , (P1,...,Pm) .

P
; S ();
- ; ;
P ()
. 3.5.

, ,
P.
. .
() .
77

, . ,
, .
, , ,
, , .
. , .
.

3.2.1.
, (. 3.6), .
.
, , . ,
( , , , ..) .
, , , .
. .
().
, , ,
,
, ,
.

.
.

; ;
;
. 3.6.

78

,
, , , , .
( ) .

.
.

(). , . ,
.
, ,
.

. 3.7.

1
1

""
1

&

1
1

n
1
2

1'


""

1
1

k
&

1
2

1
2

n
2'

1
n

1
n
n

&

1
k

1
r

n'
. 3.7.

,
. 79

, . ""
. ""
"". ,
.

( , ).
, .
.
, ,
. , , , , .

. . ,
.
, , ,
.

XILINX, ALTERA, LATTICE, AT&T, INTEL.
, , ..,
EPLD FPGA.
EPLD ).
FPGA ).
- EPLD FPGA .

3.2.2.
, 1951.,
.
. 3.8.
.
. ().
(). , , , , .
, . , ..
.
(
). , () .

80

S1

Sn

;
;
;
;
;


;

;
;
;
;
;
;

()

. 3.8.

3.2.2.1.
-.
(. 3.9, ).
i+1 i. -.
( ) . 3.9, .
i+1 i. - 2 .
- (. 3.9, ).
,
. i+2, i+1 , i+1.

81

MKi

B P

MKi
B P

MKi+1

MKi+1
B P

MKi+2

MKi+2

MKi
MKi+1

B P

B P
B P
B P

B P

2
B P

MKi+3

3
t

; ; 1 3 ; 2
. 3.9. :
; ; -

, ,
,
(. 3.10, ).
, 1. .
, () . , (. 3.10, ).
(, = 1 ).
.
(),
. , :
- := + 1;
- , . , := , , := + 1.

82

a
a

. 3.10. :
- ;
- ;
-

3.2.2.3.

, , .. .
(. 3.11, ). 1.
,
.
, , .. , .
( ) , , .
(. 3.11, ).
2.
. , , ,
.
n
1
m
1

i k

23
1

2
1

;
;

. 3.11. : ;
; ;

83

.
(. 3.11, ).
3.
, .
.
.
1, 2, 3 .
,
.
4.
(. 3.11, ).
.
,
.
. 3.11 1 , 2
.

00 ;
01 ;
1
10 ;
11 .
2 64 .
, , .
.
(, . .).

3.2.2.4.
.
, .
(. 3.12, )
.
(. 3.12, ) ,
. .

&

&

&

&

&
&

n
1

;

. 3.12. : ;

84


( ),
, .
(), () .

1. .
2. ?
3. ?
4. ?
?
5. ?
6. .
7. .
8.
.
9. .
10. ?
11.
?
12. ?
13. ?
14. .
15. .
16. .
17. ?
18. .
19. .
.
20. .
21. ?

1. ,
.
2. . .3.1 n-1
, n . ,
.

85

3.1
an-1
0
1
2
3
4
5
6
7
8
9

an

1,5,9,
13,17
2,8,12,
16,17
3,6,10,
16,20
2,6,9,
15,21
2,5,9,
15,18
1,7,12,
16,21
2,8,12,
13,20
3,7,9,
13,17
4,7,11,
13,18
1,5,9,
14,18

3,6,10,
14,18
4,8,11,
13,21
1,8,12,
16,18
3,7,11,
13,20
1,6,10,
14,18
4,7,9,
16,19
3,5,10,
14,21
1,6,10,
13,21
2,5,10,
16,21
3,6,10,
15,19

4,7,11,
16,20
1,5,9,
16,20
4,7,11,
15,19
1,7,11,
14,18
4,7,11,
14,17
2,8,12,
14,18
1,5,9,
15,19
4,7,9,
13,20
3,6,10,
13,17
4,8,12,
14,19

2,8,12,
15,19
3,8,10,
15,18
2,6,9,
15,17
1,5,9,
13,17
2,8,12,
16,17
3,6,10,
16,20
2,6,9,
15,21
2,5,9,
15,18
1,7,12,
16,21
2,8,12,
13,20

3,7,9,
13,17
4,7,11,
13,18
1,5,9,
14,18
3,6,10,
14,18
4,8,11,
13,21
1,8,12,
16,18
3,7,11,
13,20
1,6,10,
14,18
4,7,9,
16,19
3,5,10,
14,21

1,6,10,
13,21
2,5,10,
16,21
3,6,10,
15,19
4,7,11,
16,20
1,5,9,
16,20
4,7,11,
15,19
1,7,11,
14,18
4,7,11,
14,17
2,8,12,
14,18
1,5,9,
15,19

4,7,9,
13,20
3,6,10,
13,17
4,8,12,
14,19
2,8,12,
15,19
3,8,10,
15,18
2,6,9,
15,17
1,5,9,
13,17
2,8,12,
16,17
3,6,10,
16,20
2,6,9,
15,21

2,5,9,
15,18
1,7,12,
16,21
2,8,12,
13,20
3,7,9,
13,17
4,7,11,
13,18
1,5,9,
14,18
3,6,10,
14,18
4,8,11,
13,21
1,8,12,
16,18
3,7,11,
13,20

1,6,10,
14,18
4,7,9,
16,19
3,5,10,
14,21
1,6,10,
13,21
2,5,10,
16,21
3,6,10,
15,19
4,7,11,
16,20
1,5,9,
16,20
4,7,11,
15,19
1,7,11,
14,18

4,7,11,
14,17
2,8,12,
14,18
1,5,9,
15,19
4,7,9,
13,20
3,6,10,
13,17
4,8,12,
14,19
2,8,12,
15,19
3,8,10,
15,18
2,6,9,
15,17
1,5,9,
13,17

86

..

20.06.2005


.-. . 6,7
150

60 84 1/16
. . . 4,99

- -
620002, , . , 19
-
620002, , . , 19