1961 rapid technique of manual or ma- chine binary-to-decimal integer conversion using decimal radix...

2
1961 IR E O N ELECTRONIC COMPUTERS 7 7 7 Coorrespondence Rapid Technique o f Manual o r M a - where ri=a5, i f N , =N5, also 6=q-p. which involves the solution o f a s e t of linear chine Binary-to-Decimal Integer inequalities. This note describes another N i = (ri-q + ai_-i + r i p ) -Pi-' computational algorithm, valid f o r points Conversion Using Decimal i - 2 whose coordinates m a y take o n values from Radix Arithmetic* + L ai.pi either a continuous o r discrete set, which o involves t h e determination of t h e existence Often o ne has the problem o f converting i - 2 o f a non-negative solution t o a s e t of linear large binary integers to their decimal equiv- N = ( ri - P + a i l ) -pi- + E as p i . equalties. alent without t h e a i d o f a machine o r conver- 0 T h e algorithm t o be described depends sion tables. Then o ne usually attacks t h e This final statement expresses o n e itera- o n the following theorem a n d i t s corollary. problem b y expanding t h e series; adding i n tion of t h e well-known technique utilizing th e binary o r octal coefficients, multiplying expansion properties o f t h e known series. Theorem: T w o sets of points are linearly b y t w o o r eight, respectively, starting with More rigid proofs are left t o th e reader. separated i f a nd only i f their convex hulls t h e most significant an d proceeding t o t h e Example: a r e non-intersecting.2 least significant digit. Utilizing this series expansion another technique can bedevel- Binary number7 11,110,101,000,011,101,001. Proof: Th e "if" part is a known result o f oped which i s simpler a n d yields a result i n Octal number 7650351. 7 2 =143 A linear algebra. To prove t h e "only if," a s - relatively short order. (The author notes 1 s t iteration - 14 sume that t h e convex hulls o f th e linearly that h e i s n ot t h e originator, b u t t o h i s 1 s t iteration 6250351. 62-2 =124 separated sets S a nd S2intersect. There then knowledge this technique has not been pre- A exists a t least o n e point p which i a convex viously published.) Th e technique seems 2 n d iteration -124 combination o f a s e t o f points from S I a n d novel a n d worth t h e attention o f PGEC 2 n d iteration 5010351. 5 0 1 - 2 =1002 also o f a set of points from S 2 . I t ca n b e readers. T h e following describe t h e 3r d iteration -1002 shown4 that if each point a s e t o f points process: 3 r d iteration 4008351. 4008-2 =8016 satisfies a linear inequality, then a l l convex I ) Organize t h e binary digits i n groups 4 t h iteration - A combinations o f these points also obey t h e o f three, inserting o n e o r two zeros at h iteration - 8016 inequality. Since there exists a hyperplane most significant end if required. 4 t h iteration 3206751. 32067-2 =64134 separating SI a n d S 2 , this determines a n i n - Convert each three b i t group t o i t s 5th iteration - A equality satisfied by points of S i, bu t n o t by 2 ) o t eale 64134 points o f S 2 . Then, since p i s a convex com- octal equivalent. 5 t h iteration 2565411. 256541-2 =513082 bination o f a set of points from S i , p must 3 ) Select most significant octal digit a n d A . . . double, using radix t e n arithmetic. 6 t h iteration - 513082 satisfy this inequality. Since p i s a convex 4) Shift result o f previous step right o n e 6 t h iteration 2052329. end, desired decimal combination o f points from S 2 , p must fail t o position a n d subtract from operand. number. satisfy this inequality. This i s contradictory, 5 ) Select most a n d next-to-most sig- Conclusion: T h e technique described i s atherefore S a nd S2 a r e n o t linearly nificant digits o f newly formed o p - simpler than t h e recursive process o f adding erandl, dlouble using radilx t e n a nth- metic, andorepeat step four. i n octal coefficients a n d multiplying b y Corollary: I f there exists a t least o ne 6 ) Th e final subtraction occurs when th e eight, because multiplication by eight i s point which i s a convex combination o f shifted duplation registers i t s Least more complex than by two. The process o f points from S i a n d which i s also a convex Significant Digit (LSD) under t h e subtraction i s comparable to except combination of points from S 2 , then S i a n d L SD o f t h e operand T h e number in that numbers with more digits ar e sub- S 2 ar e n t linearly separated. LSDofthe esired erand. Sr e t he r i n tracted. t h e desired radix i s represented b y t h e O n e may note that this method i s feasible A n algebraic test for linear separation final operand, i.e., t h e result o f t h e f o r conversion o f other radices. However, t h e can be obtained from this corollary which final subtraction. factor, delta ( 8 =q-p), may be altered. leads to a s e t of n +2 linear equations i n m Sumnmary: F o r each i t h iteration, select JOHN t . Corp unknowns, where n i s t h e dimensionality o f the most significant digits, double, shift International Electrc Corp. t h e space, a n d m i s th e total number o f right o n e position, a n d subtract from o p - Paramus, N J - points i n S i a nd S 2 . I f these equations have erand t o form n e w operand. When LSDs of a non-negative solution, then t h e sets a r e subtrahend a n d operand a r e in same posi- n o t linearly separated. This s e t of linear tion, t h e final operand i s t h e decimal equiva- equations i s developed a s follows. lent o f t h e original octal number. L e t p be a point contained in t h e convex Analysis: hulls o f both S i a n d S 2 ( i f such a point exists). Then p must b e a convex combina- aipi = a,pn +- a , , Pn- . tion of points from S a nd also o f points from o Y P = S 2 . L e t there b e m i points in SI an d m points i n S 2 . L et C j k represent t h e kth coordinate - 1 - A Note o n Linear Separation* of t h e j t h point, where we distinguish b e - m A Note on Linear Separation* tween t h e sets b y specifying that t h e range N q bi-qi = b . - qm + bm i .qm-1 .+ . McNaughton1 h a s pointed ou t t he need of j over S i i s from 1 t o m i , a n d over S2 i s ° f o r algorithm t o determine whether t w o from mi±l to m±mM2= m. Then there i s + b o . q sets o f points in an n-dimensional Euclidean associated with each point a non-negative space a r e linearly separated, i.e., m a y be per- where N 5 i s equivalent t o N 5 . fectly separated b y a hyperplane in th e statement o ne iteration o f t h e r e - n-dimensional space. H e suggests an a l - cursive process describing this proposed so- gorithm f o r points with binary coordinates lultion c a n be expressed. 2 T he convex hull o f a s e t o f points S i s the smallest convex s e t containing S. It is th e s e t all convex i - 2 combinations of sets f points from S . ' N-=(r,-q + a, - _- 6. r ) *pi-l + E acEpi, * Received b y the PGEC, July 5 , 1961; revised 3IA. E. Taylor, "Introduction t o Functional ' manuscript received, August 1 4 . 1961. Analysis," John Wiley a n d Sons, Inc., N e w York, 1 R . McNaughton, "Unate truth functions," I R E N . Y . ; 1958. TRANS. ON ELECTRONIC COMPUTERS, vol. ERC-l0, P P . 4 S . I. Gass, "Linear Programming," McGraw- * Received by the PGEC, August 2 8 , 1961. 1-6; March. 1961. Hill Book CO., Inc., New York, N . Y . ; 1958.

