Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2820701B2 - Conversion method to binary - Google Patents
[go: Go Back, main page]

JP2820701B2 - Conversion method to binary - Google Patents

Conversion method to binary

Info

Publication number
JP2820701B2
JP2820701B2 JP63308059A JP30805988A JP2820701B2 JP 2820701 B2 JP2820701 B2 JP 2820701B2 JP 63308059 A JP63308059 A JP 63308059A JP 30805988 A JP30805988 A JP 30805988A JP 2820701 B2 JP2820701 B2 JP 2820701B2
Authority
JP
Japan
Prior art keywords
binary
unit
decimal
register
digit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP63308059A
Other languages
Japanese (ja)
Other versions
JPH02154530A (en
Inventor
亨 竹下
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP63308059A priority Critical patent/JP2820701B2/en
Publication of JPH02154530A publication Critical patent/JPH02154530A/en
Application granted granted Critical
Publication of JP2820701B2 publication Critical patent/JP2820701B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Analogue/Digital Conversion (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は情報処理装置における10進数を処理のため
2進数への変換方法に関する。
The present invention relates to a method for converting a decimal number into a binary number for processing in an information processing apparatus.

〔従来の技術〕[Conventional technology]

第3図は従来の情報処理装置の要部のブロック図であ
り、図において、1は演算ユニット(ALU)、2は乗算
ユニット(MPY)、3はレジスタファイルで、4はX−
バス(X-Bus)、5はYバス(Y-Bus)、6はZバス(Z-
Bus)である。
FIG. 3 is a block diagram of a main part of a conventional information processing apparatus. In FIG. 3, 1 is an arithmetic unit (ALU), 2 is a multiplication unit (MPY), 3 is a register file, and 4 is an X-
Bus (X-Bus), 5 is Y bus (Y-Bus), 6 is Z bus (Z-Bus)
Bus).

次にこの情報処理装置のファームウェアの動作につい
て説明する。今10桁の10進数を2進数に変換するものと
すると32ビットの2進数となる。
Next, the operation of the firmware of the information processing apparatus will be described. If a 10-digit decimal number is converted to a binary number, the result is a 32-bit binary number.

例えば、 4,294,967,296(10進数)→111……11(2進数)の変
換を行うものとする。
For example, it is assumed that conversion of 4,294,967,296 (decimal number) → 111... 11 (binary number) is performed.

4,294,967,296=4×109+2× 108+9×107+4×106+9×105+ 6×104+7×103+2×102+9×101 +6×100(上位桁→下位桁) =6×100+9×101+2×102+7× 103+6×104+9×105+4×106+ 9×107+2×108+4×109 (下位桁→上位桁)……(1) であるので夫々の係数を4ビットの2進で、又各桁数
を必要なビットの2進数で表わし、これらの積を各桁ご
とに求め、2進数でのそれらの総和を取って10進数を2
進数に変換する。
4,294,967,296 = 4 × 10 9 + 2 × 10 8 + 9 × 10 7 + 4 × 10 6 + 9 × 10 5 + 6 × 10 4 + 7 × 10 3 + 2 × 10 2 + 9 × 10 1 + 6 × 10 0 (upper digit → lower digit) = 6 × 10 0 + 9 × 10 1 + 2 × 10 2 + 7 × 10 3 + 6 × 10 4 + 9 × 10 5 + 4 × 10 6 + 9 × 10 7 + 2 × 10 8 + 4 × 10 9 (lower digit → higher digit) ... .. (1), each coefficient is represented by a 4-bit binary number, and the number of digits is represented by a required bit binary number. The product of these is obtained for each digit, and the sum of the binary numbers is calculated. Take decimal number 2
Convert to a decimal number.

以上を一般式で表わすと、10桁の10進数をa9 a8 a7 a
6 a5 a4 a3 a2 a1 a0 S(但しS:符号)で表わすと、演
算ユニット1によりai→Aiを取り出す。ここでi=0〜
9でAは4ビット2進数である。
When the above is expressed by a general formula, a 10-digit decimal number is a 9 a 8 a 7 a
When expressed by 6 a 5 a 4 a 3 a 2 a 1 a 0 S (where S: sign), the arithmetic unit 1 extracts a i → A i . Where i = 0
At 9, A is a 4-bit binary number.

次に、乗算ユニット2によりAiとBiを乗算する。Bi
10進の10i(i=0〜9)対応の2進数である。この計
算を各桁ごとに10回行い、各積Ai×Biをレジスタユニッ
ト3に格納し、次に演算ユニット1でΣAi×Biを、即ち
A0×B0(10進100相等)+A1×B1(10進101相等)+……
+A9×B9(10進109対応)を求める。
Next, the multiplication unit 2 multiplies A i by B i . B i
This is a binary number corresponding to decimal 10 i (i = 0 to 9). This calculation is performed 10 times for each digit, each product A i × B i is stored in the register unit 3, and then 演算 A i × B i is calculated by the arithmetic unit 1, that is,
A 0 × B 0 (10 decimal 10 0 phase etc.) + A 1 × B 1 (10 decimal 10 1 equality) + ......
+ A 9 × B 9 (10 9 decimal)

その後、演算ユニット1により例外処理を行い、又2
進数変換時に、符号が負の場合は補数に変換する。
After that, exception processing is performed by the arithmetic unit 1 and 2
At the time of base conversion, if the sign is negative, it is converted to complement.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

従来のファームウェアでは10進数を2進数に変換する
のに処理時間が長くなるという問題があった。
The conventional firmware has a problem that the processing time is long to convert a decimal number into a binary number.

この発明は上記問題点を解決するためになされたもの
で、10進数から2進数への変換を高速化するとともに、
2進データが32ビットを超える10進パックデータに対し
ても容易に処理が可能な2進数への変換方法を提供する
ことを目的としている。
The present invention has been made in order to solve the above-mentioned problems, and speeds up the conversion from decimal numbers to binary numbers.
It is an object of the present invention to provide a method of converting a decimal packed data whose binary data exceeds 32 bits into a binary number which can be easily processed.

〔課題が解決するための手段〕[Means for solving the problem]

この発明においては、第2図に示すように、与えられ
たn桁の10進数 an an-1…ai ai-1…a1 a0をi桁数毎に演算ユニット
1で10進数の(an×10n+…),(…+a2i×102i),
(a2i-1× 102i-1+…+ai×10i),(ai-1× 10i-1+…+a1×101+a0×100) へと分割して、レジスタユニット3へ夫々格納し、こ
れらのi桁数毎の10進数を該レジスタユニット3から順
次取り出し、2進数変換ユニット8により夫々対応する
i桁数毎の2進数 (An+……),(……A3i),(A3i-1+……A2i),
(A2i-1+Ai),(Ai-1+……A1+A0)へ夫々順次一括
変換し、該レジスタユニット3へ格納する。次に、予め
該レジスタユニット3に記憶しておいた各10進数……,
103i,102i,10i対応の各2進数……,B3i,B2i,Biを夫々
取り出し、各i桁数毎の2進数と乗算ユニット2で順次
乗算し、 …,(A4i-1+A3i)×B3i,(A3i-1+……A2i)×
B2i,(A2i-1+…+Ai+1+Ai)Biを夫々求め、順次レジ
スタユニット3へ格納し、これら全ての2進数及び最下
位のi桁数の2進数(Ai-1+……Ai+A0)を、該レジス
タユニット3から取り出し、演算ユニット3でこれらの
総和 …+(A4i-1×B3i+…+A3i×B3i)+ (A3i-1×B2i+…+A2i×B2i)+(Ai-1+…+A1
A0)を求めて、2進数を得るようにした。
In the present invention, as shown in FIG. 2, in decimal given n digit a n a n-1 ... a i a i-1 ... arithmetic unit 1 a 1 a 0 for each i digits 10 Base numbers (a n × 10 n + ...), (… + a 2i × 10 2i ),
(A 2i-1 × 10 2i-1 + ... + a i × 10 i ) and (a i-1 × 10 i-1 + ... + a 1 × 10 1 + a 0 × 10 0 ) 3 are sequentially stored in the register unit 3, and the binary numbers (A n +...), (. … A 3i ), (A 3i-1 + …… A 2i ),
(A 2i-1 + A i ) and (A i-1 +... A 1 + A 0 ) are sequentially batch-converted and stored in the register unit 3. Next, each decimal number previously stored in the register unit 3...
10 3i, 10 2i, 10 i each binary number corresponds ......, B 3i, B 2i, the B i respectively taken out, sequentially multiplies in binary and multiplication unit 2 for each i digits, ..., (A 4i -1 + A3i ) x B3i , ( A3i-1 + ... A2i ) x
B 2i , (A 2i-1 +... + A i + 1 + A i ) B i are obtained and stored in the register unit 3 sequentially, and all these binary numbers and the binary numbers (A i− 1 +... A i + A 0 ) is taken out from the register unit 3 and the arithmetic unit 3 sums them up... + (A 4i-1 × B 3i +... + A 3i × B 3i ) + (A 3i-1 × B 2i + ... + A 2i × B 2i) + (A i-1 + ... + A 1 +
A 0 ) was obtained to obtain a binary number.

〔作用〕[Action]

専用のi桁数の2進数変換ユニット8を設け、上位の
i桁数の(a2i-1×102i-1+…+ai×10i)の2進数への
変換を行い、(A2i-1+…Ai)を求める。この(A2i+…
+Ai)に10i対応の2進数Biを乗算ユニット2で乗じて
いるとき、並行して2進数変換ユニット8で下位のi桁
数(ai-1×10i-1+…+a1 101+a0 100)の2進数への
変換等を行うようにする。かして並列処理をn/i回行う
ため大きな桁数nの10進数を2進数に変換するような場
合高速となり、短時間内に処理が可能となる。
A dedicated i-digit binary conversion unit 8 is provided, and the higher-order i-digit number (a 2i-1 × 10 2i-1 +... + A i × 10 i ) is converted into a binary number, and (A 2i -1 +... A i ) This (A 2i + ...
When + A i) in are multiplied by 10 i corresponding binary B i by the multiplier unit 2, the lower i digits in binary conversion unit 8 in parallel (a i-1 × 10 i -1 + ... + a 1 10 1 + a 0 10 0 ) is converted to a binary number. Thus, since parallel processing is performed n / i times, when a decimal number having a large number of digits n is converted into a binary number, the processing speed is increased, and processing can be performed in a short time.

〔実施例〕〔Example〕

以下、この発明を図面を参照して説明する。 Hereinafter, the present invention will be described with reference to the drawings.

第1図は本発明が実行される情報処理装置の要部のブ
ロック図であり、図において、1は演算ユニット(AL
U)、2は乗算ユニット(MPY)、3はレジスタファイル
で、4はXバス(X-Bus)、5はYバス(Y-Bus)、6は
Zバス(Z-Bus)、8は2進数変換ユニットである。2
進数変換ユニット8は10進数の5桁毎に10進数を2進数
に変換する機能型の集積回路 (Format Convert LSI)である。
FIG. 1 is a block diagram of a main part of an information processing apparatus in which the present invention is executed. In FIG.
U), 2 is a multiplier unit (MPY), 3 is a register file, 4 is an X bus (X-Bus), 5 is a Y bus (Y-Bus), 6 is a Z bus (Z-Bus), and 8 is 2 It is a radix conversion unit. 2
The decimal conversion unit 8 is a functional integrated circuit (Format Convert LSI) that converts a decimal number into a binary number for every five digits of a decimal number.

