JPS5941122B2 - Inch/millimeter data conversion method - Google Patents
Inch/millimeter data conversion methodInfo
- Publication number
- JPS5941122B2 JPS5941122B2 JP18194580A JP18194580A JPS5941122B2 JP S5941122 B2 JPS5941122 B2 JP S5941122B2 JP 18194580 A JP18194580 A JP 18194580A JP 18194580 A JP18194580 A JP 18194580A JP S5941122 B2 JPS5941122 B2 JP S5941122B2
- Authority
- JP
- Japan
- Prior art keywords
- input data
- data
- calculation means
- function
- inches
- 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
Links
- 238000006243 chemical reaction Methods 0.000 title claims description 11
- 238000000034 method Methods 0.000 title claims description 11
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01D—MEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
- G01D7/00—Indicating measured values
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Indication And Recording Devices For Special Purposes And Tariff Metering Devices (AREA)
- Complex Calculations (AREA)
- Indicating Measured Values (AREA)
- Length Measuring Devices With Unspecified Measuring Means (AREA)
Description
【発明の詳細な説明】
本発明は、インチ単位系データとミリ単位系データのデ
ータ変換を簡単にして行い得るインチ・ミリ・データ変
換方式に関するものである。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an inch-millimeter data conversion method that allows data conversion between inch unit data and millimeter data to be easily performed.
[Iml(ミリ)単位の数値データxを、インチ単位の
数値データに変換する際には、1インチ=2.54剛で
あるから、X×2.54という乗算を行なう。逆に、イ
ンチ単位の数値データXをm単位の数値データに変換す
る際には、1mm■−インチ半0.3937インチ2.
54であるから、X÷2.54、もしくは、XX0.3
937という演算を行なう。[When converting numerical data x in units of Iml (mm) to numerical data in units of inches, since 1 inch = 2.54 stiffness, a multiplication of X x 2.54 is performed. Conversely, when converting numerical data X in units of inches to numerical data in m units, 1 mm - inch and a half 0.3937 inches 2.
54, so X÷2.54 or XX0.3
The calculation 937 is performed.
従つて、インチからミリヘの数値変換機能と、ミリから
インチヘの数値変換機能を要求されるシステムにおいて
は、第1図に示すごとく、2.54を乗算する演算回路
もしくは処理手順Dと、2.54で除算する演算回路も
しくは処理手順Eとを必要とする。Therefore, in a system that requires a numerical value conversion function from inches to millimeters and a numerical value conversion function from millimeters to inches, an arithmetic circuit or processing procedure D for multiplying by 2.54 and 2. An arithmetic circuit or processing procedure E for dividing by 54 is required.
しかし、これら乗算回路は、非常に回路構成が複雑であ
り、乗数の桁数が増すに従い、さらに著しく回路構成が
複雑になつてしまう。However, these multiplier circuits have very complicated circuit configurations, and as the number of digits of the multiplier increases, the circuit configuration becomes even more complicated.
また、これら乗算動作をコンピュータ等のプログラムで
達成する場合でも、その処理ステップ数が多く、乗数の
桁数が増すに従つて、さらに著しく処理ステップ数が増
加してしまう。本発明は上記の点に鑑みなされたもので
、インチからミリヘの、あるいは、ミリからインチヘの
データ変換を容易に行なうことができるインチ・ミリ・
データ変換方式を提供することを目的とする。Further, even when these multiplication operations are accomplished by a program such as a computer, the number of processing steps is large, and as the number of digits of the multiplier increases, the number of processing steps increases even more significantly. The present invention has been made in view of the above points, and is capable of easily converting data from inches to millimeters or from millimeters to inches.
The purpose is to provide a data conversion method.
以下、本発明の実施例を図面を参照して説明する。Embodiments of the present invention will be described below with reference to the drawings.
第2図は本発明の第1の実施例であつて、Aは、入力デ
ータに2を乗算するための演算手段(第1の演算手段)
、Bは、入力データに31を乗算するための演算手段(
第2の演算手段)、Cは、入力データに127を乗算す
るための演算手段(第3の演算手段)である。FIG. 2 shows a first embodiment of the present invention, in which A is an arithmetic means (first arithmetic means) for multiplying input data by 2.
, B is an arithmetic means (
C is a calculation means (third calculation means) for multiplying input data by 127.
インチからミリへの数値変換を行なう際の乗数は2.5
4であるが、小数点を度外視した有効数字で表現するこ
とにすれば、小数点を度外視した乗数254は、2×1
27に因数分解される。The multiplier when converting numbers from inches to millimeters is 2.5
4, but if we express it using significant figures excluding the decimal point, the multiplier 254 excluding the decimal point is 2×1
It is factorized into 27.
他方、ミリからインチへの数値変換を行なう際の乗数は
1/2.54+0.3937であるが、同様に、小数屯
を度外視した有効数字で表現することにすれば、小数点
を度外視した乗数3937は、31×127に因数分解
される。小数点位置の処理は容易であり、かつ、本発明
の主旨に関係しないので、説明を簡略化するため、上に
述べたように度外視したものである。On the other hand, the multiplier when converting a value from millimeters to inches is 1/2.54 + 0.3937, but if we similarly express it using significant figures, excluding the decimal point, we get a multiplier of 3937, excluding the decimal point. is factorized into 31×127. Processing of the decimal point position is easy and is not related to the gist of the present invention, so in order to simplify the explanation, it has been omitted as described above.
以上述べたように、インチ単位数値データXを、小数点
を度外視してミリ単位の数値データに変換するには、X
×2×127の乗算を行なえばよく、一方、ミリ単位数
値データXを、小数点を度外視してインチ単位の数値デ
ータに変換するには、X×31X127の乗算を行なえ
ばよい。As mentioned above, to convert numerical data X in inches to numerical data in millimeters, ignoring the decimal point,
It is sufficient to perform a multiplication of x2x127. On the other hand, in order to convert numerical data X in millimeters to numerical data in units of inches, ignoring the decimal point, it is sufficient to perform a multiplication of x2x127.
ここで、第2の乗数127が共通であるから、第2図の
ごとく共通化することができる。Here, since the second multiplier 127 is common, it can be made common as shown in FIG.
第2図において、インチからミリへの変換を行なう場合
には、まず、演算手段Aによつて2を乗じて2Xを得、
次に、演算手段Cによつて127を乗じて2XX127
=254Xを得ることができる。In FIG. 2, when converting from inches to millimeters, first multiply by 2 using calculation means A to obtain 2X,
Next, the calculation means C multiplies 127 to 2XX127.
=254X can be obtained.
他方、ミリからインチへの変換を行なう場合には、まず
、演算手段Bによつて31を乗じて31Xを得、次に、
演算手段Cによつて127を乗じて31XX127=3
937Xを得ることができる。On the other hand, when converting from millimeters to inches, first multiply by 31 using calculation means B to obtain 31X, then,
Multiply by 127 by calculation means C to obtain 31XX127=3
937X can be obtained.
デイジタル回路方式による乗算回路は、被乗数および乗
数の桁数が増すと、著しく複雑な回路構成になる。また
、コンピユータ等におけるプログラムによつて乗算処理
を行なう場合には、被乗数および乗数の桁数が増すと、
処理ステツプ数が著しく増大し、かつ、格納レジスタの
用い方がめんどうになる。Multiplication circuits based on digital circuits become extremely complex as the number of digits of the multiplicand and multiplier increases. Also, when performing multiplication processing using a program on a computer, etc., when the number of digits of the multiplicand and multiplier increases,
The number of processing steps increases significantly and the use of storage registers becomes cumbersome.
例えば、N桁のxデータに3937を乗じて得られる結
果は、N+4桁になる。従つて、演算過程で、下位桁を
切り捨てる操作(これを行なうと演算精度が低下する)
を行なわなければ、N+4桁分の結果格納レジスタが必
要になる。本発明においては、乗数が、2と31と12
7であり、乗算回路の構成は簡単であり、プログラムで
処理する場合にも処理ステツプ数が少なくなる0第1の
実施例では、乗数として、2と31と127を採つたが
、31は(32−1)に等しく、127は(128−1
)に等しいので、第3図に示した第2の実施例では、3
1のかわりに(32一1)を、127のかわりに(12
8−1)を採つた。For example, the result obtained by multiplying N-digit x data by 3937 is N+4 digits. Therefore, during the calculation process, lower digits must be truncated (doing this will reduce calculation accuracy).
If this is not done, a result storage register of N+4 digits will be required. In the present invention, the multipliers are 2, 31 and 12.
7, the configuration of the multiplier circuit is simple, and the number of processing steps is reduced even when processing with a program. In the first embodiment, 2, 31, and 127 were used as the multipliers, but 31 is ( 32-1) and 127 is equal to (128-1
), so in the second embodiment shown in FIG.
(32-1) instead of 1, (12 instead of 127)
8-1) was adopted.
第3図において、Bは、入力データX2を32倍し、し
かる後、X2を減算するための演算手段であり、C′は
、入力データX3を128倍し、しかる後にX,を減算
するための演算手段である。In FIG. 3, B is an arithmetic means for multiplying input data X2 by 32 and then subtracting X2, and C' is for multiplying input data X3 by 128 and then subtracting X. It is a calculation means.
このような構成によつて、第1の実施例と同じ機能が達
せられるのは言うまでもない。次に、あえて、31のか
わりに(32−1)を、また、127のかわりに(12
8−1)を使う効果を説明する。It goes without saying that such a configuration can achieve the same functions as the first embodiment. Next, I dared to use (32-1) instead of 31, and (12-1) instead of 127.
Explain the effect of using 8-1).
デイジタルシステムにおいては、2進コードを使用する
。Digital systems use binary codes.
従つて、データ数値も10進のコードでなく、多くの場
合、2進コードで処理される。2進コード値を1ビツト
ずつ上位側にシフト(左シフト)すると、2進コードの
性質上、データが2倍されたことに等しい結果が得られ
るのはよく知られている。Therefore, data values are often processed using binary codes instead of decimal codes. It is well known that, due to the nature of binary codes, when a binary code value is shifted one bit at a time to the upper side (left shift), a result equivalent to doubling the data is obtained.
同様に2進コード値を2ビツトずつ上位側にシフトする
と、データが4倍されたことになり、3ビツトずつ上位
側にシフトすれば、データが8倍されたことになる。従
つて、2進データを32倍するためには、複雑な乗算動
作を何ら行なう必要がなく、データコードを上位側に5
ビツトずつシフトすればよい。Similarly, if the binary code value is shifted upward by 2 bits at a time, the data will be multiplied by 4, and if it is shifted upward by 3 bits at a time, the data will be multiplied by 8. Therefore, in order to multiply binary data by 32, there is no need to perform any complicated multiplication operation, and the data code is
Just shift it bit by bit.
また、2進データを128倍するためには、複雑な乗算
動作を何ら行なう必要がなく、データコードを上位側に
7ビツトずつシフトすればよい。かくして、第2図にお
ける演算手段Aは、入力データX,を1ビツト上位側に
シフトするだけの手段でよく、演算手段B′は、入力デ
ータX2を5ビツト上位側にシフトする機能と、その結
果からX2を減じる機能とだけを有する手段でよく、演
算手段C′は、入力データX3を7ビツト上位側にシフ
トする機能と、その結果からX3を減する機能とだけを
有する手段でよい。以上詳述したように、本発明のイン
チ・ミリ・データ変換方式においては、インチからミリ
へのおよびミリからインチへのデータ変換を行なう際の
演算処理桁数を減しるようにしたので、簡単にして上記
データ変換を行い得る。Furthermore, in order to multiply binary data by 128, there is no need to perform any complicated multiplication operation, and it is only necessary to shift the data code to the upper side by 7 bits at a time. Thus, the arithmetic means A in FIG. 2 only needs to shift the input data X by 1 bit to the upper side, and the arithmetic means B' has the function of shifting the input data X2 by 5 bits to the upper side. The calculation means C' may be a means having only the function of subtracting X2 from the result, and the calculation means C' may have only the function of shifting the input data X3 to the upper side by 7 bits and the function of subtracting X3 from the result. As detailed above, in the inch-millimeter data conversion method of the present invention, the number of digits to be processed when converting data from inches to millimeters and from millimeters to inches is reduced. The above data conversion can be performed easily.
したがつて、測長装置等に利用することができる。Therefore, it can be used in length measuring devices and the like.
第1図はインチ単位からミリ単位へのデータ変換方式を
示す図、第2図は本発明のインチ・ミリ・データ変換方
式の第1の実施例の説明図、第3図は本発明の第2の実
施例の説明図である。FIG. 1 is a diagram showing a data conversion method from inches to millimeters, FIG. 2 is an explanatory diagram of the first embodiment of the inch-millimeter data conversion method of the present invention, and FIG. FIG. 2 is an explanatory diagram of the second embodiment.
Claims (1)
入力データに31を乗ずるための第2の演算手段と、入
力データに127を乗ずるための第3の演算手段とから
なり、インチ単位の入力データをミリ単位のデータに変
換する際には、インチ単位の入力データを、まず第1の
演算手段によつて2倍し、しかる後、第3の演算手段に
よつて127倍するごとくし、ミリ単位の入力データを
インチ単位のデータに変換する際には、ミリ単位の入力
データを、まず第2の演算手段によつて31倍し、しか
る後、第3の演算手段によつて127倍するごとくした
インチ・ミリ・データ変換方式。 2 第1の演算手段としては、入力データを1ビット上
位側にシフトする機能を有する手段を用い、第2の演算
手段としては、入力データを5ビット上位側にシフトす
る機能と、5ビット上位側にシフトされた結果データか
ら、シフトする前の入力データを減する機能を有し、結
果として入力データを(32−1)倍にするための機能
を有する手段を用い、第3の演算手段としては、入力デ
ータを7ビット上位側にシフトする機能と、7ビット上
位側にシフトされた結果データから、シフトする前の入
力データを減する機能を有し、結果として、入力データ
を(128−1)倍するための機能を有する手段を用い
たことを特徴とする特許請求の範囲第1項記載のインチ
・ミリ・データ変換方式。[Claims] 1. A first calculation means for multiplying input data by 2;
It consists of a second calculation means for multiplying input data by 31 and a third calculation means for multiplying input data by 127. When converting input data in inches to data in millimeters, When converting input data in millimeters to data in inches by first doubling the input data in units by the first calculation means and then multiplying it by 127 by the third calculation means. In this method, input data in millimeters is first multiplied by 31 by a second calculation means, and then multiplied by 127 by a third calculation means. 2 As the first calculation means, a means having a function of shifting the input data to the higher order side by 1 bit is used, and as the second calculation means, means having the function of shifting the input data to the upper side of 5 bits, A third arithmetic means is used which has a function of subtracting the input data before shifting from the result data shifted to the side, and has a function of multiplying the input data by (32-1) as a result. has the function of shifting the input data to the upper 7 bits, and the function of subtracting the input data before shifting from the result data shifted to the upper 7 bits, and as a result, the input data becomes (128 -1) The inch-millimeter data conversion method according to claim 1, characterized in that means having a multiplication function is used.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP18194580A JPS5941122B2 (en) | 1980-12-24 | 1980-12-24 | Inch/millimeter data conversion method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP18194580A JPS5941122B2 (en) | 1980-12-24 | 1980-12-24 | Inch/millimeter data conversion method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS57106812A JPS57106812A (en) | 1982-07-02 |
| JPS5941122B2 true JPS5941122B2 (en) | 1984-10-04 |
Family
ID=16109622
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP18194580A Expired JPS5941122B2 (en) | 1980-12-24 | 1980-12-24 | Inch/millimeter data conversion method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5941122B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH03100764A (en) * | 1989-09-13 | 1991-04-25 | Fujitsu Ltd | Method for conversion from metric system to yard-pound system |
| JP2813513B2 (en) * | 1992-09-01 | 1998-10-22 | 株式会社ミツトヨ | Data conversion circuit |
-
1980
- 1980-12-24 JP JP18194580A patent/JPS5941122B2/en not_active Expired
Also Published As
| Publication number | Publication date |
|---|---|
| JPS57106812A (en) | 1982-07-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5500812A (en) | Multiplication circuit having rounding function | |
| US3610906A (en) | Binary multiplication utilizing squaring techniques | |
| JPH05233228A (en) | Floating point arithmetic unit and its arithmetic method | |
| US4594680A (en) | Apparatus for performing quadratic convergence division in a large data processing system | |
| US4477879A (en) | Floating point processor architecture which performs square root by hardware | |
| CA2530015C (en) | Division and square root arithmetic unit | |
| US7607165B2 (en) | Method and apparatus for multiplication and/or modular reduction processing | |
| JPS5941122B2 (en) | Inch/millimeter data conversion method | |
| US3845290A (en) | Decimal-to-binary converter | |
| US6298364B1 (en) | Digital signal processing operation apparatus that allows combined operation | |
| JP2579321B2 (en) | Binary processing unit | |
| JPH0831024B2 (en) | Arithmetic processor | |
| RU2148270C1 (en) | Device for multiplication | |
| SU651341A1 (en) | Multiplying arrangement | |
| JP2951685B2 (en) | Fixed-point arithmetic unit | |
| SU824197A1 (en) | Computing device | |
| JPH0383127A (en) | Decimal divider | |
| US3614405A (en) | Number entry system | |
| JPS6259828B2 (en) | ||
| RU25232U1 (en) | COMPUTER DEVICE | |
| KR100251547B1 (en) | Digital Sgnal Processor | |
| SU822181A1 (en) | Device for multiplying numbers in complementary codes | |
| JP3068640B2 (en) | Computing device | |
| JP2705162B2 (en) | Arithmetic processing unit | |
| SU868751A1 (en) | Multiplier |