JPS58181142A - M notation-n notation converting device - Google Patents
M notation-n notation converting deviceInfo
- Publication number
- JPS58181142A JPS58181142A JP6292082A JP6292082A JPS58181142A JP S58181142 A JPS58181142 A JP S58181142A JP 6292082 A JP6292082 A JP 6292082A JP 6292082 A JP6292082 A JP 6292082A JP S58181142 A JPS58181142 A JP S58181142A
- Authority
- JP
- Japan
- Prior art keywords
- notation
- register
- output
- digit
- code
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
Abstract
Description
【発明の詳細な説明】
本発明はディジタルデータ処理装置のm進−n進(m、
nは自然数)変換装置に関する。DETAILED DESCRIPTION OF THE INVENTION The present invention provides an m-adic-n-adic (m,
(n is a natural number) Concerning the conversion device.
ディジタルデータ処理装置においてm値数をn進数に変
換する場合、例えば2進数から10進数(例えば2進化
10進法(J30D)により符号化された形のもの)へ
の変換を高速で行なう方法として、2進数を数ビットず
つから成る桁に分割し、桁毎に10進数への変換を行な
い、貧挨により得られたlO進数を各桁の事みを考慮し
て相を求める方法が知られている。しかるに、この方法
では2進数が負の場合、まず2進数の補数を取り、次に
上記の変換を行なうのが一般的でめった。このため、補
数を取るだめの時間が高速変換装置としては無視できな
いオーバーヘッド時間となっていた。また、上記の菱侯
操作を、四則演算のための演算回路を利用せずに専用の
ハードウェアで実行する場合には、別個に補数を取る手
段を組込んでおく必要があp1装置が複雑で、高価にな
るという欠点があった。When converting an m-value number into an n-ary number in a digital data processing device, for example, as a method for converting from a binary number to a decimal number (for example, one encoded by the binary coded decimal system (J30D)), A known method is to divide a binary number into digits each consisting of several bits, convert each digit to a decimal number, and then calculate the phase of the 10-decimal number obtained by simplification, taking into account each digit. ing. However, in this method, when the binary number is negative, it is common to first take the complement of the binary number and then perform the above conversion, which is rare. For this reason, the time it takes to take the complement becomes an overhead time that cannot be ignored as a high-speed conversion device. In addition, if the above Ryohou operation is to be executed on dedicated hardware without using an arithmetic circuit for the four arithmetic operations, it is necessary to incorporate a separate means for taking the complement, which would complicate the p1 device. However, it had the disadvantage of being expensive.
本発明の目的は、簡単な回路構成でしかもm進−n進変
換を高速に行なうことができる変換装置を提供すること
にある。An object of the present invention is to provide a conversion device that has a simple circuit configuration and can perform m-ary to n-ary conversion at high speed.
第1図は、本発明の一実施例を示したものである。同図
において、T]は2進数、図示の例では15ビツトの2
進数コードとその符号を表示する1ビツトのコードとを
受ける端子である。2進数コードは、2進数か負の場合
には1の補数を表わすものであるとする。符号コードは
16ビツトのコードのうちMEIB(最上位のビット)
により表わされてお9、符号フラグレジスタ1は1の符
号コードを受けて保持する。2は置数レジスタで16ビ
ツトの容量を持ち、4ビツトずつの桁に分割されており
、4ビツト県位で図面上石側に即ち各ビットがそれぞれ
下位側に向けてシフトし得るようになっている。そして
、最下位の4ビツトを外部に取出し得るようになってい
る。3は桁ポインタで、図示しない制御装置に制御され
て、置数レジスタ2から外部に取出されている桁を表示
する。4は読取り専用記憶装置(ROM)で、符号フラ
グレジスタ1から送られている符号コードSと、桁ポイ
ンタ3から送られている桁コードPと、置数レジスタ2
から送られている1桁分の数値(絶対値)を表わすコー
1−Hとをアドレスとして受け、そのアドレスの内容V
pを絶対値表現の10進数として出力する。このような
役割を果すため、ROM4には第1表に示すように、符
号S1桁Pおよび1桁分の数値Hpに対してlO進数<
e対値表現)Vを絖取り傅るようにした変換テーブルの
形で記憶している。ROM4の出力は加算器5の一万の
入力に供給されている。加算器5の出力は累算レジスタ
ロの入力に供給され、累算レジスタロの出力は加算器5
の他方の入力に供給されるとともに、出力端子T0に供
佑される。累算レジスタ6は図示のように6つの桁のB
ODを収容し得るもので、各桁は4ビツトから成る。加
算器5は6桁のBODの加算を行ない得るものである。FIG. 1 shows an embodiment of the present invention. In the figure, T] is a binary number, in the example shown, a 15-bit 2
This is a terminal that receives a base number code and a 1-bit code that represents the code. It is assumed that the binary code represents a binary number or, in the case of a negative value, a one's complement number. The code is MEIB (most significant bit) of the 16-bit code.
The sign flag register 1 receives and holds a sign code of 1. 2 is a numeric register with a capacity of 16 bits, divided into digits of 4 bits each, so that each bit can be shifted toward the lower side in the figure in 4-bit positions. ing. The lowest 4 bits can then be taken out. 3 is a digit pointer which is controlled by a control device (not shown) and displays the digit taken out from the number register 2. 4 is a read-only storage device (ROM) that stores the code code S sent from the code flag register 1, the digit code P sent from the digit pointer 3, and the digit register 2.
The code 1-H representing a one-digit numerical value (absolute value) sent from V is received as an address, and the contents of that address V
Output p as a decimal number expressed as an absolute value. In order to play such a role, the ROM 4 stores lO base numbers <
e-vs-value expression) V is stored in the form of a conversion table that can be converted into a value. The output of the ROM 4 is supplied to the 10,000 inputs of the adder 5. The output of adder 5 is fed to the input of accumulating register lo, and the output of accumulating register lo is fed to adder 5.
The output terminal T0 is supplied to the other input of the output terminal T0. Accumulation register 6 has six digits B as shown.
Each digit consists of 4 bits. The adder 5 is capable of adding 6-digit BOD.
第1表
2進数BGo””811(このうちB。oはMSflで
符号ビット)を4ビツト毎に分割して、4桁の16進数
とし、各桁の16a数をHp(pはθ〜3゜但し、p=
Qのときは3ビツトの2進数と符号ビットとから成る。Table 1 The binary number BGo""811 (of which B.o is the sign bit in MSfl) is divided into 4-bit hexadecimal numbers, and the 16a number of each digit is Hp (p is θ ~ 3゜However, p=
When it is Q, it consists of a 3-bit binary number and a sign bit.
)とすると、Ba1l”BIllに対応する10進数X
は次式(1)′!!たけ(2)で表わされる。), then the decimal number X corresponding to Ba1l”BIll
is the following equation (1)′! ! It is expressed as Take(2).
2進数≧Oのときは、
X = HoXJ6”+ H,X16” XH,XI6
’十H,X]6°−<1)2進数く0のときは、
X == Ho””X16’+ Hl。(l’X16”
+H,”1)X+6’+ (H,”)X16°+1)・
・・・・・叫・・・・・・・・・・・ (2)ここで、
■■p O+1) はHpの1の補数を表わす。RO
M4は上式(11、(2)の各項のBOD表現(即ち1
6進の各桁に対する10進の変換値)を記憶しているも
のであるとbえる。そして、加算器5は上式(1)、(
2)の各項の和を求めるために用いられたものである。When binary number ≧O, X = HoXJ6”+ H,X16” XH,XI6
'10H, (l'X16"
+H,"1)X+6'+ (H,")X16°+1)・
・・・・・・Scream・・・・・・・・・・・・ (2) Here,
■■p O+1) represents the one's complement of Hp. R.O.
M4 is the BOD expression (i.e. 1
It can be said that it stores the decimal conversion value for each hexadecimal digit. Then, the adder 5 uses the above formula (1), (
It was used to find the sum of each term in 2).
また、累算レジシタ6は中間オロを保持するために用い
られている。さらに桁ポインタ3は16進数の桁を示す
だめに用いられる。Further, the accumulation register 6 is used to hold intermediate zeros. Furthermore, digit pointer 3 is used to indicate the hexadecimal digit.
変換操作の過程は第3図に示す如くである。即ち、変換
操作が開始されると(101)、累算Vジスタロに零が
セットされ、桁ポインタに3がセットされる(102)
。置数レジスタ2の最下位の4ビツトが桁ポインタ3の
出力と符号フラグレジスタ1の出力とともに、R(l
M 4に与えられ、対応する10進数が取出され、加算
器5で累算レジスタ6の内容と力ロ算され、加算結果(
第1)が累算レジスタ6の新たな内容とされる(103
)。次に桁ポインタ3の内容がチェックされ零でなけれ
ば、桁ポインタ3の内容が1だけ減らされるとともに、
置数レジスタ2の内容が1桁(4ビツト)分布量に、即
ち位の小さい万にシフトされる(10り)。以後ステッ
プ103〜105が繰返され、・1石ポインタ3の内容
が零になったことが確認されたときに変換操作が終了す
る(106)。The process of conversion operation is as shown in FIG. That is, when the conversion operation is started (101), the cumulative V distal is set to zero and the digit pointer is set to 3 (102).
. The lowest 4 bits of digit register 2, along with the output of digit pointer 3 and the output of sign flag register 1, are R(l
M4, the corresponding decimal number is taken out, and the adder 5 multiplies it with the contents of the accumulation register 6, and the addition result (
1) is taken as the new content of the accumulation register 6 (103
). Next, the content of digit pointer 3 is checked and if it is not zero, the content of digit pointer 3 is decreased by 1, and
The contents of the numeric register 2 are shifted to a one-digit (4-bit) distributed quantity, ie, to the smallest digit (10). Thereafter, steps 103 to 105 are repeated, and the conversion operation ends when it is confirmed that the contents of the one stone pointer 3 have become zero (106).
以上のようにして、端子T1に与えられる補数表示の2
進数を、端子T。から絶対値表示の【0進数として取出
すことができる。尚、符号フラグレジスタ1の出力を、
そのまま変換装置の出力として利用することにより、1
0進数の符号を表わすコードを得ることができる。As described above, 2 of the complement representation given to the terminal T1
The base number is connected to terminal T. It can be extracted as a 0-decimal number expressed as an absolute value. In addition, the output of sign flag register 1 is
By using it as it is as the output of the conversion device, 1
A code representing the sign of a 0-decimal number can be obtained.
以上、2進数をlO値数に変換する場合について述べた
が、ROM4に10進数(BOD)を2進数に変換する
ためのテーブルを用意し、さらにIO進加$65の代り
に2進加算器を用いることとすれば、lO進数を2進数
に変換する装置を得ることができる。Above, we have described the case of converting a binary number into an IO value number, but a table for converting a decimal number (BOD) to a binary number is prepared in ROM4, and a binary adder is added instead of the IO base addition $65. If we use
また、2進数とtO進数との間の変換に限らず、m、
nを任意の自然数とするとき、m進数とn進数との間
の変換に適用することができる。In addition to converting between binary numbers and tO base numbers, m,
When n is an arbitrary natural number, it can be applied to conversion between m-ary numbers and n-ary numbers.
以上のように変換テーブルの中に、m進数(またはlO
a数)して変換値(n進数)を用意しているので、m進
数が負の場合にも補数器が不要である。また、補数の作
成に相当することと、加算操作とが同時に実行できるの
で、補数作成のだめのオーバーヘッド時間が不要となる
。従って、その分たけ変換操作が速い。As mentioned above, in the conversion table, m-ary numbers (or lO
Since the converted value (n-adic number) is prepared by converting the m-adic number (a number), a complementer is not required even when the m-adic number is negative. Further, since the operation corresponding to the creation of the complement and the addition operation can be performed simultaneously, the overhead time required for the creation of the complement is unnecessary. Therefore, the conversion operation is correspondingly faster.
第1図は本発明の変換装置の一実施例を示すブチヤード
である。
1・・・符号フラグレジスタ、2・・・置数レジスタ、
3・・・桁ポインタ、4・・・読取り専用記憶装置、5
・・・加算器、6・・・累算レジスタ。
出願人代理人 猪 股 清FIG. 1 is a butchiard showing an embodiment of the converting device of the present invention. 1... Sign flag register, 2... Arrangement register,
3... Digit pointer, 4... Read-only storage device, 5
... Adder, 6... Accumulation register. Applicant's agent Kiyoshi Inomata
Claims (1)
グ保持手段と、前記m進数を保持し、前記m進数をそれ
ぞれqピッ)(qは自然数)から成る桁のm 進数とし
て上位もしくは下位の桁から順に出力するm進数保持手
段と、前記m進数保持手段から出力されている桁の位を
示すコードを出力する桁表示手段と、前記符号フラグ保
持手段、前記m進数保持手段および前記桁表示手段の出
力をアドレスとして受けそのアドレスの内容を変換され
たn進数(nは自然数)として出力する読取り専用記憶
装置と、累算レジスタと、前記累算レジスタの内容と前
記記憶装置の内容とを加算する加算器と、前記m進数保
持手段の保持内容がすべて出力さ丸るまで前記加算器に
よる加算を行なわせる制御手段とを備えたm進−n進変
換装置。code flag holding means for holding a code flag of an m-ary number (m is a natural number); m-ary number holding means for outputting in order from the digit, digit display means for outputting a code indicating the digit position output from the m-ary number holding means, the code flag holding means, the m-ary number holding means, and the digit display. a read-only storage device that receives the output of the means as an address and outputs the contents of the address as a converted n-ary number (n is a natural number), an accumulation register, and the contents of the accumulation register and the storage device. An m-ary to n-ary conversion device comprising an adder for adding, and a control means for causing the adder to perform addition until all the contents held in the m-ary number holding means are outputted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP6292082A JPS58181142A (en) | 1982-04-15 | 1982-04-15 | M notation-n notation converting device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP6292082A JPS58181142A (en) | 1982-04-15 | 1982-04-15 | M notation-n notation converting device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS58181142A true JPS58181142A (en) | 1983-10-22 |
Family
ID=13214169
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP6292082A Pending JPS58181142A (en) | 1982-04-15 | 1982-04-15 | M notation-n notation converting device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS58181142A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60139343U (en) * | 1984-02-27 | 1985-09-14 | 日本電気株式会社 | High speed code conversion circuit |
JPS6486625A (en) * | 1987-09-29 | 1989-03-31 | Nec Corp | Hexadecimal converter |
JPS6486624A (en) * | 1987-09-29 | 1989-03-31 | Nec Corp | Hexadecimal converter |
US5786777A (en) * | 1991-09-03 | 1998-07-28 | Mitsubishi Denki Kabushiki Kaisha | Data compression communication method between a main control unit and terminals |
-
1982
- 1982-04-15 JP JP6292082A patent/JPS58181142A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60139343U (en) * | 1984-02-27 | 1985-09-14 | 日本電気株式会社 | High speed code conversion circuit |
JPS6486625A (en) * | 1987-09-29 | 1989-03-31 | Nec Corp | Hexadecimal converter |
JPS6486624A (en) * | 1987-09-29 | 1989-03-31 | Nec Corp | Hexadecimal converter |
US5786777A (en) * | 1991-09-03 | 1998-07-28 | Mitsubishi Denki Kabushiki Kaisha | Data compression communication method between a main control unit and terminals |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPS6159914A (en) | Digital compressor | |
JPH0645950A (en) | Apparatus and method for generation of signal | |
US5832037A (en) | Method of compressing and expanding data | |
EP0398568A3 (en) | Multiplier circuit | |
JPS58181142A (en) | M notation-n notation converting device | |
JPH0519170B2 (en) | ||
JP2000148447A (en) | Multiplier and arithmetic method therefor | |
US3803392A (en) | Code converter and method for a data processing system | |
WO2004088586A1 (en) | Lookup table device and image generation device | |
KR0182169B1 (en) | Log arithmathic value calculator | |
JP3210356B2 (en) | Data zero judgment device | |
JPS623330A (en) | Adder | |
JP2606580B2 (en) | Numerical data calculation method | |
JP3055558B2 (en) | n-bit arithmetic unit | |
JPS61274425A (en) | Digital compressing curcuit | |
JP2723319B2 (en) | How to convert a binary number to a decimal number | |
JP2820701B2 (en) | Conversion method to binary | |
JP2870018B2 (en) | Product-sum operation circuit | |
GB1254800A (en) | Improvements in or relating to binary to decimal conversion | |
SU1179322A1 (en) | Device for multiplying two numbers | |
JPH0425933A (en) | Coefficient unit | |
JPH01276227A (en) | Digital rounding circuit | |
JPH02306726A (en) | Bit displacement code | |
JPH0540607A (en) | Digital signal processing circuit | |
JPH03241421A (en) | Multiplier |