Upload: rajesh-bathija

Post on 03-Apr-2018

245 views

Category:

Documents


0 download

TRANSCRIPT

 

1 9 6 1 IRE

O N ELECTRONIC

COMPUTERS

7 7 7

C o o r r e s p o n d e n c e

R a p i d

T e c h n i q u e o f

Manual o r Ma-

w h e r e

r i = a 5 ,

i f

N ,

= N 5 ,

a l s o

6 = q - p .

w h i c h i n v o l v e s t h e s o l u t i o n o f

a s e t o f l i n e a r

c h i n e

B i n a r y - t o - D e c i m a l I n t e g e r

i n e q u a l i t i e s . T h i s n o t e d e s c r i b e s

a n o t h e r

Ni=

( r i - q

+

a i _ - i

+ r i

p )

- P i - '

c o m p u t a t i o n a l

a l g o r i t h m ,

v a l i d f o r p o i n t s

C o n v e r s i o n

U s i n g

D e c i m a l

i - 2

w h o s e c o o r d i n a t e s may t a k e

o n v a l u e s

f r o m

R a d i x A r i t h m e t i c *

+

L

a i . p i

e i t h e r a

c o n t i n u o u s

o r d i s c r e t e

s e t ,

w h i c h

o

i n v o l v e s t h e d e t e r m i n a t i o n o f t h e

