[go: up one dir, main page]

JP3251311B2 - Sorting method for data representing numerical values - Google Patents

Sorting method for data representing numerical values

Info

Publication number
JP3251311B2
JP3251311B2 JP21206091A JP21206091A JP3251311B2 JP 3251311 B2 JP3251311 B2 JP 3251311B2 JP 21206091 A JP21206091 A JP 21206091A JP 21206091 A JP21206091 A JP 21206091A JP 3251311 B2 JP3251311 B2 JP 3251311B2
Authority
JP
Japan
Prior art keywords
hex
extension
data
digit
numerical
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 - Fee Related
Application number
JP21206091A
Other languages
Japanese (ja)
Other versions
JPH0553764A (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.)
Meisei Electric Co Ltd
Original Assignee
Meisei Electric Co Ltd
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 Meisei Electric Co Ltd filed Critical Meisei Electric Co Ltd
Priority to JP21206091A priority Critical patent/JP3251311B2/en
Publication of JPH0553764A publication Critical patent/JPH0553764A/en
Application granted granted Critical
Publication of JP3251311B2 publication Critical patent/JP3251311B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Exchange Systems With Centralized Control (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、コンピュータによる処
理上の必要から数値を表わすデータを数値順に並べるた
めのソーティング方法に関し、特に電話交換の技術分野
で多用されるソーティング方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a sorting method for arranging data representing numerical values in numerical order due to the necessity of processing by a computer, and more particularly to a sorting method frequently used in the technical field of telephone exchange.

【0002】[0002]

【従来の技術】電話交換の技術分野では、古典的にはダ
イヤル信号が直流電流の断続数で組立てられており、こ
のダイヤル信号の組立て法において、数字「0」(de
c)(decは「 」内の数字を10進数で表現してい
ることを示す。以下同じ)を表わす信号は上記直流電流
の断続数が10回(10パルス)で構成されている。
2. Description of the Related Art In the technical field of telephone exchange, a dial signal is classically assembled with the number of intermittent DC currents.
c) (dec indicates that the number in “” is represented by a decimal number; the same applies hereinafter). The signal representing the number of intermittent DC currents is 10 (10 pulses).

【0003】この技術分野におけるコンピュータ処理に
おいては、上記ダイヤル信号の組立て法にならい、数字
「0」(dec)を示すデータは10パルスに相当する
数字「10」(dec)、すなわち、「A」(hex)
(hexは「 」内の数字を16進数で表現しているこ
とを示す。以下同じ)で表わすのが一般的である。
In computer processing in this technical field, data indicating the number "0" (dec) is a number "10" (dec) corresponding to 10 pulses, that is, "A" in accordance with the above-described dial signal assembling method. (Hex)
(Hex indicates that the number in "" is represented by a hexadecimal number; the same applies hereinafter).

【0004】ところで、電話交換の技術分野では、近年
になって16ビットのCPUと高級言語を用いるコンピ
ュータ処理が導入されてきており、この場合において
は、数値で表わされるデータ(以下、数値データとい
う。)は1桁当り8ビットが割り当てられ、10進数の
数字は2桁の16進数の数字により、それぞれ次の表1
のように表わされる。なお、「00」(hex)は数値
情報を含まないデータとして使用される。
In the technical field of telephone exchange, computer processing using a 16-bit CPU and a high-level language has recently been introduced. In this case, data represented by numerical values (hereinafter referred to as numerical data) is used. )) Is assigned 8 bits per digit, and the decimal numbers are represented by two hexadecimal numbers, as shown in Table 1 below.
It is represented as Note that “00” (hex) is used as data that does not include numerical information.

【0005】[0005]

【表1】 [Table 1]

【0006】[0006]

【発明が解決しようとする課題】以上に述べた数字の表
現方法を用いた数値データを、コンピュータ処理上の必
要性から数値順に並べるための処理を考える。なお、上
記数値順に並べる処理は、例えば、電話交換機に内線の
システムデータを投入する処理において、投入操作上の
混乱を避けるため、内線をその内線番号順に並べ、デー
タ入力装置のディスプレイに内線番号順に内線を表示す
る処理を行う場合等に必要となる。
Consideration will be given to processing for arranging numerical data using the numerical representation method described above in numerical order from the necessity of computer processing. Note that the process of arranging the above numerical values is, for example, in the process of inputting the system data of the extension to the telephone exchange, in order to avoid confusion in the input operation, to arrange the extensions in the order of the extension number, the display of the data input device in the order of extension number This is necessary when performing a process of displaying an extension.

