JPH08263264A - Data processor - Google Patents

Data processor

Info

Publication number
JPH08263264A
JPH08263264A JP6217696A JP6217696A JPH08263264A JP H08263264 A JPH08263264 A JP H08263264A JP 6217696 A JP6217696 A JP 6217696A JP 6217696 A JP6217696 A JP 6217696A JP H08263264 A JPH08263264 A JP H08263264A
Authority
JP
Japan
Prior art keywords
code
bcd
decimal
1bcd
data
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.)
Granted
Application number
JP6217696A
Other languages
Japanese (ja)
Other versions
JP2713283B2 (en
Inventor
Katsu Matsumura
克 松村
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP6217696A priority Critical patent/JP2713283B2/en
Publication of JPH08263264A publication Critical patent/JPH08263264A/en
Application granted granted Critical
Publication of JP2713283B2 publication Critical patent/JP2713283B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE: To efficiently store numerical data as variable length data and to convert a decimal operation into a BCD code so as to operate it. CONSTITUTION: When numerical data is inputted, a decimal character discrimination part 13 discriminates whether a JIS code is a decimal character or not. When it is the decimal character, numerical data which is inputted next is inputted from a JIS code conversion part 12 and it is discriminated to be the decimal character or not. When it is the decimal character, the decimal character of two bytes is converted into a BCD of one byte in a BCD generation part 14. A +1BCD generation part 15 adds '01' (hexadecimal value) and generates a +1BCD. A +1BCD output part 16 adds a delimeter to a +1BCD and writes it into a memory. At the time of executing the decimal operation, a +1BCD conversion part subtracts '01' (hexadecimal value) from the data and converts it into a BCD. A BCD output part 20 outputs the BCD to an arithmetic unit.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、電子計算機におけるデ
ータ処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing device in an electronic computer.

【0002】[0002]

【従来の技術】コンピュータによる事務処理では、数値
計算は2進演算よりも高速性の点で不利ではあるが一般
的に10進演算により行っている。
2. Description of the Related Art In office processing by a computer, numerical calculation is generally performed by a decimal operation although it is disadvantageous in that it is faster than binary operation.

【0003】10進演算は当然ながら10進データどう
しの演算であり、たとえば加算演算であるならば、加算
数も被加算数も10進データでありそれらを加算する。
Decimal operation is of course operation between decimal data, and if it is, for example, addition operation, both the addition number and augend are decimal data, and they are added.

【0004】10進データの表現形式としては例えばB
CDコードにより「0」〜「9」までの10進1桁の数
値を4ビットで表現し、1バイトに10進2桁を格納す
るパック形式がある。
The representation format of decimal data is, for example, B
There is a pack format in which a numerical value of one decimal digit from "0" to "9" is represented by 4 bits by a CD code and two decimal digits are stored in one byte.

【0005】図6(a)に従来用いられていたBCDの
パック形式を示す。同図(a)は、1語が32ビットの
パック10進数を示しており、小数点は最下位バイトB
1の上位4ビットの右Pの位置に置き、最下位バイトB
1の下位4ビットSの最下位ビットで符号を表わしてい
る。例えば、前記最下位ビットが“0”の時に正、
“1”の時に負の10進数となる。また、最下位バイト
B1の上位4ビットdlから最上位バイトB4の上位4
ビットd7に4ビット2進数が格納され、固定長32ビ
ットで「d7,d6,d5,・・・d3,d2,d1」
の7桁の10進数を表現する。パック10進数の具体例
を同図(b)に示す。同図(b)は、5桁の負の10進
数「一98003」を表わすBCDのパック形式であ
り、最下位バイトB1の下位ビットSの最下位ビットが
「1」となっている。また、5桁の10進数であるため
最上位バイトB4は“00”(16進)となっており、
バイトB3,B2,及び最下位バイトB1の上位4ビッ
トに2進コードの“1001”(d5),“1000”
(d4),“0000”(d3),“0000”(d
2),“0010”(dl)が格納されている。
FIG. 6A shows a BCD pack format which has been conventionally used. In the same figure (a), one word represents a 32-bit packed decimal number, and the decimal point is the least significant byte B.
Place it in the right P of the upper 4 bits of 1, and place the least significant byte B
The code is represented by the least significant bit of the lower 4 bits S of 1. For example, positive when the least significant bit is "0",
When it is "1", it is a negative decimal number. Also, from the upper 4 bits dl of the least significant byte B1 to the upper 4 of the most significant byte B4.
A 4-bit binary number is stored in bit d7, and a fixed length of 32 bits is "d7, d6, d5, ... d3, d2, d1".
Represents a 7-digit decimal number. A specific example of a packed decimal number is shown in FIG. FIG. 10B is a BCD pack format that represents a five-digit negative decimal number "198003", and the least significant bit of the least significant bit S of the least significant byte B1 is "1". Also, since it is a 5-digit decimal number, the most significant byte B4 is "00" (hexadecimal),
Binary codes "1001" (d5), "1000" in the upper 4 bits of the bytes B3, B2 and the least significant byte B1
(D4), "0000" (d3), "0000" (d
2) and "0010" (dl) are stored.

【0006】[0006]

【発明が解決しようとする課題】従来は、図6(a)で
示したように固定長で10進数(BCD)を表現してい
る。したがって、固定長32ビットの7桁の10進数を
用いた場合、6桁以下の10進数を記憶すると、不要な
桁(“0000”)も記憶しなければならず、メモリの
利用効果が悪い。例えば、図6(b)の場合、最上位バ
イトB4はデータとして意味のない“0000000
0”であるから不要である。このため、可変長で10進
数を表現すれば、不要なデータを含まないので、10進
数データを圧縮して記憶することができ、メモリの利用
効果が向上すると考えられる。
Conventionally, a decimal number (BCD) is represented by a fixed length as shown in FIG. 6 (a). Therefore, when a fixed-length 32-bit 7-digit decimal number is used, if a decimal number of 6 digits or less is stored, an unnecessary digit (“0000”) must also be stored, and the memory utilization effect is poor. For example, in the case of FIG. 6B, the most significant byte B4 is "0000000" which is meaningless as data.
Since it is 0 ", it is unnecessary. Therefore, if a decimal number is expressed in a variable length, unnecessary data is not included, so that the decimal number data can be compressed and stored, and the memory utilization effect is improved. Conceivable.

【0007】しかし、UNIX(C言語システム)等の
オペレーティングシステムでは、文字列の終端にNUL
Lコード(“00000000”)を付加して文字列の
終わりを示すという約束がある。なお、UNIXでは上
記の約束に沿って各種の関数が標準的に提供されてシス
テムが構成されているので、NULLコード以外のコー
ドを区切りコードを使用すると、様々な不都合が生じて
無駄が多い。従って10進数を可変長で表現した場合、
10進数データの00(“00000000”)をNU
LLとみなしてしまう。例えば、図6(b)に示す固定
長4バイトの「−98003」を図6(c)に示すよう
に可変長3バイトの「−98003」のように表現する
と、バイトB2が(“00000000”)となり、オ
ペレーティングシステムはバイトB2をNULLとみな
してしまう。また、NULLコード以外のコードは文字
コード,数値コード,記号コードとして既に規定されて
いるので区切りコードには使用できない。
However, in operating systems such as UNIX (C language system), NUL is added to the end of the character string.
There is a promise to add an L code ("00000000") to indicate the end of the string. In UNIX, various functions are provided as standard in accordance with the above promise to configure the system. Therefore, if a code other than the NULL code is used as a delimiter code, various inconveniences occur and it is wasteful. Therefore, when a decimal number is expressed in variable length,
Decimal data 00 (“00000000”) is NU
I regard it as LL. For example, if the fixed length 4-byte "-98003" shown in FIG. 6B is expressed as the variable length 3-byte "-98003" as shown in FIG. 6C, the byte B2 becomes ("00000000"). ) And the operating system considers byte B2 to be NULL. Also, codes other than the NULL code are already defined as character codes, numerical codes, and symbol codes, and therefore cannot be used as delimiter codes.