演算ユニット1,乗算ユニット2及び2進数変換ユニッ
ト8の各入力側はXバス4,及びYバス5に接続され、こ
れらの出力側はZバス6に接続されている。演算ユニッ
ト1,乗算ユニット2及び2進数変換ユニット8の各演算
結果はZバス6を介してレジスタユニット3に与えら
れ、そこで格納される。レジスタユニット3の出力側は
Xバス4,Yバス5に接続され、演算ユニット1,乗算ユニ
ット2及び2進数変換ユニット8は必要なデータをレジ
スタユニット3から入力される。
Each input side of the arithmetic unit 1, the multiplication unit 2 and the binary number conversion unit 8 is connected to the X bus 4 and the Y bus 5, and the output side thereof is connected to the Z bus 6. The operation results of the operation unit 1, the multiplication unit 2 and the binary conversion unit 8 are applied to the register unit 3 via the Z bus 6 and stored there. The output side of the register unit 3 is connected to the X bus 4 and the Y bus 5, and the arithmetic unit 1, the multiplication unit 2 and the binary number conversion unit 8 receive necessary data from the register unit 3.

次に本装置におけるファームウェアの動作について第
2図に従って説明する。
Next, the operation of the firmware in this apparatus will be described with reference to FIG.

今10桁の10進数 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 S(但しS:符号)を3
2ビットの2進数に変換するものとする。
Now 10-digit decimal number a 9 a 8 a 7 a 6 a 5 a 4 a 3 a 2 a 1 a 0 S (where S: sign) is 3
It shall be converted to a 2-bit binary number.