【0007】数字の16進データによる上記表現方法に
よると、並べる数値データのいずれかに「0」(de
c)が含まれる場合、例えば内線番号「1000」(d
ec)と「1111」(dec)を番号の小さいものか
ら並べて上記例のようにディスプレイに表示する場合を
考えると、コンピュータの内部では、上記内線番号「1
000」(dec)は「01・0A・0A・0A」(h
ex)(「・」は桁区分を示すために便宜上付した符
号、以下同じ)となり、内線番号「1111」(de
c)は「01・01・01・01」(hex)となるの
で、内線番号配列がディスプレイ上で配列すべき順序
と、コンピュータ内部での処理上の配列順とが逆転する
こととなる。
According to the above-mentioned expression method using hexadecimal data of numbers, "0" (de)
c) is included, for example, the extension number “1000” (d
ec) and “1111” (dec) are arranged in ascending order of numbers and displayed on the display as in the above example.
000 ”(dec) is“ 01 • 0A • 0A • 0A ”(h
ex) (“•” is a code added for convenience to indicate the digit division, the same applies hereinafter), and the extension number “1111” (de
Since c) is “01 • 01 • 01 • 01” (hex), the order in which the extension number arrangement should be arranged on the display and the arrangement order in processing inside the computer are reversed.

【0008】この逆転を補正するため、従来は、上記
「0A」(hex)が含まれる数値データを抽出し、こ
れを「00」(hex)に置き替える処理(データ変換
処理)をして、その結果に基いて元の数値データをソー
ティングするようにしている。しかしながら、多数の数
値データから「0A」(hex)が含まれる数値データ
を抽出し、これを「00」(hex)に置き換えるデー
タ変換処理は、多くの時間を要し、コンピュータの処理
サイクルが長くなる問題点がある。
Conventionally, in order to correct this inversion, numerical data including the above “0A” (hex) is extracted and replaced with “00” (hex) (data conversion process). The original numerical data is sorted based on the result. However, the data conversion process of extracting numerical data including “0A” (hex) from a large number of numerical data and replacing it with “00” (hex) requires a lot of time and requires a long processing cycle of the computer. There is a problem.

【0009】本発明は、以上の問題点を解決し、1桁当
り8ビットが割り当てられる数値データを高速でソーテ
ィングする方法を得ることを課題とするものである。
SUMMARY OF THE INVENTION It is an object of the present invention to solve the above problems and to provide a method of sorting numerical data to which 8 bits are assigned to one digit at a high speed.

【0010】[0010]

【課題を解決するための手段】上記課題を解決するた
め、本発明は、数値順に並べようとする数値データのそ
れぞれについて、8ビットで1桁が構成される当該桁毎
に「06」(hex)を加算し、次に加算後のデータの
上記桁毎に「0F」(hex)との論理積をとり、その
結果得られたデータに基いて元の数値データを並べるよ
うにしたものである。
In order to solve the above-mentioned problems, according to the present invention, for each numerical data to be arranged in numerical order, one digit is composed of 8 bits, and "06" (hex) is set for each digit. ) Is added, and a logical AND with "0F" (hex) is taken for each digit of the data after the addition, and the original numerical data is arranged based on the data obtained as a result. .

【0011】[0011]

【作用】数値データの10進数でいう桁毎に「06」
(hex)を加算すると、「0A」(hex)を含む数
値データの当該「0A」(hex)の桁の数値は桁が1
桁あがって「10」(hex)となり、これと「0F」
との論理積により上の桁の「1」(hex)がマスクさ
れて当該桁の数値は「00」(hex)となる。この結
果、上記「0A」(hex)を含むデータは10進数で
表現した場合と同じ値となる。一方、「0A」(he
x)を含まない数値データでは、上記と同じ処理を行っ
ても上記桁上げが生ずることはないので、上記処理後の
データに基いて元の数値データを配列することにより、
前記配列順の逆転が生ずることはない。以上の処理は、
前記従来の「0A」(hex)を含む数値データの抽出
と、該当桁の「00」(hex)との置き替えによる処
理に比べて、極めて短い時間で可能であり、この結果、
コンピュータの処理速度の高速化が可能となる。
[Effect] "06" for each digit of numeric data in decimal number
(Hex), the numerical value of the digit of “0A” (hex) in the numerical data including “0A” (hex) is 1 digit.
The digit goes up and becomes "10" (hex), and this and "0F"
The upper digit “1” (hex) is masked by the logical product of the above and the numerical value of the digit becomes “00” (hex). As a result, the data including the above “0A” (hex) has the same value as when expressed in decimal. On the other hand, “0A” (he
In the case of numerical data that does not include x), the carry will not occur even if the same processing is performed as described above. Therefore, by arranging the original numerical data based on the data after the processing,
The reverse of the sequence order does not occur. The above processing is
Compared with the conventional process of extracting numerical data including "0A" (hex) and replacing the corresponding digit with "00" (hex), the process can be performed in an extremely short time.
It is possible to increase the processing speed of the computer.