【0008】従って、従来のデータ処理装置では、BC
Dコードによる数値データを可変長で処理できないとい
う不都合があった。
Therefore, in the conventional data processing device, BC
There is an inconvenience that the numerical data by the D code cannot be processed with a variable length.

【0009】本発明の課題は、BCDコードで表現され
た数値データをオペレーティングシステムの区切りコー
ドを避けたコードに変換して、可変長データでメモリに
効率良く記憶でき、10進演算を行なう際にはメモリか
ら読み出されたコードを元のBCDコードに変換して演
算できるようにすることである。
An object of the present invention is to convert numerical data represented by BCD code into a code which avoids a delimiter code of an operating system and efficiently store it as variable length data in a memory when performing a decimal operation. Is to convert the code read from the memory into the original BCD code so that it can be operated.

【0010】[0010]

【課題を解決するための手段と作用】本発明のデータ処
理装置は、1バイトで2桁の数値を示すパック形式のB
CDコードで表現された数値データの各バイトに特定の
数値を加算し上記BCDコードをオペレーティングシス
テムで使用する区切りコードとは別のコードに変換する
コード変換手段と、このコード変換手段により変換され
たコードをメモリに記憶する手段と、10進演算を行な
う際に上記メモリから読み出されたコードの各バイトか
ら上記コード変換手段で加算された上記特定の数値を減
算してBCDコードに変換して演算手段に出力する手段
とを具備したことを特徴とする。
The data processing apparatus of the present invention is a pack type B which indicates a 2-digit numerical value in 1 byte.
Code conversion means for adding a specific numerical value to each byte of the numerical data represented by the CD code and converting the BCD code into a code different from the delimiter code used in the operating system, and the code conversion means. A means for storing the code in the memory, and subtracting the specific numerical value added by the code converting means from each byte of the code read out from the memory when performing the decimal operation to convert into a BCD code And means for outputting to the arithmetic means.