ステップS1では、レジスタユニット3から10進数の上
位5桁のデータa9 a8 a7 a6 a5を取り出し、2進数変換
ユニット8にて一括して2進数変換を行う。即ち A9×B4+A8×B3+A7×B2+A6×B1+A5×B0を得る。こ
こでAi(i=5〜9)はai(i=5〜9)の対応2進数
で、Bi(i=0〜4)は10i(i=0〜4)の対応2進
数である。ステップS2ではこの A9×B4+A8×B3+…+A5×B0をレジスタユニット3の
ワークレジスタ(WR10)へ格納する。
In step S 1 , the upper five digits of data a 9 a 8 a 7 a 6 a 5 of the decimal number are extracted from the register unit 3, and the binary number conversion unit 8 performs the binary conversion in a lump. That is, A 9 × B 4 + A 8 × B 3 + A 7 × B 2 + A 6 × B 1 + A 5 × B 0 are obtained. Here, A i (i = 5 to 9) is a corresponding binary number of a i (i = 5 to 9), and B i (i = 0 to 4) is a corresponding binary number of 10 i (i = 0 to 4). It is. In step S 2 stores the A 9 × B 4 + A 8 × B 3 + ... + A 5 × B 0 of register unit 3 to the work register (WR10).

ここでは同時に、32ビット符号は2進数演算のオーバ
ーフローチェックを実行する。オーバーフローチェック
は2進数変換ユニット8内にて自動的にチェックし、判
定信号を出力しており、オーバーフローがあればシーケ
ンサーにてエラー処理へジャンプする。
Here, at the same time, the 32-bit code performs a binary arithmetic overflow check. In the overflow check, the binary number conversion unit 8 automatically checks and outputs a judgment signal. If there is an overflow, the sequencer jumps to error processing.