【0012】[0012]

【実施例】図1は本発明の実施例のブロック図、図2は
フローチャートである。
FIG. 1 is a block diagram of an embodiment of the present invention, and FIG. 2 is a flowchart.

【0013】図1に示すように、電話交換装置は一般に
通話路スイッチSWと、該通話路スイッチSWに収容さ
れた複数の内線SUBと、制御を一括して行なう中央処
理装置CCを有し、中央処理装置CCは、本発明の実施
例の場合、16ビットのマイクロプロセッサCPUを主
体に構成されている。
As shown in FIG. 1, the telephone exchange generally has a communication path switch SW, a plurality of extensions SUB accommodated in the communication path switch SW, and a central processing unit CC for performing control collectively. In the embodiment of the present invention, the central processing unit CC mainly includes a 16-bit microprocessor CPU.

【0014】上記マイクロプロセッサCPUでは、プロ
グラムに高級言語が用いられ、数値データとしては、1
0進数でいう1桁当り8ビット構成のデータが用いられ
る。中央処理装置CCで扱われる数値データとして、例
えば内線番号がある。この内線番号は通常システムデー
タとして扱われ、各内線SUBの通話路スイッチSWへ
の収容端子の番号と上記内線番号との対応関係は、中央
処理装置CC内のシステムデータ格納メモリMに記憶さ
れており、このシステムデータ格納メモリMへの記憶形
態は前記表1に示したように、16進数の2桁(2進数
の8ビット)であり、特に「0」(dec)について
は、「0A」(hex)で記憶されている。
In the microprocessor CPU, a high-level language is used for the program, and numerical data is
Data of 8 bits per digit in a 0-base number is used. The numerical data handled by the central processing unit CC is, for example, an extension number. This extension number is normally treated as system data, and the correspondence between the number of the terminal accommodated in the communication path switch SW of each extension SUB and the extension number is stored in the system data storage memory M in the central processing unit CC. As shown in Table 1, the storage format in the system data storage memory M is 2 hexadecimal digits (8 bits of binary number), and particularly “0A” (dec) is “0A”. (Hex).

【0015】内線番号を10進数の数値順に並べる(並
べ替える)処理を図2を参照して説明する。なお、以下
の説明では、具体的には3つの内線SUBについて説明
することとし、当該内線SUBを、A,B及びCとし、
それぞれの内線番号を「1109」(dec),「11
10」(dec)及び「1111」(dec)とする。
A process for arranging (rearranging) extension numbers in numerical order of decimal numbers will be described with reference to FIG. In the following description, three extensions SUB will be specifically described, and the extensions SUB will be referred to as A, B, and C,
The extension numbers are "1109" (dec), "11
10 "(dec) and" 1111 "(dec).

【0016】上記内線A,B,Cの内線番号はシステム
データ格納メモリMにそれぞれ8ビットで記憶されてお
り、それぞれの数値データは、次の通りである。
The extension numbers of the extensions A, B and C are stored in the system data storage memory M in 8 bits, respectively, and the respective numerical data are as follows.

【0017】 内線A−「01・01・0A・09」(hex) 内線B−「01・01・01・0A」(hex) 内線C−「01・01・01・01」(hex) 上記16進数で表わされた数値データにより、例えばそ
の小さい値から大きな値へと並べるものとすれば、「内
線C,内線B,内線A」の順となり、実際の内線番号、
すなわち、10進数で表わした内線番号の順である「内
線A,内線B,内線C」とはならない。
Extension A— “01.01.01A.09” (hex) Extension B— “01.01.01.0A” (hex) Extension C— “01.01.01.01” (hex) 16 above If numerical values expressed in base numbers are to be arranged, for example, from smaller values to larger values, the order is “extension C, extension B, extension A”, and the actual extension number,
That is, "extension A, extension B, extension C", which is the order of extension numbers represented by decimal numbers, is not used.