e x i s t e n c e

O f t e n o n e h a s t h e p r o b l e m

o f c o n v e r t i n g

i - 2 o f a n o n - n e g a t i v e

s o l u t i o n t o a s e t o f l i n e a r

l a r g e

b i n a r y i n t e g e r s t o t h e i r

d e c i m a l e q u i v -

N =

( r i

- P

+ a i

l ) - p i -

+

E

a s

p i .

e q u a l t i e s .

a l e n t w i t h o u t t h e a i d o f a m a c h i n e o r c o n v e r -

0

T h e

a l g o r i t h m t o b e d e s c r i b e d d e p e n d s

s i o n t a b l e s . T h e n o n e u s u a l l y

a t t a c k s

t h e

T h i s

f i n a l s t a t e m e n t e x p r e s s e s o n e i t e r a - o n t h e f o l lo w in g t h e o r e m a n d i t s c o r o l l a r y .

p r o b l e m

b y e x p a n d i n g

t h e s e r i e s ; a d d i n g i n t i o n o f t h e w e l l - k n o w n

t e c h n i q u e u t i l i z i n g

t h e

b i n a r y o r o c t a l

c o e f f i c i e n t s , m u l t i p l y i n g e x p a n s i o n

p r o p e r t i e s o f t h e known

s e r i e s .

T h e o r e m :

T w o

s e t s

o f p o i nt s a re l i n e a r l y

b y t w o o r e i g h t ,

r e s p e c t i v e l y , s t a r t i n g w i t h

More r i g i d

p r o o f s a re l e f t t o t h e r e a d e r . s e p a r a t e d i f a n d o n l y i f

t h e i r

c o n v e x h u l l s

t h e m o s t

s i g n i f i c a n t

a n d p r o c e e d i n g t o t h e

E x a m p l e :

a r e n o n - i n t e r s e c t i n g . 2

l e a s t s i g n i f i c a n t

d i g i t .

U t i l i z i n g

t h i s

s e r i e s

e x p a n s i o n

a n o t he r t e ch ni q ue

c a n b ed e v e l - B i n a r y n u m b e r 7

1 1 , 1 1 0 , 1 0 1 , 0 0 0 , 0 1 1 , 1 0 1 , 0 0 1 .

P r o o f : Th e

" i f "

p a r t i s a known r e s u l t

o f

o p e d w h i c h

i s

s i m p l e r a n d y i e l d s a r e s u l t

i n

O c t a l n u m b e r 7 6 5 0 3 5 1 .

72

= 1 4 3

A

l i n e a r

a l g e b r a .

To

p r o v e

t h e

" o n l y

i f , "

a s -

r e l a t i v e l y