【0011】従って、BCDコードで表現された数値デ
ータをオペレーティングシステムの区切りコードを避け
たコードに変換して可変長データでメモリに記憶できる
と共に、10進演算を行なう際はメモリから読み出され
たコードを元のBCDコードに変換して演算できる。
Therefore, the numerical data represented by the BCD code can be converted into a code avoiding the delimiter code of the operating system and stored in the memory as the variable length data, and read out from the memory when the decimal operation is performed. The code can be converted into the original BCD code and operated.

【0012】[0012]

【実施例】以下、図面を参照しながら本発明の実施例に
ついて説明する。図1は、本発明のデ−タ処理装置の一
実施例のブロック図である。同図において、データ入力
部11は例えばキーボード等の入力装置であり、デ−タ
入カ部11から入カされたキ−人力データは、キーボー
ド・ドライバ等のJISコード変換部12により対応す
るJISコードに変換され10進文字判別部13に送ら
れる。10進文字判別部13は、入力するJISコード
が10進文字(16進で、「30」〜「39」の値)で
あるかどうか判別し、10進文字であればJISコード
をBCD生成部14に出力する。BCD生成部14は入
力する2バイトのJISコードを1バイトのBCDに変
換し+1BCD生成部15に出力する。+1BCD生成
部15は、入力されるBCDデータに“01”(16
進)を加算し順次記憶する。以下、+1BCD生成部1
5により生成されるデータを+1BCDと記す。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram of an embodiment of the data processing apparatus of the present invention. In the figure, a data input unit 11 is an input device such as a keyboard, and the key input data input from the data input unit 11 is handled by a JIS code conversion unit 12 such as a keyboard driver or the like. It is converted into a code and sent to the decimal character discrimination unit 13. The decimal character discriminating unit 13 discriminates whether or not the input JIS code is a decimal character (hexadecimal, a value of "30" to "39"), and if it is a decimal character, the JIS code is converted into a BCD generating unit. It outputs to 14. The BCD generation unit 14 converts the input 2-byte JIS code into a 1-byte BCD and outputs it to the + 1BCD generation unit 15. The + 1BCD generation unit 15 adds “01” (16
) Is added and stored sequentially. Hereinafter, the + 1BCD generation unit 1
The data generated by 5 will be referred to as + 1BCD.

【0013】また、10進文字判別部13が10進文字
以外のJISコードを入力すると+1BCD出力部16
は、+1BCD生成部15から+1BCDを読み出し、
+1BCDに可変長データの終了を示すデリミタを付加
し、図示していないメモリの所定領域に書き込む。
When the decimal character discriminating unit 13 inputs a JIS code other than the decimal character, the + 1BCD output unit 16
Reads + 1BCD from the + 1BCD generator 15,
A delimiter indicating the end of the variable length data is added to + 1BCD and written in a predetermined area of a memory (not shown).