ステップS3では、予めレジスタユニット3のワークレ
ジスタ(WR0)に10進数の105に対応する2進数のB5が記
録されているので、レジスタユニット3のWR10からA9×
B4+A8×B3+…A5×B0を、WR0からB5(105対応)を夫々
取り出し、乗算ユニット2に入力し乗算 (A9×B4+A8×B3+…+A5×B0)×B5 =A9×B4×B5+A8×B3×B5+……+ A5×B0×B5 =A9×B9+A8×B8+……+A5×B5を行う。これは10進
数のa9×109+a8×108+……+a5×105を2進数に変換
したものである。このとき並列処理として、2進数変換
ユニット8では、レジスタユニット3から、10進数の下
位5桁のデータa4 a3 a2 a1 a0を取り出し、一括して2
進数変換を行う。即ち A4×B4+A3×B3+A2×B2+A1×B1+A0×B0を得る。こ
こでAi(i=0〜4)はai(i=0〜4)の対応2進数
で、Bi(i=0〜4)は10i(i=0〜4)の対応2進
数である。ここでは同時に、10進データ例外のチェック
も2進数変換ユニット8内にて自動的にチェックし、例
外があればシーケンサにてエラー処理へジャンプする。
In step S 3, since the binary B 5 corresponding to decimal 10 5 in advance register unit 3 of the work register (WR0) are recorded, A 9 × from WR10 register unit 3
B 4 + A 8 × B 3 + ... A 5 × B 0 and B 5 (corresponding to 10 5 ) are extracted from WR0 and input to the multiplication unit 2 for multiplication (A 9 × B 4 + A 8 × B 3 + ... + A 5 × B 0 ) × B 5 = A 9 × B 4 × B 5 + A 8 × B 3 × B 5 + …… + A 5 × B 0 × B 5 = A 9 × B 9 + A 8 × B 8 +… ... + A 5 × B 5 is performed. This is obtained by converting a decimal number a 9 × 10 9 + a 8 × 10 8 +... + A 5 × 10 5 into a binary number. At this time, as the parallel processing, the binary number conversion unit 8 extracts the lower five digits of the decimal number data a 4 a 3 a 2 a 1 a 0 from the register unit 3,
Performs radix conversion. That is, A 4 × B 4 + A 3 × B 3 + A 2 × B 2 + A 1 × B 1 + A 0 × B 0 are obtained. Here in A i (i = 0~4) corresponding binary a i (i = 0~4), B i (i = 0~4) corresponding binary 10 i (i = 0~4) It is. Here, at the same time, a check for a decimal data exception is also automatically made in the binary conversion unit 8, and if there is an exception, the sequencer jumps to error processing.