s h o r t o r d e r . ( T h e a u t h o r n o t e s

1 s t i t e r a t i o n

- 1 4

s u m e t h a t

t h e c o n v e x

h u l l s o f t h e

l i n e a r l y

t h a t

h e

i s

n o t t h e o r i g i n a t o r ,

b u t t o h i s 1 s t i t e r a t i o n 6 2 5 0 3 5 1 .

6 2 - 2

= 1 2 4 s e p a r a t e d s e t s

S

a n d

S 2 i n t e r s e c t . T h e r e t h e n

k n o w l e d g e

t h i s t e c h n i q u e h a s n o t b e e n

p r e - A

e x i s t s

a t

l e a s t one

p o i n t p

w h i c h i a

convex

v i o us l y p ub li s he d. )

Th e t e c h n i q u e s e e m s

2 n d

i t e r a t i o n

-124

c o m b i n a t i o n

o f

a s e t o f p o i n t s f r o m

S I

a n d

n o v e l a n d w o r t h t h e a t t e n t i o n o f

PGEC

2 n d i t e r a t i o n 5 0 1 0 3 5 1 .

5 0 1

- 2

= 1 0 0 2

a l s o o f a s e t o f

p o i n t s f r o m S 2 . I t c a n

b e

r e a d e r s . Th e

f o l l o w i n g d e s c r i b e

t h e

3 r d i t e r a t i o n

- 1 0 0 2

s h o w n 4 t h a t

i f

e a c h

p o i n t a s e t

o f p o i n t s

p r o c e s s :

3 r d i t e r a t i o n 4 0 0 8 3 5 1 .

4 0 0 8 - 2

= 8 0 1 6 s a t i s f i e s a l i n e a r i n e q u a l i t y ,

t h e n a l l c o n v e x

I ) O r g a n i z e

t h e b i n a r y

d i g i t s

i n g r o u p s

4 t h i t e r a t i o n -

A

c o m b i n a t i o n s o f t he s e p o in t s a l s o o b e y

t h e

o f

t h r e e , i n s e r t i n g

o n e o r t w o z e r o s a t

h

i t e r a t i o n

-

8 0 1 6

i n e q u a l i t y .

S i n c e

t h e r e e x i s t s

a

h y p e r p l a n e

m o s t s i g n i f i c a n t

e n d

i f r e q u i r e d .

4 t h

i t e r a t i o n

3 2 0 6 7 5 1 . 3 2 0 6 7 - 2 = 6 4 1 3 4 s e p a r a t i n g S I a n d

S 2 , t h i s d e t e r m i n e s a n

i n -

Convert each t h r e e b i t gr o up t o

i t s 5 t h

i t e r a t i o n -

A

equality s a t i s f i e d

by points

of S i , bu t no t

by

2 )

o t

eale

6 4 1 3 4

p o i n t s o f S 2 . T h e n , s i n c e p

i s

a c o n v e x c o m -

o c t a l

e q u i v a l e n t .

5 t h

i t e r a t i o n 2 5 6 5 4 1 1 .

2 5 6 5 4 1 - 2 = 5 1 3 0 8 2

b i n a t i o n o f a s e t o f

p o i n t s f r o m S i , p

m u s t

3 )

S e l e c t m o s t

s i g n i f i c a n t

o c t a l

d i g i t

a n d

A.

..

d o u b l e ,

u s i n g r a d i x

t e n

a r i t h m e t i c .

6 t h i t e r a t i o n -

5 1 3 0 8 2 s a t i s f y t h i s i n e q u a l i t y . S i n c e

p i s a

c o n v e x

4 ) S h i f t r e s u l t o f p r e v i o u s s t e p r i g h t o n e 6 t h i t e r a t i o n 2 0 5 2 3 2 9 .

e n d , d e s i r e d d e c i m a l

c o m b i n a t i o n o f p o i n t s

f r o m S 2 , p m u s t f a i l

t o

p o s i t i o n a n d

s u b t r a c t f r o m o p e r a n d .

n u m b e r .

s a t i s f y t h i s i n e q u a l i t y . T h i s

i s

c o n t r a d i c t o r y ,

5 )

S e l e c t

m o s t a n d n e x t - t o - m o s t s i g -

C o n c l u s i o n :

T h e

t e c h n i q u e

