fiÊP^«^w
Pf
Wàmm
tnh 1
¡PII
tølM&ffiS&rø»
COMMISSION OF THE EUROPEAN COMMUNITIES
raiMwwlu^Nl« faifa:
ITERATIVE ARRAYS FOR CODE CONVERSIONS
mm
by
M. COMBET
m&m
MmmmèL·*
Joint Nuclear Research Centre Ispra Establishment - Italy
mmm mm mmPmw^^mm Wwm
«MtcllE S S ÍSP
w?
FALSOS
*
mv mWml·
A l i l i » liilP^Äiaii
mm
ail^pä
^SiliÌ!ÌÌiÌÌei^
E G A L N0Tici
!lfÈ^*
This document was prepared under the sponsorship of the Commission
of the European Communities. ' | | »
Neither the Commission of the European Communities, its contractors nor any person-acting on their behalf:
Ïttillwint'TliiSi uiUiit¡¡ta)U'k * ¡4 SJlii "iTTiSftlWalPfø
4908 e
ITERATIVE ARRAYS FOR CODE CONVERSIONS by M. COMBET
Commission of the European Communities
Joint Nuclear Research Centre - Ispra Establishment (Italy) Technology
Luxembourg, November 1972 - 22 Pages - 15 Figures - B.Fr. 40.—
This paper describes a division matrix which can be used for the conversion of numbers written in base a in their equivalent in base b.
The description of the elementary cell and the matrix is made with their mathematical expressions.
Application to the conversion of codes is made with examples for the Iinary to decimal conversion and vice-versa.
4908 e
ITERATIVE ARRAYS FOR CODE CONVERSIONS by M. COMBET
Commission of the European Communities
Joint Nuclear Research Centre - Ispra Establishment (Italy) Technology
Luxembourg, November 1972 - 22 Pages - 15 Figures - B.Fr. 40.—
This paper describes a division matrix which can be used for the conversion of numbers written in base a in their equivalent in base b.
The description of the elementary cell and the matrix is made with their mathematical expressions.
EUR 4908 e
COMMISSION OF THE EUROPEAN COMMUNITIES
ITERATIVE ARRAYS FOR CODE CONVERSIONS
by
M. COMBET
1972
Joint Nuclear Research Centre Ispra Establishment - Italy
ABSTRACT
This paper describes a division matrix which can be used for the conversion of numbers written in base a in their equivalent in base b.
The description of the elementary cell and the matrix is made with their mathematical expressions.
Application to the conversion of codes is made with examples for the Iinary to decimal «onversion and vice-versa.
KEYWORDS
ITERATIVE METHODS MATHEMATICAL OPERATORS MATHEMATICS DIGITAL COMPUTERS
s
-TABLE OF CONTENTS
1. Introduction 5
2. Division Matrix 6 2.1 Elementary cell 6
2.2 Division Matrix 7
2. 3 Example 9
3. Code conversion 11
3.1 Integers 11 3.2 Fractionnai numbers 11
3.3 Examples 12
4. Example for BCD Code 17
4.1 Minimisation of the functions 18 4.2 Cell and matrix in I 2 4,Β code 18
5
-I. INTRODUCTION *)
Iterative arrays offer lot of new possibilities for the logical design.
Such circuits, which will be realised in a next future are very usefull for parallel arithmetical operations in the computers.
This paper describes a division matrix which can be U3ed for the conversion of numbers written in base a in their equivalent in base b.
The description of the elementary cell and the matrix is made with their mathematical expressions.
Application to the conversion of codes is made with examples for the binary to decimal conversion and vice-versa.
6
2. DIVISION MATRIX
The division matrix and its elementary cell are n o w described.
2.1 Elementary Cell
Elementary cell is a mathematical operator which com putes quotient and remainder of a division .
Bi.
A;
*[au.b]
nu, ·Q U O T
Rt h
Fig; I. Elementary Cell
This cell has 2 inputs: an horizontal one on which it receives digit Au in base a and a vertical one. Bt
in base b .
Such a cell computes the division of Au + a.B¿ by b
and gives the quotient on A;.+1output ( in base a ) and
the remainder on B^v1 output ( in base b ) .
Mathematical expressions of such a division may be done by using modulo operations.
The remainder can be expressed in the following way
and the quotient A. —
b
Λ
t à. · B i j r*\o¿ b
A, ■* a.. B L ( Au 4. a.B.
Γ A·,.
+ a.
Bi· Β
L+^Jm o d Ι b
7
see in the following paragraphs.
Inputs and outputs are actually made of several wires
when number is expressed with bits I and 0 ( for ins
tance 4 wires at least will be necessary for represen
ting decimal digits ). But relations between inputs
A;.and B;_ and the outputs A^+, and B^i will be always
the same.
2.2 Division Matrix
A matrix can be now buildt w^ith m rows of n
identical cells and connected as indicated in Fig. 2
5.
B;
e,
1A,
r
1 '
r
Γι ι 1
[a., oj
I
\*M * /»:
[â,bj
Λ
A [a .b]
Β :
[ÌM
ι
- ß o - . y
.J
Β,
Fig. 2 Division Matrix
A
■ m i d
Now, let us consider the first comumn of the matrix
( Fig. 3 ) . It is obvious that this column will divide
by b a number of which each digit is entered in the
A;,inputs successively, most sigificant digit in the
top cell.
If B"0 = 0, most significant digit is divided by b
in the first cell where it sends the remainder to the
second cell . The remainder is added to the second digit
after multiplication by a and divided by b, etc..
This method is identical to that we use when we divide
[i. b J
8
-A: •s
u
v¡>,
Ό
-Λ J
A' Ca.,bj — ι -Λ.?A.
- [a.b] -Ι Λ
Α.
[a>]
s:
La-Λ]
~~Γ"
3*
Fig. 3 - Column division.
When Bo fO, the top cell divides A0 + a.Bc and we must
correct the preceding results by adding a.B0 to A0
But A,, = AD.a + A0 .a + .... A0 .a
v/here A has a coefficient a ; then, we must add
a .a.B0 = a .B0to Ae and say that the first column
rvi Λ
divides A0 + a ,B0 by b, the quotient is A^ and the
remainder B? .
B^ = ( Ao + &η"·Βΐ )mod b
A, = -( A0+ a ,BD- B „J
When two columns of cells are involved, we have two successives division, but term B enters only in the second division.
We can write for every division :
A0 + a~.B¿ = A, .b + Bl
A. a .B, = A,.b Eleminating A0 , it yields :
B Ì
9
When the n columns of the complete matrix are
involved, we can write the expressions for every
division and replace succesively every quotient in the
following expression; finally, we get :
A0 + a.B0 + a";B0b + . . . + a B0b =
=An.b + B^ + B^b + + B„ b
Ap + a ( B0b° + B ' b1+ + B0bn1) = A„. b +(B^b + B^b + + B^b J
Now, t h e f i r s t p a r e n t h e s i s i s B0, the second B ^
A0 + a " . B0 = An. b " + B „
An i s the q u o t i e n t and B^the r e m a i n d e r of the d i v i s i o n
of A0 + a ^ . B . by b n
B», A , = = o ( 1 b A0 « < + KYI a
A0 +
■ Β σ
ru
a .
)mo
B0
d
-bn
Bw )
2 . 3 Example
An example i s now g i v e n when a = 10 and b = 2;
A;.are d e c i m a l d i g i t s 0 , 1 , 2 , . . , 9 an9s B¡.is 0 o r I .
Twenty c a s e s a r e p o s s i b l e of which we g i v e the l i s t
w i t h the c o r r e s p o n d i n g o u t p u t s . Tor L k ce-LL·
A; 0 I 2 3 4 5 6 7 8 9 0 I 2 3 4 B, 0 0 0 0 0 0 0 0 0 0 I I I I I
AL Bi
10
-Ai*-i B i*
5 6 7 8 9 I I I I I 7 8 8 9 9 I 0 I 0 I
Indeed, the cell [l0,2] divides AL + 10. BLby 2
AC41is the quotient and B^ + 1the remainder.
Using tie matrix Fig. 4, on which we put
k0 = 237 base 10 B0= H O base 2 ( = 6 )
we can write the various values on the different points of the matrix, using the preceding table, and get the quotient 779 and the remainder 101 ( = 5τ η ).
This matrix has divided 237 + 10 .6 = 6237 by 2^ = 8 the quotient is 779, and the remainder 5.
•
1
3
-?
[image:14.595.54.548.29.767.2]-« 3 1
K*]
o [4»,l] 1 'M Λ -1 d Λ 1 \}°A \ 1• Ι " 4
Ι S S 9 , 1 ' ι [ic, q Ί [,D,l] 1
Γ . τ
[ Ί » y
- 7
- 1 m S d
- 11
-3. CODE CONVERSION
A division matrix may be very usefull for the conversion of a number written in code a into its equivalent in
code b. Integers and number less than I have to be considered separately.
3.1 Integers
For this purpose, we put the number to be converted at input A,, and we take B0 = 0.
We can notice that the successive quotients A^, A , will be more and more small, and if the number of
columns is large enough, the last quotients will be 0. Making Bö= 0 and A„= 0, in the expression giving A„,
it yields :
0 = 4-„U
0+a\0 - B
m)
A0 = B„Bmhas the same value as Ac, but written in code b
The number n of columns necessary wil be given by noticing in your preceding example, that the largest decimal number with 3 digits may be 999; this number divided by 2 = 1024 will give 0, as a quotient, and 10 columns are necessary.
In the general case, we must have
am- I>/bn
n >L° ^ " - ^
Lou b 3.2 Fractionnai numbers
The same matrix may be used for converting numbers less than I, written in 'base b in their equivalent in base a
If the matrix has an adequate number of rows, we feed the number B to be converted in the inputs B0, and
12
-A . m .
Α. = Τ^Γ ( ° +ο a -Bo" Ο )
. ' . Α = —-Β
a~ η b* °
— A„is a number of which the point is just before the
a"
nmost significant digit.
In the case of fractionnai numbers, it is not always possible to have an adequate number· of rows, because the numbers of digit may be infinite, if m rows are involved, the preceding formula becomes :
Λ Δ ή (
ρ
luS~ãr n
~
b" v°
ÔTJ -gm must be large enough to give the error — — less
a
than the required precision.
Therefore, an [a,b]matrix converts integers from base a into base b and fractionnai numbers from base b into base a.
If, now, we need convert integers from base b into base a and fractionnai numbers from base a into base b,we
have to design a new matrix of which th elementary cell will have parameters permutated.
3.3 Examples
We will designed the two matrices for the conversion of numbers, integers and fractionnais, from binary into decimal and vice-versa.
Fig. 5 shows the cell[l0,2] , its table (Fig. 6 ) and the matrix [IO, 2] converting I3 (base IO) and 0,011 (base 2 ) (Fig. 7)
Fig. 8 shows the cell[2,I0] , its table (Fig. 9) and the matrix [2, IO] converting H O I (base 2) and 0,375
13
-A
L,
( d e c )
B . (b
i
[<10,l]
\ '
i r\\
^ Π Ι . » 1
( d c . )
Quoi.
lo /?/ z
3 · ( b u n )
F i g . 5 Cell [lO,2J
AL 0 I 2 3 4 5 6 7 8 9 0 I 2 3 4 5 6 7 8 9 Β 0 0 0 0 0 0 0 0 0 0 I I I I I I I I I I
A if\ Β ι +■
0 0 I I 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 0 I 0 I 0 I 0 I 0 I 0 I 0 I 0 I 0 I 0 I
[image:17.595.103.543.43.783.2]14
-1 - Ë o, £| Β°.ζ·] [ι ο, ¿3 [ι ο, ¿J _
ο
3> frø,*.] [ι ο, ζ] {^°, 2-] [10.L]
1
-13 ί ο -=? 11 01
ο £>q¿] [-10,2.] Τ- [IO,L]
Ο - Ίο ,ι) - -->-
h
2·]
^
[,o,t]
7
Ο
Ο
Γ-
1°,
¿]
b
0
·^
-7
V
o
[·*«,£[
O
O. O H , > O 3 ? 5„
/ 2. ι -io
[image:18.595.59.553.22.774.2]15
-D Ì η)
Έ,
(à,.)
i
[2,1
o)
I
BL + , (d
Ι?£Μ. Λ . +
F i g .
Αϊ 0 0 0 0 0 0 0 0 0 0 I I I I I I I I I I
8 - C e l l [
Bu A,
0 0 1 0 2 0 3 0 4 0 5 I 6 I 7 I 8 I 9 I 0 0 1 0 2 0 3 0 4 0 5 I 6 I 7 I 8 I 9 I
( b i n )
e c j
2,10]
. 1 J J ¿ , Λ
0 2 4 6 8 0 2 4. 6 8 I 3 5 7 9 I 3 5 7 9
Qu or A,+ 2 8. <;7o
16
-1 - [2, -/o \Z, -lo - O
1 - [ 2 , 4 0 0,ΊΟ _ o
0 f^. -ίο
o
\ '
[¿,-fo _
6 '
1 ι Z,10 ¿,10
— o
Λ 1 O Λ
13
3 '
O ¿,10 1 ¿. 1o Ί ¿^e — O
O 2 , 1 0 O Í.'lo -7
- > - ¿,1o 1
o — \ /
2,-ío O 2,-70 O - >
V
¿,10 \— 1
o
O, 3 7 5 — ? 0 0 1 - 7
17
4. EXAMPLE FOR BCD CODE
Now, we must show how to realise the elementary cell
with electronic components.
As we must use a representation of numbers with bits,
inputs and outputs of the cell will have more than I
wire when numbers have a base more than 2.
As an example, we shal compute the circuitry of a
[l0,2]cell when 1,2,4,8 BCD code is used.
We shalL write the table of this cell in this code :
't 0 0 0 0 0 0 0 0 I Î 0 0 0 0 0 0 0 0 I I ζ 0 0 0 0 I I I I 0 0 0 0 0 0 I I I I 0 0 AL y 0 0 I I 0 0 I I 0 0 0 0 I I 0 Ü I
τ
0 0 X 0 I 0 I 0 I 0 Τ 0 I 0 I 0 I 0 I 0 I 0 I B : 0 0 0 0 0 0 0 0 0 0 I I I I I I I I I I Τ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I I I I A ζ 0 0 0 0 0 0 0 0 I I I I I I Τ I 0 0 0 0i + 1 Y 0 0 0 0 I I I I 0 0 0 0 I I I I 0 0 0 0
t
0 0 I I 0 0 T I 0 0 I I 0 0 I T 0 0 I I B 0 I 0 I 0 I 0 I 0 I 0 T 0 I 0 I 0 I 0 IFig. II 10,2 cell table in 1,2,4,8 code
We can consider Χ,Υ,Ζ,Τ and B¿t1 as "tooleean functions
18
-4»I Minimisation of the functions
Before beginning the minimisation, we will notice that Χ,Υ,Ζ and Τ don't depend of variable χ because when
considering the preceding table by group of 2 rows we see they are identical but x; thus, Χ,Υ,Ζ and Τ
are function of y,z,t and Β'u only.
We see also immediately, that:
BL*') = x
Now, Χ,Υ,Ζ and Τ are minimised with Karnaugh's tables
b
r
o o h '\
(1—ΤΊ o o
UJ-
o .
p-η
-ψ
βι χ
ο ο ο Ο f
ι) oj o Q
- U
ß:
>
>
τ
7
BL
Ζ-ι
ο
ο
0
0
ο
ο
-ο -ο[
Τ| ο
I I "~)
-
ν
- ί
Su
Fig. 12 - Minimisation of Χ,Υ,Ζ and T.
The Boolean expressions of these functions are
X = BL.y + Bi.y
Y = BL.ζ + B^.y.z + y.ζ
Ζ = BL.t + BL.ζ.t + BL.y.t
T = Bl.t + Bo.y.z
BLT1= x
4.2 - Cell and matrix in 1,2,4,8 code
f oc
>-Il
y-y
• t
>4—I-L
- 19
fri
3>
L>
T
L>
v
3ν.Λ
X
r*y
ζ
TJ
Fig. 13 - Cell [io,2] in 1,2,4,8 code
ï
p . ι ■3 ;
I
ì
:
[ i ο, Ζ]
/ ι . Ζ Λ , ΐ )
f - > , 2 , U.1 )
1
G" ο, ¿]
Τ
"δ
ι
- 20
-i
,
[ΊΟ, ¿)A k
pi ot ζ] / ι , ζ, t,, f )
Λ
.E?
°>
¿1
τ
o
S
τ
y
ΓΤ-^ί
"F
* «
Χ
L"0, Ζ]
(".¿AO
1
\ 1 /
α
^
°' ¿i
Τ
Λ*
■ψ*
I
Ιί ζ
^>β·"fr* J
Fig. 14 - Example of Fig.4 in 1,2,4,8 code
5. ADVANTAGES OF DIVISION BEATRICES
The principal advantages of division matrices are now summarised
5.1 Conversion of integers and fractionnai numbers
Generally,converters can only convert integer or fractionnais numbers, but non both.
5.2 Unique circuit for conversion and reverse conversion Two matrices are needed for converting from base a in base b, and the same two matrices may be used for the reverse conversion
5.3 Various codes possible'
Cells may be easily designed for various representation of digits A and Β with bits (1,2,4,8 - 1,2,4,2 - excess 3 2 out of 5 - etc.. )
5.4 Expansibility
21
-Fig. 15 - Expansibility of matrices
ACKNOWLEDGMENTS
The author wishes to thank Mr Weinmiller for fruitful suggestions and Mr Boldrin for the constructive comments during the preparation of this manuscript.
il
ItiüMN O T I C E T O T H E READER
All scientific and technical reports published by the Commission of the European Communities are announced in the monthly periodical " e u r o - a b s t r a c t s " . For subscription (1 year : B.Fr. 1025,—) or free specimen copies please write to :
Office for Official P u b l i c a t i o n s of t h e E u r o p e a n C o m m u n i t i e s
Case postale 1003 L u x e m b o u r g 1
( G r a n d - D u c h y of L u x e m b o u r g )
"::::::·:
.
i To disseminate knowledge is to disseminate prosperity — I mean
general prosperity and not individual riches — and with prosperity
disappears the greater part of the evil which is our heritage from
\ darker times.
ι : : : : : : : : : : : : : : : : : : : : : : : : · '
mmm
Iff
Ι β
mm
¡il;
'ÄlilSl
iSAr«||í¡ ·
SALES OFFICES
mM
The Office f o r Official Publications sells all documents published by t h e Commission of t h e European Communities at the addresses listed below, at the price given on cover. When ordering, specify clearly t h e exact reference and the t i t l e of the document.
·"' "J'TL. ΓτϊΙ.
mil·*
ΛüfiiBtüt;'·1 *
COMMONWEALTH
H.M. Stationery Office
P.O. Box 569
London S.E. 1
U N I T E D STATES OF A M E R I C A
European Community Information Service
2 1 0 0 M Street, N.W. Suite 707
Washington, D.C 20 0 3 7
mmi mm'* mww
TH ITALY
BELGIUM
¿iAt ; H I · »t o , r
mm
Moniteur belge — Belgisch Staatsblad
Rue de Louvain 4 0 - 4 2 — Leuvenseweg 4 0 - 4 2 1000 Bruxelles — 1000 Brussel — Tel. 12 00 26
CCP 50-80 — Postgiro 5 0 - 8 0
Agency :
Librairie européenne — Europese Boekhandel Rue de la Loi 244 — Wetstraat 2 4 4 1040 Bruxelles — 1040 Brussel
00198 Roma — T e l . (6) 85 09 / 2 6 4 0
'
iw4
Agencies :
00187 Roma — Via del Tritone 61 / A e 61 / Β 00187 Roma — Via XX Settembre (Palazzo
Ministero delle finanze) 20121 Milano — G a l l e r i a Vittorio Emanuele 3
80121 Napoli — V i a Chiaia 5 50129 Firenze — V i a Cavour 4 6 / R 16121 Genova — V i a XII Ottobre 1 7 2
4 0 1 2 5 Bologna — Strada Maggiore 2 3 / A
NETHERLANDS
Staatsdrukkerij- en uitgeveri/bedrljf
Christoffel Plantijnstraat
's-Gravenhage — Tel. (070) 81 4 5 1 1
Giro 425 300
IRELAND
im
tornff.mwm
GRAND DUCHY OF LUXEMBOURGOffice for official publications of the European Communities
Case postale 1003 — Luxembourg 1
and 29, rue Aldringen, Library
Tel. 4 79 41 — C C P 1 9 1 - 9 0
Compte courant bancaire: BIL 8 - 1 0 9 / 6 0 0 3 / 2 0 0
íftf
ùiatione
Beggar'
«i.
JRG SWITZERL
Stationery Office
s Bush
4
SWITZERLAND
Librairie Payot
6, rue Grenus 1211 Genève CCP 1 2 - 2 3 6 Genève
SWEDEN
w
LSffîëi]
A
FRANCE
Service de vente en France des publications des Communautés européennes
» i l l l
fropéennes26, rue Desaix
75 Paris-15· — Tel. (1) 306.5100
CCP Paris
Librairie CE. Fritze
2 , Fredsgatan Stockholm 1 6
Post Giro 193, Bank Giro 7 3 / 4 0 1 5
SPAIN
5^.(1)306.5100 Libreria Mundi-Prensa
Μ ?1! ,0;3 7
GERMANY (FR)
Verlag Bundesanzeiger
5 Köln 1 — P o s t f a c h 108 0 0 6
Tel. (0221) 21 03 48
Telex ; Anzeiger Bonn 08 8 8 2 595
Postscheckkonto 834 00 Köln
ι·> , ' * " ' ä [ '
OTHER COUNTRIES
1
ii 't U W . r (^
Í
m e x ; «nzeiger Bonn υο 00¿ 03D Postscheckkonto 834 00 KölnÄ i
mmm.
"#ltf!§ÍÉ
feaiiièi
i l l
Sales Office for official publications of the European Communities
Case postale 1003 — Luxembourg
Tel. 4 79 41 — CCP 1 9 1 - 9 0
Compte courant bancaire: BIL 8 - 1 0 9 / 6 0 0 3 / 2 0 0
illiiiiillií
OFFICE FOR OFFICIAL PUBLICATIONS OF THE EUROPEAN C O M M U N I T I E S Case postale 1003 — Luxembourg 1 _ „ , . .