【0014】一方、図示していない外部装置から+1B
CDからBCDへの変換命令がデータ処理装置に加わる
と+1BCD入力部17はメモリに記憶された可変長の
+1BCDをバイト単位で読み出しデリミタ判別部18
に出力する。デリミタ判別部18は入力される+1BC
Dがデリミタであるかどうか判別し、+1BCD入力部
17によりメモリから読み出された+1BCDがデリミ
タ判別部18によりデリミタでないと判別すると、BC
D変換部19はその+1BCDから1を減算しBCDに
変換する。以上の動作は、デリミタ判別部18が+1B
CD入力部17の読み出す+1BCDがデリミタに等し
いと判別するまで繰り返される。デリミク判別部18に
より可変長の+1BCDの区切りコードであるデリミタ
が検出されると、すなわちBCD変換部19により可変
長の+1BCDの全てのバイトがBCDに変換される
と、BCD出力部20はBCD変換部19により変換さ
れたBCDを図示していない演算装置へ出力する。
On the other hand, + 1B from an external device (not shown)
When a CD-to-BCD conversion command is applied to the data processing device, the + 1BCD input unit 17 reads the variable-length + 1BCD stored in the memory in byte units and the delimiter determination unit 18
Output to. The delimiter discrimination unit 18 is input + 1BC
If it is determined whether D is a delimiter and + 1BCD read from the memory by the + 1BCD input unit 17 is not a delimiter by the delimiter determination unit 18, BC
The D conversion unit 19 subtracts 1 from the + 1BCD and converts it into BCD. The above operation is performed by the delimiter discrimination unit 18 by + 1B.
The process is repeated until it is determined that + 1BCD read by the CD input unit 17 is equal to the delimiter. When the delimiter that is the delimiter code of the variable length + 1BCD is detected by the delimiter determination unit 18, that is, when all the bytes of the variable length + 1BCD are converted to the BCD by the BCD conversion unit 19, the BCD output unit 20 performs the BCD conversion. The BCD converted by the unit 19 is output to an arithmetic unit (not shown).

【0015】尚、図1で一点鎖線で囲んだ、10進文字
判別部13、BCD生成部14、+1BCD生成部1
5、+1BCD出力部16、+1BCD入力部17、デ
リミタ判別部18、BCD変換部19及びBCD出力部
20はマイクロコンピュータによって構成できる。
The decimal character discriminator 13, the BCD generator 14, and the + 1BCD generator 1 surrounded by the one-dot chain line in FIG.
The 5, + 1BCD output unit 16, + 1BCD input unit 17, delimiter determination unit 18, BCD conversion unit 19, and BCD output unit 20 can be configured by a microcomputer.

【0016】次に、本実施例のデータ処理装置の10進
データの格納方法を図2(a)〜(c)を参照しながら
説明する。
Next, a method of storing decimal data in the data processor of this embodiment will be described with reference to FIGS. 2 (a) to 2 (c).

【0017】まず、データ入力部11により“9810
2”の10進データがキー入力されると、JISコード
変換部12により図2(a)に示すB1〜B5の5バイ
トの“98102”のJISコードに変換される。図
中、10進文字で示しているが、実際には「39,3
8,31,30,32」のJISコードが格納される。
次に、BCD生成部14は、図2(a)の5バイトのJ
ISコードを同図(b)のB1〜B3に示す3バイトの
BCD「09,81,02」に変換する。BCD生成部
14により生成された3バイトの「09,81,02」
に対し+1BCD生成部15は“01”(16進)を加
算し、同図(c)に示すB1〜B3の3バィトの「0
A,82,03」の+1BCDに変換する。そして、生
成した可変長の+1BCD「0A,82,03」の最後
にデータの区切りコードを示すデリミタDを付加しメモ
リに格納する。
First, the data input unit 11 causes "9810".
When the 2 "decimal data is keyed in, the JIS code conversion unit 12 converts it into the 5-byte" 98102 "JIS code of B1 to B5 shown in FIG. 2 (a). , It is actually "39,3
The JIS code of "8, 31, 30, 32" is stored.
Next, the BCD generation unit 14 uses the 5-byte J shown in FIG.
The IS code is converted into the 3-byte BCD “09, 81, 02” shown by B1 to B3 in FIG. 3-byte “09, 81, 02” generated by the BCD generation unit 14
In contrast, the + 1BCD generator 15 adds "01" (hexadecimal), and the three bytes "0" of B1 to B3 shown in FIG.
A, 82, 03 ”+ 1BCD. Then, a delimiter D indicating a data delimiter code is added to the end of the generated variable length + 1BCD “0A, 82, 03” and stored in the memory.