d e s c r i b e d

i s

a t h e r e f o r e

S

a n d

S 2

a r e

n o t

l i n e a r l y

n i f i c a n t

d i g i t s

o f

n e w l y

f o r m e d

o p -

s i m p l e r

t h a n t h e

r e c u r s i v e

p r o c e s s

o f

a d d i n g

e r a n d l , d l o u b l e

u s i n g

r a d i l x

t e n a n t h -

m e t i c ,

a n d o r e p e a t s t e p

f o u r .

i n o c t a l c o e f f i c i e n t s a n d

m u l t i p l y i n g b y C o r o l l a r y :

I f t h e r e

e x i s t s a t l e a s t

o n e

6 )

Th e

f i n a l s u b t r a c t i o n

o c c u r s w h e n

t h e

e i g h t , because multiplication

by e i g h t i s point w h i c h

i s a c onv ex

combination

o f

s h i f t e d d u p l a t i o n

r e g i s t e r s i t s

L e a s t

m o r e c o m p l e x than

by two. The process o f

points f r o m

S i

a nd w h i c h

i s

a l s o a

c onv ex

S i g n i f i c a n t

D i g i t (LSD) u n d e r

t h e

s u b t r a c t i o n i s comparable

t o e x c e p t

combination o f p o i n t s from S 2 , then

S i

a nd

LS D o f t h e o p e r a n d Th e number

i n

that n u m b e r s with m o r e d i g i t s ar e sub-

S 2 ar e n t l i n e a r l y

separated.

L S D o f t h e

e s i r e d

e r a n d .

Sr e t

h e

r

i n

t r a c t e d .

t h e

d e s i r e d r a d i x i s

r e p r e s e n t e d

b y

t h e

O n e

m a y

n o t e

t h a t t h i s m e t h o d

i s

f e a s i b l e

A n a l g e b r a i c t e s t f o r l i n e a r s e p a r a t i o n

f i n a l

o p e r a n d ,

i . e . ,

t h e r e s u l t

o f t h e

f o r c o n v e r s i o n

o f o t h e r r a d i c e s .

H o w e v e r ,

t h e

can be o b t a i n e d from t h i s c o r o l l a r y w h i c h

f i n a l s u b t r a c t i o n .

f a c t o r , d e l t a ( 8

= q - p ) ,

may

b e a l t e r e d .

l e a d s t o a s e t

o f n+2 l i n e a r e q u a t i o n s i n

m

S u m n m a r y :

F o r e a c h

i t h

i t e r a t i o n , s e l e c t

J O H N

t .

C o r p

u n k n o w n s , w h e r e n i s t h e

d i m e n s i o n a l i t y

o f

t h e m o s t

s i g n i f i c a n t d i g i t s ,

d o u b l e ,

s h i f t

I n t e r n a t i o n a l E l e c t r c

C o r p .

t h e s p a c e , a n d

m i s t h e t o t a l

n u m b e r

o f

r i g h t

o n e

p o s i t i o n ,

a n d s u b t r a c t f r o m

o p -

P a r a m u s , N J - p o i n t s i n

S i

a n d S 2 .

I f t h e s e e q u a t i o n s

h a v e

e r a n d

t o f o r m new

o p e r a n d .

W h en LSDs o f

a

n o n - n e g a t i v e s o l u t i o n ,

t h e n t h e s e t s

a r e

s u b t r a h e n d a n d

o p e r a n d

a r e

i n

s a m e p o s i -

n o t

l i n e a r l y s e p a r a t e d .

T h i s s e t o f

l i n e a r

t i o n ,

t h e

f i n a l

o p e r a n d

i s

t h e

d e c i m a l

e q u i v a -

e q u a t i o n s

i s

d e v e l o p e d

a s

f o l l o w s .

l e n t

o f

t h e

o r i g i n a l o c t a l n u m b e r .

L e t

p

b e

a

p o i n t

c o n t a i n e d

i n