【0018】そこで、内線番号をその数値順に並べる処
理がスタートすると、まずマイクロプロセッサCPU
は、ステップS1で、システムデータ格納メモリMに記
憶されたそれぞれの内線SUBの内線番号データ(16
進数)の各桁毎に「06」(hex)を加算する処理を
行なう。この処理後のデータを上記内線A、内線B及び
内線Cについて示すと次の通りとなる。
When the process of arranging extension numbers in numerical order is started, first, the microprocessor CPU
Is the extension number data (16) of each extension SUB stored in the system data storage memory M in step S1.
(Hex) is added to each digit. The data after this processing is shown below for the extension A, extension B and extension C.

【0019】 内線A−「07・07・10・0F」(hex) 内線B−「07・07・07・10」(hex) 内線C−「07・07・07・07」(hex) 以上のステップS1の処理では、「0A」(hex)で
あった桁のデータで桁が1桁上る結果となる。すなわ
ち、内線A内線番号データの上から3桁目及び内線Bの
内線番号データの上から4桁目にある「0A」(he
x)は、ステップS1の処理後は「10」(hex)と
なっている。
Extension A— “07.07.10.0F” (hex) Extension B— “07.07.07.10” (hex) Extension C— “07.07.07.07” (hex) In the process of step S1, the result is that the digit is one digit higher in the digit data that was "0A" (hex). That is, "0A" (he) in the third digit from the top of extension A extension number data and the fourth digit from the extension number data of extension B
x) is “10” (hex) after the processing in step S1.

【0020】次にマイクロプロセッサCPUは、ステッ
プS1での処理後のデータの各桁毎に「0F」(he
x)との論理積演算処理をステップS2で行なう。この
処理後のデータを上記内線A、内線B及び内線Cについ
て示すと次の通りとなる。
Next, the microprocessor CPU sets "0F" (he) for each digit of the data after the processing in step S1.
The logical AND operation with x) is performed in step S2. The data after this processing is shown below for the extension A, extension B and extension C.

【0021】 内線A−「07・07・00・0F」(hex) 内線B−「07・07・07・00」(hex) 内線C−「07・07・07・07」(hex) 次にマイクロプロセッサCPUは、ステップS3で、上
記ステップS2での処理後のデータを相互比較して所定
の順に並び替え、ステップS4で並び替えた順序に従っ
て元の数値データを出力する。この結果、内線番号デー
タは、「1109」(dec),「1110」(de
c),「1111」(dec)の順に出力され、10進
数でいう小さい値から大きい値へと順次出力されること
となり、これにより例えばディスプレイ上に内線番号の
表示を行なえば、表示順序に配列の逆転が生ずることは
ない。
Extension A— “07.07.00-0F” (hex) Extension B— “07.07.07.00” (hex) Extension C— “07.07.07.07” (hex) In step S3, the microprocessor CPU compares the data processed in step S2 with each other and rearranges the data in a predetermined order, and outputs the original numerical data in the rearranged order in step S4. As a result, the extension number data is “1109” (dec) and “1110” (de
c) and "1111" (dec) are output in order from a small value in decimal number to a large value. For example, if extension numbers are displayed on a display, they are arranged in the display order. Is not reversed.

【0022】以上の実施例は、電話交換装置の内線番号
をソーティングする場合を例としたが、これに限られる
ことなく、例えば外線トランク番号をソーティングする
場合等、あらゆる数値データのソーティングに本発明を
実施することができる。
In the above embodiment, the case where the extension number of the telephone exchange is sorted is taken as an example. However, the present invention is not limited to this case, and the present invention can be applied to the sorting of all numerical data, for example, the case where the outside trunk number is sorted. Can be implemented.

【0023】また、以上の実施例では、「0」(de
c)が「0A」(hex)で表現される場合を例とした
が、一般に「0」(dec)が「0A」(hex)〜
「0F」(hex)のいずれかで表現される場合に本発
明を実施することができる。この場合において、「0」
(dec)を表現する16進数を「0X」(hex)
(「X」は16進数のA〜Fのいずれか)とすると、ス
テップS1で加算する16進数は[「10」(hex)
−「0X」(hex)]となる。
In the above embodiment, "0" (de
Although the case where c) is represented by “0A” (hex) is taken as an example, generally “0” (dec) is represented by “0A” (hex) to
The present invention can be implemented when expressed by any of “0F” (hex). In this case, "0"
Hexadecimal number representing (dec) is "0X" (hex)
("X" is any of hexadecimal numbers A to F), the hexadecimal number to be added in step S1 is ["10" (hex)
− “0X” (hex)].