【0018】次に、以上のように構成されたデータ処理
装置の動作を図3のフローチャートを参照しながら説明
する。
Next, the operation of the data processing apparatus configured as described above will be described with reference to the flowchart of FIG.

【0019】例えば、表計算処理において、オペレータ
がCRTに表示される数値項目欄にデータ入力部11を
介して10進数値データを入力すると、データ処理装置
は以下の様な動作を行う。
For example, in the spreadsheet processing, when the operator inputs decimal value data through the data input unit 11 into the value item column displayed on the CRT, the data processing device operates as follows.

【0020】まず、データ入力部11により10進数値
データが入力されると、JISコード変換部12は入力
された10進の数値データをJISコードに変換する。
10進文字判別部13は、JISコード変換部12から
10進の数値データの最初のJISコードの1文字の入
力により(処理ST1)、そのJISコードが10進文
字(「“30”から“39”」までの16進値)である
かどうか判別する(処理ST2)。そして、10進文字
であれぱ10進文字判別部13はデータ入力部11によ
り次に入力された数値データをJISコード変換部12
から入力し(処理ST3)10進文字であるかどうか判
別する(処理ST4)。そして、10進文字であると判
別すれば、前記処理ST1、ST3で入力された2バイ
トの10進文字をBCD生成部14により1バイトのB
CDに変換し(処理ST5)、次に+1BCD生成部1
5でBCD生成部14により変換されたBCDに“0
1”(16進値)を加算する(処理ST6)。
First, when decimal value data is input by the data input section 11, the JIS code conversion section 12 converts the input decimal value data into a JIS code.
The decimal character determining unit 13 inputs one character of the first JIS code of the decimal number data from the JIS code converting unit 12 (process ST1), and the JIS code changes the decimal character (from “30” to “39”). It is determined whether or not it is a hexadecimal value up to "" (process ST2). The decimal character discriminating unit 13 determines whether the numerical data input next by the data input unit 11 is a JIS code converting unit 12 or not.
Is input (process ST3) and it is determined whether or not it is a decimal character (process ST4). If it is determined that it is a decimal character, the 2-byte decimal character input in the processes ST1 and ST3 is converted into a 1-byte B character by the BCD generation unit 14.
Convert to CD (process ST5), and then + 1BCD generation unit 1
In step 5, the BCD converted by the BCD generator 14 is set to “0.
1 "(hexadecimal value) is added (process ST6).

【0021】上記処理ST1〜ST6は、前記処理ST
2または処理ST4で10進文字判別部13で、10進
文字以外のJISコードが判別されるまで繰り返され
る。
The processes ST1 to ST6 are the same as the process ST.
2 or the process ST4 is repeated until the decimal character discriminating unit 13 discriminates a JIS code other than a decimal character.

【0022】したがって、例えばデータ入力部11によ
り“4321”の偶数桁の10進数値データが入力され
ると、その数値データは処理ST1〜処理ST6により
“0100,0100,0010,0010”(442
2)の2バイトの+1BCDに変換される。
Therefore, for example, when decimal data of even digits of "4321" is inputted by the data input unit 11, the numerical data is "0100,0100,0010,0010" (442) by processing ST1 to processing ST6.
It is converted into 2 bytes + 1BCD of 2).