t h e

convex

A n a l y s i s :

h u l l s

o f

b o t h

S i

a n d

S 2

( i f

s u c h a

p o i n t

e x i s t s ) .

Then

p

m u s t

b e

a convex c o m b i n a -

a i p i

=

a , p n

+-

a , ,

.

P n -

.

t i o n o f

p o i n t s

f r o m

S

a n d a l s o o f

p o i n t s

f r o m

o Y P

=

S 2 .

L e t t h e r e

b e

mi

p o i n t s

i n S I a n d

m p o i n t s

i n S 2 . L e t C j k

r e p r e s e n t

t h e

k t h c o o r d i na te

- 1 -

A N o t e on L i n e a r S e p a r a t i o n *

o f t h e

j t h p o i n t ,

w h e r e

we

d i s t i n g u i s h

b e -

m

A

Note

on

Linear

S e p a r a t i o n *

t w e e n t h e

s e t s b y s p e c i f y i n g

t h a t t h e r a n g e

N

q

b i - q i

=

b . -

q m

+

bmi

. q m - 1

. +

.

M c N a u g h t o n 1

h a s

p o i n t e d

o u t

t he n ee d

o f

j

o v e r

S i

i s f r o m

1

t o

m i ,

a n d o v e r

S 2

i s

°

f o r

a l g o r i t h m

t o d e t e r m i n e w h e t h e r t w o

f r o m

m i ± l

t o

m ± m M 2 =

m.

T h e n t h e r e i s

+ b o . q

s e t s

o f p o i n t s i n a n n - d i m e n s i o n a l E u c l i d e a n

a s s o c i a t e d

w it h e a c h p o i n t a

n o n - n e g a t i v e

s p a c e a r e

l i n e a r l y

s e p a r a t e d , i . e . , may b e

p e r -

w h e r e

N 5 i s e q u i v a l e n t

t o N 5 . f e c t l y

s e p a r a t e d

b y a h y p e r p l a n e i n

t h e

s t a t e m e n t o n e i t e r a t i o n o f t h e r e - n - d i m e n s i o n a l s p a c e .

He s u g g e s t s a n

a l -

c ur s iv e p ro c es s d e s c r i b i n g

t h i s p r o p o s e d s o - g o r i t h m

f o r p o i n t s w i t h b i n a r y

c o o r d i n a t e s

l u l t i o n

c a n

b e e x p r e s s e d .

2 T h e c o n v e x

h u l l o f a s e t

o f p o i n t s S i s t h e

s m a l l e s t

c o n v e x s e t

c o n t a i n i n g S . I t i s t h e s e t a l l

c o n v e x

i - 2

c o m b i n a t i o n s o f s e t s f p o i n t s f r o m

S . '

N - = ( r , - q

+ a , -

_-

6 . r )

* p i - l

+

E a c E p i ,

* R e c e i v e d b y t h e PGEC, J u l y 5 , 1 9 6 1 ; r e v i s e d

3 I A .

E .

T a y l o r ,

" I n t r o d u c t i o n

t o

F u n c t i o n a l

'

m a n u s c r i p t

r e c e i v e d , A u g u s t

1 4 .

1 9 6 1 .

A n a l y s i s , "

J o h n

W i l e y

a n d S o n s , I n c . , Ne w

Y o r k ,

1 R . McNaughton, " U n a t e

t r u t h f u nc t io n s , " I R E N . Y . ;

1 9 5 8 .

T R A N S . ON ELECTRONIC COMPUTERS,

v o l . E R C - l 0 ,

P P .

4

S . I .

G a s s ,

" L i n e a r P r o g r a m m i n g , "

McGraw-

*

R e c e i v e d by t h e

PGEC,

A u g u s t 2 8 , 1 9 6 1 .

1 - 6 ; M a r c h . 1 9 6 1 .

H i l l Book C O . , I n c . , Ne w Y o r k , N .

Y . ;

1 9 5 8 .