【0024】更に、本発明は電話交換分野に限らず、
「0」(dec)を上記「0X」(hex)で表現して
コンピュータ処理を行なうあらゆる技術分野において実
施できる。
Further, the present invention is not limited to the telephone exchange field,
"0" (dec) can be implemented in any technical field in which computer processing is performed by expressing it as "0X" (hex).

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

【図1】本発明実施例に係る電話交換装置のブロック
図。
FIG. 1 is a block diagram of a telephone exchange according to an embodiment of the present invention.

【図2】本発明実施例のフローチャート。FIG. 2 is a flowchart of an embodiment of the present invention.

【符号の説明】[Explanation of symbols]

SUB(A,B,C)…内線 CC…中央処理装置 CPU…マイクロプロセッサ M…システムデータ格納メモリ SUB (A, B, C) ... extension CC ... central processing unit CPU ... microprocessor M ... system data storage memory

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 10進数でいう1桁当り8ビットが割り
当てられて構成され、コンピュータ処理上、数字「0」
(dec)が「0X」(hex)で表現される数値を表
わすデータを、数値順に並べるソーティング方法であっ
て、数値順に並べようとする上記データのそれぞれにつ
いて、上記8ビットが割り当てられた桁毎に[「10」
(hex)−「0X」(hex)]の値を加算する処理
を行ない、次に加算処理後のデータの上記桁毎に「0
F」(hex)との論理積を演算する処理を行ない、論
理積演算処理後のデータの相互比較によって元のデータ
を並べるようにした数値を表わすデータのソーティング
方法。ただし、XはA〜Fのいずれかの16進数を示
し、(dec)は「 」内数字が10進数であることを
示し、(hex)は「 」内数字が16進数であること
を示す。
1. A structure in which 8 bits are assigned to one digit in a decimal number, and the number "0" is calculated by computer processing.
A sorting method for arranging data representing numerical values whose (dec) is represented by "0X" (hex) in numerical order, wherein for each of the data to be arranged in numerical order, each digit to which the 8 bits are assigned [[10]
(Hex) − “0X” (hex)], and then adds “0” for each digit of the data after the addition.
A method of performing a logical AND operation with F ”(hex), and sorting the original data by mutual comparison of the data after the logical AND operation processing. Here, X indicates a hexadecimal number of any of A to F, (dec) indicates that the number in “” is a decimal number, and (hex) indicates that the number in “” is a hexadecimal number.
JP21206091A 1991-08-23 1991-08-23 Sorting method for data representing numerical values Expired - Fee Related JP3251311B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21206091A JP3251311B2 (en) 1991-08-23 1991-08-23 Sorting method for data representing numerical values

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21206091A JP3251311B2 (en) 1991-08-23 1991-08-23 Sorting method for data representing numerical values

Publications (2)

Publication Number Publication Date
JPH0553764A JPH0553764A (en) 1993-03-05
JP3251311B2 true JP3251311B2 (en) 2002-01-28

Family

ID=16616205

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21206091A Expired - Fee Related JP3251311B2 (en) 1991-08-23 1991-08-23 Sorting method for data representing numerical values

Country Status (1)

Country Link
JP (1) JP3251311B2 (en)

Also Published As

Publication number Publication date
JPH0553764A (en) 1993-03-05

Similar Documents

Publication Publication Date Title
JPS5937773A (en) Run-length coding and decoding device
JP3251311B2 (en) Sorting method for data representing numerical values
CA1232382A (en) Input device of character data
US3697733A (en) High speed direct binary to binary coded decimal converter and scaler
JPS61138333A (en) Arithmetic module
JPH0440554A (en) Character data processing device
JP2752220B2 (en) String processing unit
JPS581782B2 (en) Moji pattern hatsuseiki
JP2969154B2 (en) Input processing unit
JPS6118780B2 (en)
SU1571579A1 (en) Device for division binary numbers by three
JPH06110661A (en) Divider
JPH0863508A (en) High speed graphic processor
JPH0661054B2 (en) input method
JPH0748309B2 (en) Symbol string matching memory and its cascade connection method
JPH04294446A (en) Character processor
JPS62212726A (en) Compression processing system for index key
JPH02185131A (en) Counter device
JPH01121927A (en) Data processor
JPH03216730A (en) Electronic computer
JPH0370028A (en) Logical arithmetic circuit for serial data
JPS6237439B2 (en)
JPH01220026A (en) 32-bit integer computing element
JPH03164866A (en) Hash encoding circuit
JPH06348381A (en) Input/output processor

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees