JPS5918736B2 - Code conversion method - Google Patents
Code conversion methodInfo
- Publication number
- JPS5918736B2 JPS5918736B2 JP14606677A JP14606677A JPS5918736B2 JP S5918736 B2 JPS5918736 B2 JP S5918736B2 JP 14606677 A JP14606677 A JP 14606677A JP 14606677 A JP14606677 A JP 14606677A JP S5918736 B2 JPS5918736 B2 JP S5918736B2
- Authority
- JP
- Japan
- Prior art keywords
- code
- shift
- section
- internal
- shift mode
- 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
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
【発明の詳細な説明】 この発明はコード変換方式に関するものである。[Detailed description of the invention] This invention relates to a code conversion method.
一般的な外部コード体系としてはJIS7単位、加入印
刷電信機6単位があるが、シフト段数および1コードを
構成するビット数が異なる。このために外部コード体系
に応じたコード変換手順を踏まなけれぱならない。従つ
てコード変換する場合には外部コード体系に応じたコー
ド変換手順を踏まなければならないため、ソフトウェア
あるいはハードウェアを夫々別々に用意する必要があつ
た。General external code systems include JIS 7 units and affiliated printing and telegraph 6 units, but the number of shift stages and the number of bits constituting one code differ. For this purpose, a code conversion procedure must be followed according to the external code system. Therefore, when converting codes, it is necessary to follow a code conversion procedure according to the external code system, so it is necessary to prepare separate software or hardware.
この発明の目的は上記の如き従来の問題点を除去するも
のであり、外部コード体系のシフト段数および単位にか
かわらず一定の手順によりコード変換を行なうことがで
きるという効果を有するコード変換方式を提供すること
にある。An object of the present invention is to eliminate the above-mentioned conventional problems, and to provide a code conversion method that has the effect of being able to perform code conversion using a fixed procedure regardless of the number of shift steps and units of an external code system. It's about doing.
この発明の特徴とするところはコード変換テーブルにシ
フトコード部、コード単位情報部、内部コード部を設け
、入力されたコードがシフトコードであるか否かをシフ
トコード部を参照することにより判定し、シフトコード
である場合は前記コード変換テーブルの外に持たれるシ
フトモード管理部にそのシフトコードに応じた情報を記
憶させ、また前記コードがシフトコードでない場合番こ
は、前記シフトモード管理部、コード単位情報部の内容
および該当人力コードを2進数として取り扱う計算によ
り前記内部コード部の番地を一義的に求めて変換された
コードを得ることにある。The feature of this invention is that a code conversion table is provided with a shift code section, a code unit information section, and an internal code section, and whether or not an input code is a shift code is determined by referring to the shift code section. , if the code is a shift code, a shift mode management unit provided outside the code conversion table stores information corresponding to the shift code, and if the code is not a shift code, the shift mode management unit stores information corresponding to the shift code; The purpose is to obtain a converted code by uniquely determining the address of the internal code section through calculations that treat the contents of the code unit information section and the corresponding manual code as binary numbers.
次に本発明の実施例につき図面を用いて詳細に説明する
。Next, embodiments of the present invention will be described in detail using the drawings.
第1図は本発明の一実施例であるコード変換テーブルの
構成を示すものである。FIG. 1 shows the structure of a code conversion table according to an embodiment of the present invention.
コード変換テーブル1はシフトコード部2、コード単位
情報部3および内部コード部4からなり、コード変換テ
ーブル1の外部にはシフトモード管理部Tがある。The code conversion table 1 includes a shift code section 2, a code unit information section 3, and an internal code section 4, and a shift mode management section T is provided outside the code conversion table 1.
またそれぞれの情報は8ビットを最小単位としている。
シフトコード部2にはすべてのシフトコードが記入され
ており、8種類までのシフトコードが設定さえ、順にシ
フトコード(0)からシフトコード(7)までシフトコ
ード(n)と定義される。Each piece of information has a minimum unit of 8 bits.
All shift codes are written in the shift code section 2, and up to eight types of shift codes can be set and defined as shift codes (n) from shift code (0) to shift code (7) in order.
JIS7単位ではパリテイビツトを含んだコードで2種
加入印刷電信6単位では3種のシフトコードが記入され
る。また余分な部分は16進数(00)で埋められてい
る。コード単位情報部3は1コードを構成するビツト数
の情報がビツトパターンで表わされている。In the JIS 7 unit, a code including a parity bit is entered, and in the 2nd type printed telegraph 6 unit, 3 types of shift codes are entered. Also, extra parts are filled in with hexadecimal numbers (00). In the code unit information section 3, information on the number of bits constituting one code is expressed in a bit pattern.
JIS7単位ではパリテイビツトを含めて8ビツトであ
るから2進数(11111111)が記入され、加入印
刷電信6単位では6ビツトであるから2進数(0011
1111)が記入されている。内部コード部4には変換
後の内部コードが記入されているが、その内容はシフト
モード(0)のテーブル5、シフトモード(1)のテー
ブル6、というようにシフトモード(n)に対応してエ
リアが区分される。ここでシフトモード(n)は前記シ
フトコード(n)を入力した後のシフトモードと定義す
る。内部コード部4のシフトモード(n)のエリアには
順に入力コード16進(00)に対応する内部コード、
入力コード16進(01)に対応する内部コードという
ように順に記入されている。但しシフトコード部で16
進数(00)と記入されたシフトモード(n)のエリア
は不要であり存在しない。また原則的に内部コードは8
ビツトであるから定義されるコードは256種を越える
ことはなく、パリテイビツトを除くとシフトモードで定
義づけされても外部コードは256種を越えることはな
い。このためパリテイビツトを含んだ入力コードは51
2種を越えることはなく、内部コード部4の容量は51
2バイト(1バイトは8ビツト)となる。なお入力パリ
テイ−エラーとするデータに対応する内部コードは16
進数(00)と記入して判別し、またデータとして取り
扱わずに無視する人力データに対応する内部コードは1
6進数(FF)と記入して判別する。シフトモード管理
部7はコード変換テーブル4には含まれずにテーブル参
照時の情報のひとつとして用意するものであり、外部コ
ード入力時のシフトモードを記憶している。In the JIS 7 unit, there are 8 bits including the parity bit, so a binary number (11111111) is entered, and in the subscriber print telegraph 6 unit, it is 6 bits, so a binary number (0011) is entered.
1111) is entered. The internal code after conversion is written in the internal code section 4, and its contents correspond to the shift mode (n), such as table 5 for shift mode (0) and table 6 for shift mode (1). Areas are divided by Here, the shift mode (n) is defined as the shift mode after inputting the shift code (n). In the shift mode (n) area of the internal code section 4, the internal code corresponding to the input code hexadecimal (00),
The internal codes are written in order, such as the internal code corresponding to the input code hexadecimal (01). However, 16 in the shift code part
The shift mode (n) area written with the base number (00) is unnecessary and does not exist. Also, as a general rule, the internal code is 8
Since it is a bit, the number of codes that can be defined will not exceed 256 types, and if parity bits are excluded, the number of external codes that can be defined in shift mode will not exceed 256 types. Therefore, the input code including the parity bit is 51.
The capacity of internal cord section 4 is 51.
It is 2 bytes (1 byte is 8 bits). The internal code corresponding to the input parity error data is 16.
The internal code corresponding to human-powered data that is entered as a base number (00) to be distinguished and ignored without being treated as data is 1.
Enter hexadecimal number (FF) and judge. The shift mode management section 7 is not included in the code conversion table 4 and is prepared as one of the information when referring to the table, and stores the shift mode when inputting an external code.
シフトモードの管理はシフトモード(0)に対応して1
6進数(00)シフトモード(1)に対応して16進数
(01)のようにシフトモード(n)の数値nを記入す
ることにより行なわれる。入力コードはまず16進(0
0)か否かを判定される。Shift mode management is 1 corresponding to shift mode (0).
This is done by writing the numerical value n of the shift mode (n) as a hexadecimal number (01) corresponding to a hexadecimal number (00) shift mode (1). The input code is first hexadecimal (0
0).
これは16進(00)はシフトコード部2の余白のデー
タとして使用しているためであり、実際には16進(0
0)をシフトコードとすることはなく、シフトコードか
否かの判定は不要なためである。入力コードが16進(
00)である場合は同時にシフトコードではないと判定
される。This is because hexadecimal (00) is used as the margin data of shift code section 2, and in reality hexadecimal (00) is used as the margin data of shift code section 2.
0) is not used as a shift code, and there is no need to determine whether or not it is a shift code. The input code is hexadecimal (
00), it is determined that it is not a shift code.
その他の場合はシフトコード部の全データと比較し、一
致するものがあれば該当人力コードはシフトコードと判
定され、その一致したシフトコード(n)のnの値をシ
フトモード管理部7に記入する。この操作によりシフト
コード入力時には対応するシフトモードが記入され、次
のシフトコード入力時まで記憶保持される。入力コード
がシフトコードでないと判定された場合は内部コード部
4の参照を行ない内部コードを得る。In other cases, it is compared with all data in the shift code section, and if there is a match, the corresponding manual code is determined to be a shift code, and the value of n of the matched shift code (n) is entered in the shift mode management section 7. do. By this operation, the corresponding shift mode is entered when a shift code is input, and is stored and retained until the next shift code is input. If it is determined that the input code is not a shift code, the internal code section 4 is referenced to obtain the internal code.
この時のテーブル参照番地は次のように行う。コード単
位情報部3のデータは外部コードで表わされる最大数を
示しているためこれに1を加えると外部コードのビツト
組合せの種類、すなわち内部コード部4の内のシフトモ
ード(n)の占める容量を示すこととなる。The table reference address at this time is determined as follows. Since the data in the code unit information section 3 indicates the maximum number expressed by the external code, adding 1 to this indicates the type of bit combination of the external code, that is, the capacity occupied by the shift mode (n) in the internal code section 4. This will show the following.
この理由からコード単位情報部3のデータに1を加えた
ものをn倍するとシフトモード(n)の入力コード(0
0)に対応する内部コード情報の番地が、内部コード部
4の中の番地として得られ、この値に入力コードを加え
れば目的とする内部コードが記入されている1バイトの
番地が得られる。For this reason, if the data in the code unit information section 3 plus 1 is multiplied by n, the input code (0
The address of the internal code information corresponding to 0) is obtained as the address in the internal code section 4, and by adding the input code to this value, the 1-byte address in which the target internal code is written is obtained.
例えばJIS7単位の場合には前述のようにコード単位
情報部3のデータは8ビツトすべてが論理ゝ1′すなわ
ち10進数255であるからこれに′1″を加えた値即
ち10進256が、内部コード部4の中の1シフトモー
ドに対応する容量を指す。シフトモード(1)をSOと
定義すると、SOコードを入力するとシフトモード管理
部7の内容はゞ1″となる。この状態で例えば外部コー
ド16進(B1)が入力された場合には10進数33を
256に加えた値289が内部コード部4の中の番地と
なり、ここを参照すれば内部コードを得ることができる
。以上の手順はソフトウエアによる制御、ハードウエア
による制御のどちらでも実現し得る。また入力コードが
8ビツト以内、シフト段数が8段以内であれば外部コー
ド体系にかかわらずこの手順は一定であり、コード変換
テーブルの入れ換えは他の制御に全く影響を与えない。
尚、前記のシフトコード部2はシフト段数8段までを可
能としているが、JIS7単位および加入印刷電信6単
位の2種を対象とする場合には3段でもよい。For example, in the case of JIS 7 units, all 8 bits of the data in the code unit information section 3 are logical '1', or decimal number 255, as described above, so the value obtained by adding '1' to this, or decimal number 256, is the internal It refers to the capacity corresponding to the 1 shift mode in the code section 4.If shift mode (1) is defined as SO, when the SO code is input, the contents of the shift mode management section 7 become "1". In this state, for example, if the external code hexadecimal (B1) is input, the value 289 obtained by adding the decimal number 33 to 256 becomes the address in the internal code section 4, and by referring to this, the internal code can be obtained. can. The above procedure can be realized by either software control or hardware control. Furthermore, if the input code is within 8 bits and the number of shift stages is within 8 stages, this procedure is constant regardless of the external code system, and replacing the code conversion table does not affect other controls at all.
Although the shift code section 2 is capable of shifting up to eight stages, it may be three stages if two types, JIS 7 unit and subscriber printed telegraph 6 unit, are targeted.
また逆に8段より多く設定することも可能である。シフ
トコード部2、コード単位情報部3および内部コード部
4の配置は本発明の効果に影響を及ぼすものではなく、
相互に入れ換えて定義することもできる。Conversely, it is also possible to set more than eight stages. The arrangement of the shift code section 2, code unit information section 3, and internal code section 4 does not affect the effects of the present invention.
They can also be defined interchangeably.
シフトモード管理部7におけるシフトモードの記憶は、
内部コード部4の中の各シフトモードのエリアの先頭番
地とすることもできる。The shift mode storage in the shift mode management section 7 is as follows:
It can also be the start address of each shift mode area in the internal code section 4.
この場合はコード単位情報部3の内容に1を加えたもの
にモード番号nを乗じる手順をシフトコード入力時に行
なうこととなる。この様に本発明によれば、シフトコー
ド、コード単位情報を持ち、テーブル参照番地をシフト
モード番号、コード単位情報および入力コードの一定形
式の計算により求められるコード変換テーブルの形式な
ので、コード変換テーブルを入れ替えるだけで、ソフト
ウエアあるいはハードウエアを変更することなく、異な
つた外部コード体系を扱うことができる。In this case, the procedure of adding 1 to the contents of the code unit information section 3 and multiplying it by the mode number n is performed when inputting the shift code. As described above, according to the present invention, the code conversion table has the shift code and code unit information, and the table reference address is obtained by calculating the shift mode number, code unit information, and input code in a fixed format. You can handle different external code systems without changing the software or hardware by simply replacing the .
第1図は本発明の一実施例を示すコード変換テーブルの
構成図である。
1・・・・・・コード変換テーブル、2・・・・・・シ
フトコード部、3・・・・・・コード単位情報部、4・
・・・・・内部コード部、5・・・・・・シフトモード
(0)のテーブル、6・・・・・・シフトモード(1)
のテーブル、7・・・・・・シフトモード管理部。FIG. 1 is a configuration diagram of a code conversion table showing an embodiment of the present invention. 1... Code conversion table, 2... Shift code section, 3... Code unit information section, 4...
...Internal code section, 5...Shift mode (0) table, 6...Shift mode (1)
Table 7...Shift mode management section.
Claims (1)
用いて、内部コードに変換する方式であつて、シフトコ
ード部、コード単位情報部および内部コード部を含むコ
ード変換テーブルと、シフトモードを記憶するシフトモ
ード管理部を有し、該シフトモード管理部には前記シフ
トコード部内の該当シフトコードの位置に応じた情報を
記憶させ、また前記コード単位情報部には前記内部コー
ド部内に占める各シフトモードに対応する容量を示す情
報を記憶し、前記シフトコード部を参照することにより
入力された任意段数のコードがシフトコードか否かを判
別し、シフトコードでないと判定された場合には、前記
コード単位情報部を参照して、前記内部コード部内の各
シフトモードに対応する領域の大きさを求め、かつ前記
シフトモード部管理部を参照して内部コードの番地を求
め、該番地によつて内部コード部より内部コードを得る
ことを特徴とするコード変換方式。1 A method of converting a preset external code into an internal code using a code conversion table, which includes a code conversion table including a shift code section, a code unit information section, and an internal code section, and a shift table that stores a shift mode. The shift mode management section stores information corresponding to the position of the corresponding shift code in the shift code section, and the code unit information section stores information corresponding to the position of the corresponding shift code in the internal code section. Information indicating the corresponding capacity is stored, and by referring to the shift code section, it is determined whether or not the input code of the arbitrary number of stages is a shift code. If it is determined that it is not a shift code, the code unit is The size of the area corresponding to each shift mode in the internal code section is determined by referring to the information section, and the address of the internal code is determined by referring to the shift mode section management section. A code conversion method characterized by obtaining an internal code from a part.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP14606677A JPS5918736B2 (en) | 1977-12-07 | 1977-12-07 | Code conversion method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP14606677A JPS5918736B2 (en) | 1977-12-07 | 1977-12-07 | Code conversion method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS5478940A JPS5478940A (en) | 1979-06-23 |
| JPS5918736B2 true JPS5918736B2 (en) | 1984-04-28 |
Family
ID=15399304
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP14606677A Expired JPS5918736B2 (en) | 1977-12-07 | 1977-12-07 | Code conversion method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5918736B2 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6365765A (en) * | 1986-09-05 | 1988-03-24 | Nec Corp | Original reader |
| JPH02105938U (en) * | 1989-02-10 | 1990-08-23 |
-
1977
- 1977-12-07 JP JP14606677A patent/JPS5918736B2/en not_active Expired
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6365765A (en) * | 1986-09-05 | 1988-03-24 | Nec Corp | Original reader |
| JPH02105938U (en) * | 1989-02-10 | 1990-08-23 |
Also Published As
| Publication number | Publication date |
|---|---|
| JPS5478940A (en) | 1979-06-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6446198B1 (en) | Vectorized table lookup | |
| JP3599352B2 (en) | Flexible N-way memory interleave scheme | |
| JPH0644714B2 (en) | Code conversion device | |
| US4727511A (en) | Multitype characters processing method and terminal device | |
| JPS5918736B2 (en) | Code conversion method | |
| JPS6214689A (en) | Character output control device | |
| JPS59173830A (en) | document editing device | |
| JPS594706B2 (en) | Print pattern generator | |
| JPS60232974A (en) | Printer | |
| JPS5816186B2 (en) | character pattern generator | |
| JPS5931751B2 (en) | Dot printing device | |
| JPS6246874B2 (en) | ||
| JP2003196156A (en) | Information processing apparatus and information processing method | |
| JP2748504B2 (en) | Input processing device | |
| JPS6019824B2 (en) | How to process external characters in a word processor | |
| JPH0114617B2 (en) | ||
| JP2618863B2 (en) | Image data processing device | |
| JPS63202476A (en) | document output device | |
| JPS6343503Y2 (en) | ||
| JPS61105636A (en) | Printing device | |
| JPH077393B2 (en) | Kanji code conversion method | |
| JPS63137348A (en) | Character code conversion system | |
| JPS61158483A (en) | Electronic apparatus | |
| JPH02172776A (en) | Printing device | |
| JPH0453188B2 (en) |