【0023】一方、上記処理ST4で10進文字判別部
13により10進文字以外の文字(例えば、データの終
了を示すNULLコード等)が判別されるとデータ入力
部11から入力された10進数は奇数桁であるので、B
CD生成部14は文字の「0」〔JISコードの30
(16進)〕を入力し(処理ST7)、処理ST1で最
後に入力された10進文字をバイトの下位4ビット、処
理ST7で入力された10進文字「0」をバイトの上位
4ビットとするBCDを生成する(処理ST8)。次に
+1BCD生成部15は前記BCDに“01”(16
進)を加算し(処理ST9)、+1BCD出力部16は
+1BCD生成部15により生成された可変長の+1B
CDに1バイトのデリミタを付加し、メモリの所定領域
に書き込む(処理ST10)。
On the other hand, when a character other than a decimal character (for example, a NULL code indicating the end of data) is discriminated by the decimal character discriminating unit 13 in the process ST4, the decimal number input from the data input unit 11 becomes Since it is an odd digit, B
The CD generator 14 displays the character "0" [JIS code 30
(Hexadecimal)] (process ST7), the decimal character last input in process ST1 is the lower 4 bits of the byte, and the decimal character “0” input in process ST7 is the upper 4 bits of the byte. BCD to be generated is generated (process ST8). Next, the + 1BCD generation unit 15 adds "01" (16
The + 1BCD output unit 16 generates the variable length + 1B generated by the + 1BCD generation unit 15.
A 1-byte delimiter is added to the CD and written in a predetermined area of the memory (process ST10).

【0024】したがって、データ入力部11により例え
ば奇数桁の10進数“123”が入力されるとデータ処
理装置による上記処理ST1〜ST4,ST7〜ST1
0にょり“00000010,00100100”(2
24)の2バイトの+1BCDに変換される。
Therefore, when the data input unit 11 inputs, for example, an odd-numbered decimal number "123", the above-mentioned processes ST1 to ST4 and ST7 to ST1 by the data processing device.
0 Nyori “00000010,00100100” (2
24) is converted into 2 bytes + 1BCD.

【0025】また、上記処理ST2で10進文字判別部
13が10進文字以外の文字例えばNULLコードを判
別すると、+1BCD出力部16は、+1BCD生成部
15により生成された+1BCDにデリミタを付加して
メモリの所定領域に書き込む(処理ST10)。
When the decimal character discriminating unit 13 discriminates a character other than a decimal character, for example, a NULL code in the process ST2, the + 1BCD output unit 16 adds a delimiter to the + 1BCD generated by the + 1BCD generating unit 15. Writing to a predetermined area of the memory (process ST10).

【0026】したがって、例えばデータ入力部11から
“2222”のような偶数桁の10進数が入力された場
合にはデータ処理装置により“00100011,00
100011”(2323)の2バイトの+1BCDに
変換される。
Therefore, for example, when an even-digit decimal number such as "2222" is input from the data input unit 11, the data processing device outputs "00100011,00".
Converted to 2 bytes + 1BCD of 1000011 "(2323).

【0027】次にデータ処理装置が表計算等の10進演
算を行う時に+1BCDをBCDに変換する動作を図4
のフローチャートにより説明する。
Next, the operation of converting + 1BCD to BCD when the data processing device performs a decimal operation such as spreadsheet calculation is shown in FIG.
This will be described with reference to the flowchart of FIG.

【0028】まず、+1BCD入力部17は、メモリ
(不図示)の所定領域から+1BCDの先頭の1バイト
のデータを読み出す(処理SU1)。次に、デリミタ判
別部18はその読み出された1バイトのデータがデリミ
タであるかどうか判別し(処理SU2)、デリミタでな
ければBCD変換部19は、そのデータから“01”
(16進)を減算する(処理SU3)。上記処理SU1
〜SU3は、処理SU2でデリミタ判別部18によりデ
リミタが判別されるまで繰り返される。
First, the + 1BCD input unit 17 reads the first 1-byte data of + 1BCD from a predetermined area of a memory (not shown) (process SU1). Next, the delimiter discrimination unit 18 discriminates whether or not the read 1-byte data is a delimiter (process SU2), and if it is not the delimiter, the BCD conversion unit 19 extracts "01" from the data.
Subtract (hexadecimal) (processing SU3). The above processing SU1
~ SU3 is repeated until the delimiter is determined by the delimiter determination unit 18 in the process SU2.

【0029】したがって、例えば“00110011,
001100l1”(3333)の+1BCDは、処理
SU1〜SU3により“00110010,00110
010”(3232)のBCDに変換される。
Therefore, for example, "00110011,
The + 1BCD of “00110011” (3333) is “00110010,00110” by the processes SU1 to SU3.
It is converted into a BCD of 010 ″ (3232).

【0030】一方、上記処理SU2でデリミタ判別部1
8がデリミタを判別するとBCD出力部20はBCD変
換部19により変換されたBCDを読み出し演算装置
(不図示)等へ出力する。
On the other hand, in the processing SU2, the delimiter discriminating unit 1
When 8 determines the delimiter, the BCD output unit 20 reads the BCD converted by the BCD conversion unit 19 and outputs it to a computing device (not shown) or the like.

【0031】このように、本実施例によれば、オペレー
タがキーボードから入力する10進数を可変長の+1B
CDに変化してメモリ効率よく記憶することができる。
そして、10進演算の場合はメモリから+1BCDを読
み出してBCDに変換した後演算を行なえばよい。
As described above, according to this embodiment, the decimal number input by the operator from the keyboard is a variable length + 1B.
It can be changed to a CD and stored efficiently in memory.
In the case of decimal arithmetic, + 1BCD may be read from the memory, converted into BCD, and then arithmetic operation may be performed.

【0032】尚、BCDコードの10進数をオペレーデ
ィング・システムの区切りコードである「00」,「F
D」,「FE」,「FF」(以上16進値)、を避けた
コ−ドに変換するために、本実施例のように1を加算す
る以外に、「02」,「11」(以上16進値)等を加
算するようにしてもよい。
The decimal number of the BCD code is "00", "F" which is the delimiter code of the operating system.
In order to convert the code to avoid D, "FE", "FF" (above hexadecimal value), in addition to adding 1 as in the present embodiment, "02", "11" ( The above hexadecimal value) or the like may be added.

【0033】また、本実施例では指数部なしの+1BC
Dに変換しているが、図5に示すように符号+指数部か
ら成る1バイトSEを有する可変長の+1BCDに変換
することも可能である。同図においてdl〜dnは+1
BCDであり、Dはデリミタである。符号+指数部のバ
イトSEは、例えば同図に拡大して示すように、下位5
ビットbl〜b5で指数値を、第6ビットSeが指数の
符号(正、負)を表わし、第7ビットSnが可変長の+
1BCDの符号を示す。例えば、図5(b)に示す「2
4,46,68,8A,01」は、23456789×
100=23456789の10進数を表わす。
Further, in this embodiment, + 1BC without an exponent part is used.
Although it is converted to D, it is also possible to convert it to a variable-length + 1BCD having a 1-byte SE consisting of a code and an exponent as shown in FIG. In the figure, dl to dn are +1
BCD and D are delimiters. The sign SE and the byte SE of the exponent part are, for example, as shown in the enlarged view of FIG.
Bits bl to b5 represent the exponent value, the sixth bit Se represents the sign (positive or negative) of the exponent, and the seventh bit Sn is a variable length +.
1BCD code is shown. For example, “2 shown in FIG.
4,46,68,8A, 01 "is 234567789 ×
10 0 = represents the decimal 23456789.

【0034】[0034]

【発明の効果】以上詳細に説明したように、本発明によ
れば、BCDコードで表現された数値データをオペレー
ティングシステムの区切りコード例えばNULLコード
(16進の“00”)等を避けたコードに変換して、可
変長データでメモリに効率良く記憶でき、10進演算を
行なう際にはメモリから読み出されたコードを元のBC
Dコードに変換して演算できる。
As described above in detail, according to the present invention, the numerical data represented by the BCD code is converted into a code which avoids the delimiter code of the operating system, such as the NULL code (hexadecimal "00"). The converted data can be efficiently stored in the memory as variable length data, and the code read from the memory is used as the original BC when performing decimal operation.
It can be converted to D code and operated.

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

【図1】本発明によるデータ処理装置の一実施例のブロ
ック図である。
FIG. 1 is a block diagram of an embodiment of a data processing device according to the present invention.

【図2】(a)〜(c)は、本実施例のデータ処理の方
法を説明する図である。
2A to 2C are diagrams illustrating a data processing method according to the present embodiment.

【図3】本実施例の+1BCD変換の動作を説明する図
である。
FIG. 3 is a diagram for explaining an operation of + 1BCD conversion according to the present embodiment.

【図4】本実施例の+1BCDからBCDへの変換の動
作を説明する図である。
FIG. 4 is a diagram illustrating an operation of conversion from + 1BCD to BCD according to the present embodiment.

【図5】(a),(b)は、本発明により変換される+
1BCDの他のデータ形式を示す図である。
5 (a), (b) are converted according to the present invention +
It is a figure which shows the other data format of 1BCD.

【図6】(a)〜(c)は、従来のBCDの表現方法を
説明する図である。
6A to 6C are diagrams for explaining a conventional BCD expression method.

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

11 データ入力部 12 JISコード変換部 13 10進文字判別部 14 BCD生成部 15 +1BCD生成部 16 +1BCD出力部 17 +1BCD入力部 18 デミリタ判別部 19 BCD変換部 20 BCD出力部 11 Data Input Section 12 JIS Code Conversion Section 13 Decimal Character Discrimination Section 14 BCD Generation Section 15 + 1BCD Generation Section 16 + 1BCD Output Section 17 + 1BCD Input Section 18 Delimiter Discrimination Section 19 BCD Conversion Section 20 BCD Output Section

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 1バイトで2桁の数値を示すパック形式
のBCDコードで表現された数値データの各バイトに特
定の数値を加算し上記BCDコードをオペレーティング
システムで使用する区切りコードとは別のコードに変換
するコード変換手段と、このコード変換手段により変換
されたコードをメモリに記憶する手段と、10進演算を
行なう際に上記メモリから読み出されたコードの各バイ
トから上記コード変換手段で加算された上記特定の数値
を減算してBCDコードに変換して演算手段に出力する
手段とを具備したことを特徴とするデータ処理装置。
1. A specific numerical value is added to each byte of numerical data represented by a BCD code in a pack format, which indicates a 2-digit numerical value in 1 byte, and the BCD code is different from a delimiter code used in an operating system. Code conversion means for converting into a code, means for storing the code converted by the code conversion means in a memory, and each byte of the code read from the memory when performing a decimal operation by the code conversion means. A data processing device comprising: a unit that subtracts the added specific value, converts it to a BCD code, and outputs the BCD code to a calculation unit.
JP6217696A 1996-03-19 1996-03-19 Data processing device Expired - Lifetime JP2713283B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6217696A JP2713283B2 (en) 1996-03-19 1996-03-19 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6217696A JP2713283B2 (en) 1996-03-19 1996-03-19 Data processing device

Publications (2)

Publication Number Publication Date
JPH08263264A true JPH08263264A (en) 1996-10-11
JP2713283B2 JP2713283B2 (en) 1998-02-16

Family

ID=13192561

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6217696A Expired - Lifetime JP2713283B2 (en) 1996-03-19 1996-03-19 Data processing device

Country Status (1)

Country Link
JP (1) JP2713283B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7716267B2 (en) 2004-08-30 2010-05-11 Casio Computer Co., Ltd. Decimal computing apparatus, electronic device connectable decimal computing apparatus, arithmetic operation apparatus, arithmetic operation control apparatus, and program-recorded recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7716267B2 (en) 2004-08-30 2010-05-11 Casio Computer Co., Ltd. Decimal computing apparatus, electronic device connectable decimal computing apparatus, arithmetic operation apparatus, arithmetic operation control apparatus, and program-recorded recording medium
US8316067B2 (en) 2004-08-30 2012-11-20 Casio Computer Co., Ltd. Decimal computing apparatus, electronic device connectable decimal computing apparatus, arithmetic operation apparatus, arithmetic operation control apparatus, and program-recorded recording medium

Also Published As

Publication number Publication date
JP2713283B2 (en) 1998-02-16

Similar Documents

Publication Publication Date Title
US7113172B2 (en) Alphanumeric keypad and display system and method
JP4435096B2 (en) Data transmission method, data equalization method and apparatus
US20030093591A1 (en) System and method for fast data transfer to display driver
JPH0683571A (en) Method and system for converting many byte data
US20030093751A1 (en) System and method for fast cyclic redundancy calculation
US5479167A (en) Character code conversion unit
JPH08263264A (en) Data processor
EP0513829B1 (en) Fuzzy reasoning processor and method, and rule setting apparatus and method
US6591361B1 (en) Method and apparatus for converting data into different ordinal types
EP1310855A2 (en) Systems and methods for authentication of data strings
JP3120551B2 (en) Code conversion device
JPH06290021A (en) Method for compressing source program
JP3097294B2 (en) Code conversion device
JPH0248927B2 (en)
JPH0855011A (en) Method for converting data between different machine kinds
JPS5854443A (en) Hash converter
JPS6138493B2 (en)
JPH03144735A (en) Language processing system for interpreter
JPS63187334A (en) Character-string pattern matching device
JPS62119629A (en) Code conversion system
JPH03276366A (en) Kanji code processor
JPH0594345A (en) Data storing system
JPH09244904A (en) Virtual code translation system and virtual machine system
JPH07191972A (en) Method for compressing sentence
JP2000259613A (en) Code conversion system

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071031

Year of fee payment: 10