ステップS4では、この A4×B4+A3×B3+……+A0×B0をレジスタユニットの
ワークレジスタWR10へ格納する。
In step S 4, and stores the A 4 × B 4 + A 3 × B 3 + ...... + A 0 × B 0 of register unit to work register WR10.

ステップS5では、ステップS3の前半の結果の上位5桁
A9×B9+A8×B8+……+A5×B5をレジスタユニットのワ
ークレジスタWR7へ格納する。
In step S 5, the results of the top five digits of the first half of the step S 3
Store A 9 × B 9 + A 8 × B 8 +... + A 5 × B 5 in the work register WR7 of the register unit.

ステップS6では、レジスタユニット3のワークレジス
タWR7からステップS5のA9×B9+A8×B8+……+A5×B5
を、又ステップS4のA4×B4+A3×B3+……+A0×B0をWR
10から夫々取り出し、演算ユニット1に入力して、これ
らを加算する。即ち、A9×B9+……+A5×B5+A4×B4
……A0×B0を求め、上位5桁と下位5桁の和である目的
の2進数を得て、レジスタユニット3のワークレジスタ
WR10へ格納する。これにより10桁10進数が少ない実行回
数で短時間で32ビットの2進数に変換される。
In step S 6, A 9 × B 9 + A 8 × B in Step S 5 from the work register WR7 of register units 3 8 + ...... + A 5 × B 5
WR of A 4 × B 4 + A 3 × B 3 +... + A 0 × B 0 of step S 4
Each of them is taken out from 10 and input to the arithmetic unit 1 to add them. That is, A 9 × B 9 +... + A 5 × B 5 + A 4 × B 4 +
... A 0 × B 0 is obtained, a target binary number which is a sum of upper 5 digits and lower 5 digits is obtained, and a work register of the register unit 3 is obtained.
Store in WR10. As a result, a 10-digit decimal number is converted into a 32-bit binary number in a short time with a small number of executions.

なお20桁10進数を64ビット2進数に変換する場合も、
予めレジスタユニットのワークレジスタに、10進数の10
10,1020に夫々対応する2進数B10,B20を記録しておくこ
とにより、上述同様に積を求めて、高速処理の10進数か
ら2進数への変換が可能となる。
Note that when converting a 20-digit decimal number to a 64-bit binary number,
In advance, the decimal 10
By recording the binary numbers B 10 and B 20 corresponding to 10 and 10 20 , respectively, it is possible to obtain a product in the same manner as described above and convert the decimal number into a binary number in high-speed processing.

〔発明の効果〕〔The invention's effect〕

以上説明してきたように、この発明によれば、与えら
れたn桁の10進数 an an-1…ai ai-1…a1 a0をi桁数毎に演算ユニット
で10進数の(an×10n+……),……,(…+a2i×1
02i),(a2i-1×102i-1+…+ai×10i),(ai-1×10
i-1+…+a1×101+a0×100)へと分割して、レジスタ
ユニットへ夫々格納し、これらのi桁数毎の10進数を該
レジスタユニットから順次取り出し、2進数変換ユニッ
トにより夫々対応するi桁数毎の2進数(An+…),
(…A3i),(A3i-1+…A2i),(A2i-1+…Ai),(A
i-1+…A1+A0)へ夫々順次一括変換し、該レジスタユ
ニットへ格納する。次に、予め該レジスタユニットに記
憶しておいた各10進数……,103i,102i,10i対応の各2
進数……,B3i,B2i,Biを夫々取り出し、各i桁数毎の2
進数と乗算ユニットで順次乗算し、 ……,(A4i-1+…A3i)×B3i,(A3i-1+…+A2i
×B2i,(A2i-1+…+Ai+1+Ai)×Biを夫々求め、順次
レジスタユニットへ格納し、これら全ての2進数及び最
下位のi桁数の2進数(Ai-1+…A1+A0)を、該レジス
タユニットから取り出し、演算ユニットでこれらの総和 ……+(A4i-1×B3i+…+A3i×B3i)+(A3i-1×B2i
+…+A2i×B2i)+(Ai-1+…+A1+A0)を求めて、2
進数を得るようにしたので、大きな桁数の10進数であっ
ても短時間のうちに高速に2進数へ変換することが可能
となる。
As described above, according to the present invention, decimal given n digit a n a n-1 ... a i a i-1 ... a 10 in decimal arithmetic unit every the 1 a 0 i digits (A n × 10 n + ……), ……, (… + a 2i × 1
0 2i ), (a 2i-1 × 10 2i-1 + ... + a i × 10 i ), (a i-1 × 10
i-1 +... + a 1 × 10 1 + a 0 × 10 0 ), store them in the register unit, and sequentially take out the decimal numbers for each i-digit number from the register unit, and convert them into binary number conversion units. , A binary number (A n +...) For each corresponding i-digit number,
(… A 3i ), (A 3i-1 +… A 2i ), (A 2i-1 +… A i ), (A
i-1 +... A 1 + A 0 ) are sequentially and collectively converted and stored in the register unit. Next, each of the decimal numbers stored in the register unit in advance,..., 10 3i , 10 2i , and 2 corresponding to 10 i
Decimal ......, B 3i, B 2i, B respectively taken out, 2 for each i digits
.., (A 4i-1 +... A 3i ) × B 3i , (A 3i-1 +... + A 2i )
× B 2i , (A 2i-1 +... + A i + 1 + A i ) × B i are obtained, and sequentially stored in the register unit. All of these binary numbers and the binary numbers (A i -1 +... A 1 + A 0 ) is taken out from the register unit, and the sum is calculated by the arithmetic unit... + (A 4i-1 × B 3i +... + A 3i × B 3i ) + (A 3i-1 × B 2i
+ ... + A 2i × B 2i ) + (A i-1 + ... + A 1 + A 0 )
Since a decimal number is obtained, even a decimal number having a large number of digits can be rapidly converted to a binary number in a short time.

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明が実施される情報処理装置のブロック
図、第2図は本発明の動作を説明するフローチャート
で、第3図は従来の装置のブロック図である。 1……演算ユニット、2……乗算ユニット、3……レジ
スタユニット、4,5,6……バス、8……2進数変換ユニ
ット。
FIG. 1 is a block diagram of an information processing apparatus in which the present invention is implemented, FIG. 2 is a flowchart for explaining the operation of the present invention, and FIG. 3 is a block diagram of a conventional apparatus. 1 arithmetic unit, 2 multiplication unit, 3 register unit, 4, 5, 6 bus, 8 binary conversion unit.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】与えられたn桁の10進数 an an-1…ai ai-1…a1 a0をi桁数毎に演算ユニットで1
0進数の(an×10n+…),…,(…+a2i×102i),(a
2i-1×102i-1+…+ai×10i),(ai-1×10i-1+…+ai
×101+a0×100)へと分割して、レジスタユニットへ夫
々格納する工程と、 次いで、これらのi桁数毎の10進数を該レジスタユニッ
トから順次取り出し、2進数変換ユニットにより夫々対
応するi桁数毎の2進数(An+…),(…A3i),(A
3i-1+…A2i),(A2i-1+Ai),(Ai-1+…A1+A0)へ
夫々順次一括変換し、該レジスタユニットへ格納する工
程と、 次いで、予め該レジスタユニットに記憶しておいた各10
進数……,103i,102i,10i対応の各2進数……,B3i,
B2i,Biを夫々取り出し、前記各i桁数毎の2進数と乗算
ユニットで順次乗算し、……,(A4i-1+…+A3i)×B
3i,(A3i-1+…+A2i)×B2i,(A2i-1+…+Ai+1
Ai)×Biを夫々求め、順次レジスタユニットへ格納する
工程と、 次いで、これら全ての2進数及び最下位のi桁数の2進
数(Ai-1+…Ai+A0)を、該レジスタユニットから取り
出し、演算ユニットでこれらの総和……+(A4i-1×B3i
+…+A3i×B3i)+(A3i-1×B2i+…+A2i×B2i)+
(Ai-1+…+A1+A0)を求めて、2進数を得る工程とを
含むことを特徴とする2進数への変換方法。
1. A decimal given n digit a n a n-1 ... a i a i-1 ... 1 in the arithmetic unit of a 1 a 0 for each i digits
(A n × 10 n + ...), ..., (... + a 2i × 10 2i ), (a
2i-1 × 10 2i-1 + ... + a i × 10 i ), (a i-1 × 10 i-1 + ... + a i
× 10 1 + a 0 × 10 0 ) and storing them in the register unit respectively. Then, these decimal numbers for each i-digit number are sequentially taken out from the register unit, and are respectively handled by the binary number conversion unit. Binary numbers (A n + ...), (... A 3i ), (A
3i-1 +... A 2i ), (A 2i-1 + A i ), (A i-1 +... A 1 + A 0 ), and sequentially and collectively convert them into the register unit. Each 10 stored in the register unit
Binary numbers ……, 10 3i , 10 2i , and binary numbers corresponding to 10 i ……, B 3i ,
B 2i and B i are respectively taken out and sequentially multiplied by a binary number for each of the i-digit numbers by a multiplication unit,..., (A 4i-1 +... + A 3i ) × B
3i , (A 3i-1 + ... + A 2i ) × B 2i , (A 2i-1 + ... + A i + 1 +
A i ) × B i , and sequentially storing them in the register unit. Then, all these binary numbers and the binary numbers (A i-1 +... A i + A 0 ) of the least significant i digits are obtained by: It is taken out from the register unit and summed up by the arithmetic unit... + (A 4i-1 × B 3i
+… + A 3i × B 3i ) + (A 3i-1 × B 2i +… + A 2i × B 2i ) +
(A i-1 +... + A 1 + A 0 ) to obtain a binary number.
JP63308059A 1988-12-06 1988-12-06 Conversion method to binary Expired - Lifetime JP2820701B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63308059A JP2820701B2 (en) 1988-12-06 1988-12-06 Conversion method to binary

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63308059A JP2820701B2 (en) 1988-12-06 1988-12-06 Conversion method to binary

Publications (2)

Publication Number Publication Date
JPH02154530A JPH02154530A (en) 1990-06-13
JP2820701B2 true JP2820701B2 (en) 1998-11-05

Family

ID=17976387

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63308059A Expired - Lifetime JP2820701B2 (en) 1988-12-06 1988-12-06 Conversion method to binary

Country Status (1)

Country Link
JP (1) JP2820701B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE60110811T2 (en) * 2000-08-28 2006-02-02 Verisity Ltd. PROCESS FOR PROVIDING BITES RESTRICTIONS DURING A TEST GENERATION

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62200918A (en) * 1986-02-28 1987-09-04 Hioki Denki Kk BCD/binary conversion circuit

Also Published As

Publication number Publication date
JPH02154530A (en) 1990-06-13

Similar Documents

Publication Publication Date Title
US4525796A (en) Pipelined operation unit for vector data
JPS6132437Y2 (en)
JPH0375901B2 (en)
JPH0368416B2 (en)
JP2820701B2 (en) Conversion method to binary
US4823300A (en) Performing binary multiplication using minimal path algorithm
JP2682142B2 (en) Multiplier
JPH0831024B2 (en) Arithmetic processor
JPH05173761A (en) Binary integer multiplier
JPS6275838A (en) Variable precision numerical data calculation device
SU1226447A1 (en) Multiplying device
JPS6259828B2 (en)
JP3231298B2 (en) Multiplication device
JPS62147526A (en) Multiplier
JP3093564B2 (en) Multiplication device
RU1817091C (en) Device for multiplying numbers
JPH0784762A (en) Multiplication circuit
SU999043A1 (en) Multiplication device
JP2551037B2 (en) Inverse arithmetic circuit
JPH0610787B2 (en) Multiplication processing device
JPH07271558A (en) Numerical calculation device
JP2575856B2 (en) Arithmetic circuit
JP2650209B2 (en) Multiplier
JP2606580B2 (en) Numerical data calculation method
SU1524046A1 (en) Device for multiplying two n-digit numbers