+

WO1992008188A1 - Semiconductor device - Google Patents

Semiconductor device Download PDF

Info

Publication number
WO1992008188A1
WO1992008188A1 PCT/JP1991/001496 JP9101496W WO9208188A1 WO 1992008188 A1 WO1992008188 A1 WO 1992008188A1 JP 9101496 W JP9101496 W JP 9101496W WO 9208188 A1 WO9208188 A1 WO 9208188A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
bit
flag
register
alu
Prior art date
Application number
PCT/JP1991/001496
Other languages
English (en)
French (fr)
Inventor
Hidenori Nagao
Original Assignee
Seiko Epson Corporation
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 Seiko Epson Corporation filed Critical Seiko Epson Corporation
Publication of WO1992008188A1 publication Critical patent/WO1992008188A1/ja

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/57Arithmetic logic units [ALU], i.e. arrangements or devices for performing two or more of the operations covered by groups G06F7/483 – G06F7/556 or for performing logical operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/38Indexing scheme relating to groups G06F7/38 - G06F7/575
    • G06F2207/3804Details
    • G06F2207/3808Details concerning the type of numbers or the way they are handled
    • G06F2207/3812Devices capable of handling different types of numbers
    • G06F2207/3816Accepting numbers of variable word length

Definitions

  • the present invention relates to a semiconductor device, and particularly to an arithmetic and logic unit therefor.
  • ALU inputs two operation terms, respectively, and adds or subtracts, for example, 8-bit data. Then, of the 9-bit operation result, the lower 8 bits are output as the operation result output, and the upper 1 bit is output as the carry signal.
  • the arithmetic function is fixed at 8 bits, so that the power that cannot handle data in units of 4 bits (1 nib ore) can be handled.
  • a 4-bit double arithmetic was executed. After that, the 5th bit out of the 8 bits of the operation result is referred to by the program, and it must be determined by the program whether the carry has occurred. The handling was troublesome. Disclosure of the invention
  • An object of the present invention to enable calculation of data having a plurality of bit widths.
  • An object of the present invention is to arbitrarily switch an arithmetic result to a hexadecimal or a 10-base.
  • An object of the present invention is to provide a semiconductor device capable of performing the above operation.
  • Another object of the present invention is to provide an electronic device incorporating such a semiconductor device.
  • a semiconductor device includes: an input unit for receiving an input data in an unpacked state; and a flag for performing an arithmetic operation. It is possible to perform arithmetic processing on the data to be set and the data of a plurality of bit widths, and the flag is set in the register and the short bit is set. When data processing of the bit width is commanded, the arithmetic operation is performed on the data of the bit width of 1Z2 of the input data, and the carry signal of the upper bit is calculated. With ALU to set in the carry flag.
  • the ALU has an arithmetic processing function of 16-bit and 8-bit bit widths, an arithmetic processing of data of 8-bit bit width is selected, and When an unchecked flag is set, the following processing is performed to obtain a 4-bit 1Z2 bit. The arithmetic processing of the bit width is performed.
  • the input data is input in an unpacked state. Therefore, only the lower 4 bits are valid and the upper 4 bits are invalid (the upper 4 bits). The bits are set to 0.) In this state, arithmetic processing is performed on the lower 4 bits, and the carry (or borrow) of the 4th bit is keyed. By setting the carry flag, the existence of the upper 4 bits is ignored, and the next 8 bits of data (the valid part is the lower 4 bits) However, it will function as a carry (or borrow) for the.
  • the operation in this case may be any of addition, subtraction, multiplication and division.
  • an arithmetic function in units of 4 bits is added to an arithmetic function previously fixed in units of 8 bits. It is now possible to programmatically select between bit operation and 4-bit operation.
  • 4-bit operation an overflow occurs every digit, and when the present invention is incorporated in a micro computer, multiple overflow occurs.
  • Each digit of the output result of complicated numerical calculation can be easily stored in one address unit. Therefore, the data is stored in one address and one address, and the decimal point position can be easily adjusted.
  • the semiconductor device sets a decimal flag when converting hexadecimal data to decimal data. It has a resistor.
  • the ALU converts the hexadecimal operation result to 10-decimal data and outputs it.
  • the data when storing arithmetic data in a storage device, the data is packed and stored, and the data is read out from the storage device. In this case, the data is automatically read and read.
  • the above-described semiconductor device is applied to various electronic devices.
  • it is applied to arithmetic operators, in which case setting the decimal flag allows the operation result to be displayed in decimal notation.
  • FIG. 1 is a block diagram showing a configuration of a semiconductor device according to one embodiment of the present invention.
  • Fig. 2 is a block diagram showing the details of the ALU in Fig. 1.
  • c Fig. 3 is an external view of the four arithmetic unit to which the semiconductor device in Fig. 1 is applied.
  • FIG. 4 to FIG. 11 are explanatory diagrams of the decimal operation, the anchor operation, and the pack operation.
  • FIGS. 12A and 12B are flow charts showing the processing flow in the case of addition processing in the four arithmetic units of FIG. 3.
  • FIG. 13 is a flowchart of FIG. This is a flow chart showing the flow of the processing of the operation routine of FIG.
  • FIG. 14 is a diagram showing a work area of the RAM.
  • FIG. 15 is a diagram showing an example of input data.
  • FIG. 16A to FIG. 16G are diagrams showing changes in data stored in the work area.
  • Fig. 17 is an evening chart showing the operation of the step of the addition process in Fig. 13.
  • FIG. 18 is a diagram showing data when the ADD instruction is executed.
  • FIG. 19 is a diagram showing data at the time of executing a pack instruction.
  • Figure 20 shows the data at the time of execution of the amp instruction.
  • FIG. 21A, FIG. 21B, FIG. 22A, FIG. 22B, and FIG. 23 to FIG. 29 are diagrams showing specific circuits of the ALU in FIG. BEST MODE FOR CARRYING OUT THE INVENTION
  • the semiconductor device shown in FIG. 1 includes a dress bus 2 and a data bus 4.
  • the input register 6 is used to input the input data from the data bus and to the timing generator. 8 Input the timing signals of these.
  • This instruction is decoded by the instruction decoder 10, and the micro-instruction signal is used. It is sent out via line group 12.
  • Reference numeral 4 is connected to the address bus 2 and the data bus 4 and to the microinstruction signal line group 12.
  • the data register group (A, B) 16 is connected to the data bus 4 and the microinstruction signal line group 12.
  • Temporary registers 18 and 20 are also connected to data bus 4 and microinstruction signal line group 12, and their outputs are Output to ALU22.
  • the temporary carry flag 24 is used to input the condition flag 26, the other flags, and the temporary register 18 And is connected to the microstructural signal line group 12.
  • AL ⁇ 22 receives the signals from the temporary carrier flag 24 and the temporary register 18, 20, as well as Performs prescribed arithmetic processing based on the transaction.
  • Temporary register 28 receives the output of ALU 22 and receives address bus 2 and data bus based on microinstruction. Output data via 4.
  • the input port 30 inputs a key input from the keyboard 32 via the address bus 2 and the data bus 4.
  • the ROM 34 stores, for example, a system program, etc.
  • the RAM 36 stores, for example, a key input from an external keyboard 32. In addition, it functions as a working memory described later.
  • the LCD driver 38 receives the data of the temporary register 28 and drives the LCD panel 40 to display the data.
  • the portion surrounded by a dashed line is composed of a chip microprocessor 42, an input port 3 2 and a keyboard 3 2 is an LCD driver 38 and an LCD panel 40 constituting the input device 44. 6.
  • ALU 2.2 is a 16-bit padder 50, as shown in Figure 2, and a decimator resistor.
  • a logic circuit 52 including clock logic and a right shifter 54 are included.
  • the ALU 22 can perform arithmetic processing of 16-bit and 8-bit bit widths, and each microcontroller corresponds to the bit width.
  • An installation kit is provided. Here, a description will be given of a case where an arithmetic processing function of 8-bit width is selected. In other words, in this embodiment, even when the 8-bit arithmetic processing function is selected, a 4-bit arithmetic processing can be performed. Therefore, the following description focuses on this point.
  • microactions are used.
  • the outline of the microactions is as follows.
  • ⁇ U SUB Inverts the temporary register A18 and "CYIN" during SUB and SBC operations, and generates a complement value of "2". Also, operate the flag on the operation result
  • UAND Selects AND operation as the ALU22 operation mode. Also, the flag is operated on the operation result (N, Z). • UOR: Performs an OR operation. Others are the same as UAND O
  • UCAL16 Selects 16-bit mode as ALU22 status (input signal to flag).
  • UDAPK Decimal area just operation and unpack operation (4 bits) are permitted. It is enabled at 8-bit addition / subtraction (ADD, ADC, SUB, SBC).
  • ⁇ SEP The 8-bit “2” complement value is expanded to 16 bits.
  • SWAP Exchanges the upper 2 and lower 2 bits of 8-bit data.
  • ⁇ UUPCK The data on the 8-bit register is stored in 16 bits. Unpack the data on the register.
  • microinstructions marked with ⁇ in the above are particularly related to the present invention.
  • the semiconductor device described above is applied to various types of electronic equipment.Here, the operation when applied to the four arithmetic units as shown in FIG. 3 will be mainly described. You
  • FIGS. 4 and 5 show. As shown. Whether the result of addition or subtraction of the input terms is output as BCD or HEX is switched according to the decimating flag "DF" described later.
  • FIGS. 6 and 7 show examples in which a 4-bit HEX value “7” and “B” are added and subtracted, respectively.
  • the lower four bits of the carry flag C carry flag C Set to F.
  • the lower four bits of the borrow are set in the carry flag CF.
  • the amp operation 4-bit operation
  • the function expands the data on the 8-bit register into the 16-bit register in the evening as shown in Fig. 10.
  • the processing is “UN” in this embodiment.
  • PACK "instruction.
  • the pack packs (reversely expands) the 16-bit register data on the 8-bit register as shown in Figure 11 on the 8-bit register. This packing process is performed by an "UNP ACK" instruction or the like in the present embodiment.
  • the key input and the like are input to the RAM 36, and the data structure at that time is, as shown in FIG. 15, the address "0000X” is the addition term word as shown in FIG. It is a query, and the address “0 0 IX” is a work area to be added.
  • the point indicated by reference numeral 60 is the boundary of the decimal point
  • 61 is the first decimal place
  • 62 is the second decimal place
  • 63 is the decimal point.
  • the seventh is shown respectively.
  • 64 indicates the “1” digit
  • 65 indicates the 100,000 digit
  • 66 indicates the 1,000,000 digit
  • 67 indicates the key input value. This area is used to store the position of the decimal point at the time of import.
  • the initial value of 1 X is “0000E”, where “0000” D ”and the digit position is one digit lower. Increment the digit counter by one (S29). "1" is set to the significant digit flag (S30).
  • M (0000F) is set to the value of M (0000F) — 1 and M (0000F) was "4", so it is "3" here. You. As described above, the value of M (0000F) is reduced by "1", and the process is repeated until the value of M (0000F) becomes zero (S50). When the value of M (0000F) becomes zero, the state shown in Fig. 16C is reached, and the decimal point alignment is completed.
  • the above 46 and 60 are examples of machine code.
  • the internal bus is a powerful 16-bit configuration, and only the lower 8 bits (I ⁇ 07 to 00) are used in the above instruction. Use and reduce execution cycles
  • the internal structure of CPu is composed of multiple bus lines (internal bus and external bus). The execution of this instruction is processed at the timing shown in the timing chart shown in FIG.
  • each instruction of the micro-instruction group for the data path is as follows.
  • UILVEB Transfer from lower internal bus to external bus
  • UEBIL Transfer from lower external bus to lower internal bus
  • UAVIL Read from A register to lower internal bus
  • UILVA Internal bus lower power, write to A register UWITHC: Carry flag power, write to temporary carrier flag
  • the addition instruction (ADD instruction) is as shown in FIG.
  • the temporary register “A” (TA) stores “19” in the lower eight bits, and the temporary register.
  • Register B (TB) stores "58" in the lower 8 bits. Then, both of them are added to the temporary flag TC, and the 16-bit adder output CAL is output to the decimal output register. Make an input to the knock logic. Decimazorea Just Finale Amp In the clock, BCD correction and unpack correction are performed, the output DAF is as shown in the figure, and the calculation output is “0 ⁇ 0100”. "1" is set in the carry flag CF.
  • each digit of the input data is stored in one-address units in decimal notation.
  • the position of the decimal point between the addition term and the augmented term can be easily adjusted.
  • addition of each digit can be output in one-digit decimal system (BCD, 4 bits), and the addition of the one digit is an overflow. Since it can be reflected in the carry flag CF, carry processing to the upper digit can be easily performed.
  • the program is executed by executing a pack instruction (PACK instruction) to store the data. This can save space.
  • PACK instruction pack instruction
  • Temporary register A stores B, A, and force as 16-bit data. “0000H” is stored in B (TB). Then, when the two are added, a 16-bit adder output CAL is obtained. Entered in 2.
  • the output DAF is as shown in the figure, and the lower 4 bits of data, the 9th power of the output CAL, and the 12th bit of data are output. No ,. And obtained as the output of ALU22. Therefore, the lower 8 bits of the output of ALU 22 are treated as valid data and stored in RAM 36, but the upper 8 bits are treated as invalid data. .
  • an unpacking instruction (UNP ACK instruction) is executed by the program.
  • a numerical value of 65 will be explained as an example.
  • Temporary register A stores the value of ⁇ 0H '' in the upper part and the value of register A in the lower part.
  • "0000H” is stored in the evening B (TB).
  • Addition of the two results in a 16-bit Atsuta output CAL, which is a digital filter, a digital filter, and a logic filter. Input to the circuit.
  • the output DAF is as shown in the figure, and the lower 4 bits of data remain the same as the lower 4 bits of the ALU output, and the next 4 bits are output. "0H” is introduced. In the next 4 bits, the data of the upper 4 bits of the DAF output is output, and in the next 4 most significant bits, “0H” is inserted. . In this way, the unpacked data "0605" is obtained.
  • FIGS. 21A to 29 The specific circuit configuration of ALU22 is as shown in FIGS. 21A to 29.
  • FIG. FIGS. 21A and 21B are ALU wiring diagrams.
  • FIGS. 22A and 22B are 16-bit atlas circuits, and
  • FIG. 23 is a decimal adjuster. Evening ⁇ Anno.
  • FIG. 24 is a circuit diagram showing the configuration of a clock logic circuit
  • FIG. 24 is an ALU shifter
  • FIG. 25 is a circuit diagram showing each configuration of a control flag.
  • FIGS. 26 to 29 are specific circuit diagrams of the latches constituting the control flag shown in FIG.
  • FIG. 25 corresponds to the FLAG block of FIG. 21B
  • FIG. 21B corresponds to the condition flag 26 of FIG.
  • Figure 26 is a circuit diagram of the zero-flag, over-flag, and negative flag grabbers.
  • Figure 27 is a circuit diagram of the 2-bit interrupt flag latch
  • Figure 28 is a circuit diagram of the carry flag latch
  • Figure 29 is a decimal flag. This is the circuit diagram of the amp flag latch section.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Executing Machine-Instructions (AREA)

Description

明 細 書 半 導 体 装 置 技 術 分 野
本発明 は半導体装置、 特に そ の算術論理演算ュニ ッ ト
(以下 A L U と い う ) の演算処理 に関す る 。 背 景 技 術
従来の半導体装置 に お い て は、 A L U は、 2 つ の演算 項を そ れぞれ入力 し 、 例え ば 8 ビ ッ 卜 の デー タ を加算又 は減算す る 。 そ し て、 9 ビ ッ 卜 の演算結果中、 下位 8 ビ ッ 卜 が演算結果出力 と し て、 上位 1 ビ ッ 卜 が桁上信号 と し て それぞれ出力す る 。
こ の よ う な A L U に お い て は、 演算機能が 8 ビ ッ ト に 固定 さ れて い た た め、 4 ビ ッ ト ( 1 ニ ブノレ) 単位での デ — 夕 が扱え な 力、 つ た。 こ の A L U をマ イ ク ロ コ ン ピ ュ ー 夕 に取 り 入れて 4 ビ ッ 卜 単位の演算処理を さ せ る 場合 に は、 4 ビ ッ ト ど う し の二 ブル演算を実行 し た後、 演算結 果の 8 ビ ッ ト 中 の 5 ビ ッ ト 目 を プ ロ グラ ムで参照 し 、 桁 上げが生 じ た か ど う かを プ ロ グ ラ ム に よ っ て判断 し な け ればな ら ず、 そ の取扱 いが面倒であ っ た。 発 明 の 開 示
本発明 の 目 的 は、 複数の ビ ッ ト 幅の デー タ の演算を容 易 に行 う こ と がで き る 半導体装置を提供する こ と に あ る < ま た、 本発明の 目 的は、 演算結果を 1 6 進又は 1 0 進 に任意に切 り 替え る こ と がで き る 半導体装置を提供す る こ と に あ る 。
更に、 本発明の他の 目 的 は、 こ の よ う な半導体装置を, 内蔵 し た電子機器を提供す る こ と に あ る 。
本発明 の一つ の態様に従え ば、 半導体装置 は、 入力 デ 一 夕 をア ンパ ッ ク し た状態で取 り 込む入力手段 と 、 ア ン ク 演算処理をす る 際に フ ラ グがセ ッ 卜 さ れ る レ ジ ス 夕 と 、 複数の ビ ッ ト 幅の デー タ を演算処理す る こ と がで き 、 前記 レ ジ ス タ に フ ラ グがセ ッ 卜 さ れ、 かつ短い ビ ッ ト 幅の デー タ 処理が命令 さ れてい る 状態では、 入力 デ一 夕 の 1 Z 2 の ビ ッ ト 幅の デー タ につ いて演算 し 、 そ の上 位 ビ ッ ト の キャ リ ー信号をキ ャ リ ー フ ラ グに セ ッ 卜 す る A L U と を有す る 。 例え ば、 A L U は 1 6 ビ ッ ト 及び 8 ビ ッ 卜 の ビ ッ ト 幅の演算処理機能を有 し.、 8 ビ ッ ト の ビ ッ ト 幅の デー タ の演算処理が選択 さ れ、 かつ ア ン " ッ ク フ ラ グがセ ッ 卜 さ れてい る と き に は次の よ う な処理をす る こ と に よ り そ の 1 Z 2 ビ ッ ト で あ る 4 ビ ッ 卜 の ビ ッ ト 幅の演算処理がな さ れ る 。
入力 デー 夕 はア ンパ ッ ク の状態で人力 さ れてお り 、 従 つ て、 下位 4 ビ ッ ト の みが有効であ り 、 上位 4 ビ ッ ト は 無効 と な っ てい る (上位 4 ビ ッ ト に は 0 がセ ッ ト さ れて い る 。 ) 。 こ の状態で下位 4 ビ ッ ト に つ い て の演算処理 を行い、 こ の 4 ビ ッ ト 目 の キ ャ リ ー (又はボ ロ ー) をキ ャ リ ー フ ラ グに セ ッ ト す る こ と に よ り 、 上位 4 ビ ッ 卜 の 存在が無視 さ れ、 次の 8 ビ ッ ト の デ一 夕 (有効な部分は 下位 4 ビ ッ ト であ る が) に対す る キ ャ リ ー (又 は ボ ロ ー ) と し て機能す る こ と に な る 。 こ の 場合 の演算 は加算、 減 算、 乗算及び除算の いずれであ っ て も よ い。
こ の よ う に本発明 に お い て は、 従来 8 ビ ッ ト 単位に 固 定 さ れて い た演算機能 に対 し て 4 ビ ッ ト 単位での演算機 能を付加 し 、 更に、 8 ビ ッ ト 演算或い は 4 ビ ッ ト 演算か を プ ロ グラ マ ブルに選択で き る よ う に し た。 そ し て、 4 ビ ッ ト 演算で はオ ー バ ー フ ロ ー が各桁 ご と に発生 し 、 本 発明 をマ イ ク ロ コ ン ピ ュ ー タ に取 り 入れた場合 に は、 複 雑な数値計算の 出力結果の各 1 桁を 1 ァ ド レ ス単位 に容 易 に格納で き る 。 従 っ て、 1 デー タ 力 1 ア ド レ ス に格納 さ れ る こ と に な り 、 そ の小数点位置を合わせ る のが容易 に な る 。
ま た、 1 ア ド レ ス に 1 桁が格納 さ れて.い る た め、 それ を実行す る た めの プ ロ グ ラ ム の作成が容易 と な る 。 更 に 、 8 ビ ッ 卜 と 4 ビ ッ 卜 の演算機能がプ ロ グラ マ ブル に 切 り 換えで き る た め、 演算命令を複数種類用意す る 必要がな る 。
ま た 、 本発明 の他の態様に従え ば、 半導体装置 は、 1 6 進デー タ を 1 0 進デー タ に変換す る 際 に はデ シ マ ル フ ラ グ力 セ ッ ト さ れ る レ ジ ス タ を有す る 。 A L U は、 こ の デ シ マ ノレフ ラ グ力 セ ッ ト さ れて い る と き に は、 1 6 進 の 演算結果を 1 0 進デー タ に変換 し て 出力す る 。 ま た、 本発明 の他の態様に おいて は、 演算デー タ を記 憶装置 に格納す る 際に はデー タ をパ ッ ク し て格納 し 、 記 憶装置力、 ら デー タ を読み 出す際に は 自動的に ァ ンパ ッ ク し て読み出す。 こ の よ う に し て、 パ ッ ク 機能及びア ン ッ ク 機能を持たせ る こ と に よ り 、 上述の演算デー タ の処 理 と 整合性を も たせ る こ と がで き る 。
更に、 本発明の他の の態様に従え ば、 上述の半導体装 置 は、 各種の電子機器 に適用 さ れ る 。 .例えば四則演算器 に適用 さ れ、 そ の場合 に デ シマ ルフ ラ グをセ ッ ト す る こ と に よ り 、 演算結果を 1 0 進法に よ り 表示す る こ と がで き る o 図面の簡単な説明
図 1 は本発明 の一実施例の半導体装置の構成を示すブ 口 ッ ク 図であ る 。
図 2 は図 1 の A L U の詳細を示 し た ブ.ロ ッ ク 図であ る c 図 3 は図 1 の半導体装置が適用 さ れた四則演算器の外 観図であ る 。
図 4 〜図 1 1 はデ シ マ ノレア ジ ャ ス ト 演算、 ア ン ッ ク 演算及びパ ッ ク 演算の説明図であ る 。
図 1 2 A及び図 1 2 B は図 3 の 四則演算器 に お け る 加 算処理の場合の処理の流れを示すフ ロ ー チ ヤ 一 ト であ る , 図 1 3 は図 1 2 A の演算ル ー チ ン の処理の流れを示す フ ロ ー チ ヤ 一 卜 で あ る 。
図 1 4 は R A M の ワ ー ク エ リ ア を示す図であ る 。 図 1 5 は入力 デー タ の例を示す図であ る 。
図 1 6 A 〜図 1 6 G は ワ ー ク エ リ ア に格納 さ れ る デ一 夕 の変遷を.示す図であ る 。
図 1 7 は図 1 3 の加算処理の ス テ ッ プ の動作を示す 夕 イ ミ ン グチ ャ ー ト であ る 。
図 1 8 は A D D 命令の実行時の デー タ を示す図であ る 。 図 1 9 はパ ッ ク 命令の実行時の デー タ を示す図であ る 。 図 2 0 は ァ ンパ ッ ク 命令の実行時の デー タ を示す図で あ る o
図 2 1 A 、 図 2 1 B 、 図 2 2 A 、 図 2 2 B 、 図 2 3 〜 図 2 9 は図 1 の A L U の具体的な 回路を示 し.た 図であ る 。 発明 を実施す る た め の最良の形態
図 1 に示 さ れ る 半導体装置 は、 テ ド レ ス バ ス 2 及びデ 一 夕 バス 4 を備え て い る 。 イ ン ス ト ラ ク シ ョ ン レ ジ ス タ 6 は ィ ン ス ト ラ ク シ ョ ン をデー タ バス 4.力、 ら入力す る と 共に、 タ イ ミ ン グ ジ ェ ネ レ ー タ 8 力、 ら の タ イ ミ ン グ信号 を入力す る 。 こ の イ ン ス ト ラ ク シ ョ ン は イ ン ス ト ラ ク シ ョ ン デ コ ー ダ 1 0 に てデ コ ー ダ さ れ、 マ イ ク ロ イ ン ス ト ラ ク シ ョ ン 信号線群 1 2 を介 し て送 り 出 さ れ る 。
ア ド レ ス レ ジ ス タ 群 ( I X , I Y , H L , B R等) 1
4 は ア ド レ ス バ ス 2 及びデー タ バ ス 4 並びに マ イ ク ロ イ ン ス ト ラ ク シ ヨ ン信号線群 1 2 と 接続 さ れてい る 。 デー 夕 レ ジ ス タ 群 ( A , B ) 1 6 はデー タ バス 4 及びマ イ ク ロ イ ン ス ト ラ ク シ ョ ン信号線群 1 2 に接続 さ れて い る 。 テ ン ポ ラ リ レ ジ ス タ 1 8 , 2 0 も デー タ バス 4 及びマ イ ク ロ イ ン ス ト ラ ク シ ョ ン信号線群 1 2 と接続 さ れてお り 、 そ の 出力 は A L U 2 2 に 出力す る 。 テ ン ポ ラ リ キ ヤ リ フ ラ グ 2 4 は、 コ ン デ シ ョ ン フ ラ グ 2 6 力、 ら の フ ラ グを入 力す る と共に テ ン ポ ラ リ レ ジ ス タ 1 8 の 出力を入力 し、 かつ マ イ ク ロ イ ン ス ト ラ ク シ ョ ン信号線群 1 2 と 接続 さ れ て い る 。
A L ϋ 2 2 は、 テ ン ポ ラ リ キ ヤ リ フ ラ グ 2 4 及びテ ン ポ ラ リ レ ジ ス タ 1 8 , 2 0 か ら の信号を入力す る と共に マ イ ク ロ イ ン ス ト ラ ク シ ョ ン に基づいて所定の演算処理 をす る 。 テ ン ポ ラ リ レ ジ ス タ 2 8 は A L U 2 2 の 出力を 入力 し マ イ ク ロ イ ン ス ト ラ ク シ ョ ン に 基づ い て ア ド レ ス バ ス 2 及デー タ バ ス 4 を介 し て デー タ を出力す る 。
入力 ポ ー ト 3 0 はキー ボー ド 3 2 か ら の キー入力をァ ド レ スバス 2 及デー タ バス 4 を介 し て入力する。 R O M 3 4 に は例えば シ ス テ ム プ ロ グラ ム等が.格納 さ れてお り . R A M 3 6 に は例え ば外付けの キー ボー ド 3 2 か ら のキ 一入力をが格納 さ れた り 、 後述す る ワ ー キ ン グメ モ リ と し て の機能を果たす。 L C D ド ラ イ バ 3 8 は例え ばテ ン ポ ラ リ レ ジ ス 夕 2 8 の デー タ を入力 し、 L C D パネ ノレ 4 0 を駆動 し て表示 さ せ る 。
図 1 に おいて一点鎖線で囲 ま れた部分は 1. チ ッ プマ イ ク ロ プ ロ セ ッ サ 4 2 に よ り 構成 さ れてお り 、 入力 ポ ー ト 3 2 及びキー ボー ド 3 2 は入力装置 4 4 を構成 し てい る L C D ド ラ イ バ 3 8 及び L C D パネ ノレ 4 0 は出力装置 4 6 を構成 し て い る 。
A L U 2 .2 は、 図 2 に示 さ れ る よ う に、 1 6 ビ ッ ト ァ ッ ダ ー 5 0 、 デ シ マ ノレ ア ジ ャ ス ト フ イ ノレ タ ♦ ア ン ノヽ。 ッ ク ロ ジ ッ ク を含む論理回路 5 2 及び右方向 シ フ タ 一 5 4 を 含んで い る 。 そ し て、 こ の A L U 2 2 は 1 6 ビ ッ ト 及び 8 ビ ッ 卜 の ビ ッ ト 幅の演算処理が可能であ り 、 それぞれ そ の ビ ッ ト 幅 に対応 し た マ イ ク ロ イ ン ス ト ラ ク シ ョ ン カ 用意 さ れて い る 。 こ こ で は 8 ビ ッ ト 幅の演算処理機能力 選択 さ れて い る 場合 につ い て説明す る 。 つ ま り 、 こ の実 施例 に お い て は、 8 ビ ッ ト 幅の演算処理機能が選択 さ れ て い る 状況下に お い て 4 ビ ッ ト 幅の演算処理を も 可能に し て い る 点に特徴があ り 、 従 っ て、 以下そ の点を中心に 説明す る 。
こ の実施例 に お い て は各種の マ イ ク ロ イ ン ス ト ラ ク シ ョ ン を使用す る が、 そ の概要 は次の と お り で あ る 。
★ U A D D : A D D , A D C 演算結果に.対す る フ ラ グの 操作をす る ( N , V , C , Z ) 。 ( A L U に対す る 操作 は特に な い。 )
★ U S U B : S U B , S B C 演算時 に テ ン ポ ラ リ レ ジ ス タ A 1 8 及び " C Y I N "を反転 し 、 「 2 」 の補数値を 発生す る 。 ま た 、 演算結果 に対す る フ ラ グ の操作を行 う
( N , V , C , Z ) o
★ U A N D : A N D 演算を A L U 2 2 の演算モ ー ド と し て選択す る 。 ま た、 演算結果 に対す る フ ラ グ の操作を行 う ( N , Z ) 。 • U O R : O R演算を行 う 。 そ の他は U A N D と 同様で あ る O
• U X O R : X O R演算を行 う 。 そ の他は U A N D と 同^で' ¾> O o
★ U W I T H C : " C Y I N " の 入力 と し て " C F " を 選択す る 。
• U W I T H 7 : " C Y I N " の入力 と し て テ ン ポ ラ リ レ ジ ス 夕 A 1 8 の 2 ' ビ ッ ト を選択す る 。
• U C A L 1 6 : A L U 2 2 の ス テ ー タ ス ( フ ラ グへの 入力信号) と し て 1 6 ビ ッ ト モ ー ドを選択する 。
★ U D A P K : デ シ マ ノレア ジ ャ ス ト 演算 · ア ン パ ッ ク 演 算 ( 4 ビ ッ ト ) を許可す る 。 8 ビ ッ ト 加減算 ( A D D , A D C , S U B , S B C ) 時に イ ネ一ブル と な る 。
♦ U N C H G C : N F , V F , C F への書込みを禁止す
• U R R , U R R C , U S R A , U S R.L : 右 シ フ ト 、 ロ ー テ一 ト 機能を A L U 2 2 の動作 と し て選択す る 。
• U S L L : V F への書込みを禁止す る 。
♦ S E P : 8 ビ ッ ト の 「 2 」 の補数値を 1 6 ビ ッ ト に拡 張す る 。
• S W A P : 8 ビ ッ ト デー タ の上位二 ブル と下位二ブル を入替 る 。
* U P A C : 1 6 ビ ッ ト レ ジ ス タ 上に ア ン パ ッ ク 展開 さ れて い る デー タ を 8 ビ ッ ト レ ジ ス タ 上にノ、。 ッ ク す る 。
★ U U P C K : 8 ビ ッ ト レ ジ ス タ 上の デー タ を 1 6 ビ ッ ト レ ジ ス タ 上に ア ン パ ッ ク 展開す る 。
な お、 上記の 内★印の マ イ ク ロ イ ン ス ト ラ ク シ ョ ン は 特 に本発明 に関係す る も のであ る 。
上述の半導体装置 は各種の電子機器 に適用 さ れ る が、 こ こ で は図 3 に示 さ れ る よ う な 四則演算器に適用 し た場 合 につ い て の動作を.中心に説明す る 。
こ の 四則演算器 は 8桁の 7 セ ン グメ ン ト L C D力、 ら な る L C Dノ、。ネ ノレ 4 0 を備え て い る も の と す る 。 こ こ では そ の演算処理の詳細を説明す る の に先立 っ て、 デ シ マ ル ア ジ ヤ ス ト 演算及びア ンパ ッ ク 演算の概念を説明す る 。 ( A ) デ シ マ ノレ ア ジ ャ ス ト 演算 :
B C D と し て入力す る 2項の 1 0 進数を加算又 は減算 し 、 B C D ( 1 0 進数) で解を出力す る 。 こ こ で 、 例 と し て 8 ビ ッ ト ( 2桁) の B C D値 " 5 8 " と " 7 9 " と を加算及び減算す る 場合 につ い て見 る と 、 図 4 及び図 5 に示す よ う に な る 。 入力項の加算又 は減.算結果を B C D で出力す る か或い は H E Xで出力す る か は後述す る デ シ マ ノレフ ラ グ " D F " に よ っ て切 り 換え る 。
( B ) ア ン パ ッ ク 演算
8 ビ ッ ト 演算処理を 4 ビ ッ 卜 に見た てて実行す る 。 演 算結杲は下位 4 ビ ッ 卜 の桁あふれでキ ヤ リ ー発生 と な る 。 ま た 、 上位 4 ビ ッ 卜 に は何が入力 さ れて も 結果 に は影響 し な い。 図 6及び図 7 に 4 ビ ッ ト の H E X値 " 7 " と " B " と を加算及び減算 し た場合の例を示す。 図 6 の加 算 の 例 で は下位 4 ビ ッ 卜 の キ ヤ リ 一 力く キ ヤ リ ー フ ラ グ C F に セ ッ ト さ れ る 。 図 7 の減算の例では下位 4 ビ ッ 卜 の ボ ロ ー がキ ャ リ ー フ ラ グ C F にセ ッ 卜 さ れ る 。 こ の例 に お いて も 入力項の上位 4 ビ ッ ト に何が入力 さ れて も 、 出 力の上位 4 ビ ッ ト は を出力す る 。 ア ンパ ッ ク 演算 ( 4 ビ ッ ト 演算) は後述す る ア ンパ ッ ク フ ラ グ " U F " によ っ て使用す る か否かが選択 さ れ る。
以上のデ シマ ノレフ ラ グ " D F " 及びア ン ク フ ラ グ " U F " に よ る 演算モー ドは次の 4 種類 と な る 。
ひ F U F 演算モ 一 ド
0 0 8 ビ ッ ト 1 6 進数演算
0 8 ビ ッ ト 1 0 進数演算
0 1 4 ビ ッ ト 1 6 進数演算
1 4 ビ ッ ト 1 0 進数演算 上記の 4 ビ ッ ト 1 0 進数演算は 則演算器に特に効果 的であ る ο
次に 、 4 ビ ッ ト 1 0 進数演算の例を説.明す る 。
4 ビ ッ 卜 の B C D 値 " 5 " と " 9 " と を加算及び減算 す る ½合 につ い て見 る と 、 図 8 に示 さ れ る 加算の下位 4 ビ ッ 卜 の キ ャ リ ーがキ ャ リ ー フ ラ グ C F に セ ッ ト さ れ る 図 9 の減算の例で は下位 4 ビ ッ ト の ボ がキ ヤ リ ー フ ラ グ C F にセ ッ ト さ れ る 。
次に 、 パ ッ ク 及びア ンパ ッ ク の動作説明をす る 。
ァ ン ク は 8 ビ ッ ト レ ジ ス タ 上の デー タ を 1 6 ビ ッ ト レ ジ ス 夕 上に、 図 1 0 に示すよ う に ア ンパ ッ ク 展開す る o の ァ ン ッ ク 処理は、 本実施例におい て は " U N P A C K " 命令等 に よ り 行われ る 。
パ ッ ク は、. 1 6 ビ ッ ト レ ジ ス 夕 上の デー タ を 8 ビ ッ ト レ ジ ス タ 上に 、 図 1 1 に示す よ う に 、 パ ッ ク (逆展開) す る 。 こ のパ ッ ク 処理 は、 本実施例 に お い て は " U N P A C K " 命令等に よ り 行われ る 。
以上の説明 に よ り デ シ マ ノレア ジ ャ ス ト 演算、 ア ンパ ッ ク 演算及びパ ッ ク 演算の概念が明 ら かに な っ た と こ ろ で、 次に、 図 1 2 A 、 図 1 2 B 及 び図 1 3 の フ ロ ー チ ャ ー ト に従 っ て図 1 の.半導体装置の動作説明 をす る 。 例え ば入 力 デー タ と し て、 図 1 4 に示すよ う に、 「 5 7 1 4 . 9 2 + 9 6 . 1 3 8 6 = 」 をキ ー ボー ド 3 2 を介 し て入力 す る 場合 につ い て説明す る 。
キー入力等は R A M 3 6 に入力 さ れ る が、 そ の時の デ 一 夕 構造は図 1 5 に示 さ れ る よ う に 、 ア ド レ ス 「 0 0 0 X 」 は加算項 ワ ー ク エ リ ア であ り 、 ア ド レ ス 「 0 0 I X 」 は被加算項 ワ ー ク エ リ ア と な っ て い る 。 そ し て、 各デ一 夕 に お い て、 符号 6 0 で示 し た個所は小数点の境界線で あ り 、 6 1 は小数点第 1 位、 6 2 は小数点第 2 位、 6 3 は小数点第 7 を それぞれ示 し て い る 。 ま た、 6 4 は 「 1 」 の位、 6 5 は 1 0 0 万の位、 6 6 は 1 0 0 0 万の位を そ れぞれ示 し てお り 、 6 7 はキ ー 入力取 り 込み時の小数点 の 位置を格納す る 領域であ る 。
(1) キ ー ボー ド 3 2 の ク リ ア キー (図示せず) をキ 一 入力す る と 、 R A M 3 6 の ア ド レ ス 「 0 0 0 0 」 〜 「 0 0 1 E J 力 ク リ ア さ れ る (S10) 。 そ し て、 図 1 6 A の状 態が得 られ る 。
(2) 次に、 各種の フ ラ グを初期化す る (S11) 。 例え ば ポ イ ン タ ー M ( 0 0 0 F ) に 「 8 」 を格納す る o イ ン デ ッ ク ス レ ジ ス タ I X に 「 0 0 0 E 」 を格納す る 。 桁数力 ゥ ン タ に 「 0 」 をセ ッ ト し、 小数点フ ラ グに 「 0 _| をセ, ッ ト し 、 更に、 有効数字フ ラ グに 「 0 」 をセ ッ 卜 す る こ と に よ り こ れ ら の フ ラ グを リ セ ッ 卜 す る。
(3) 入力 ポ ー ト 3 0 の デー タ を読み込む (S 12) 。 そ し て、 そ の デ ー タ 力 ど の キ ー 入 力 で あ る か を 判 別 す る (S13) 。
(4) こ こ で は、 キー入力が数値入力であ る と す る と 、 桁数カ ウ ン タ が 「 8 」 未満であ る か ど う かを判断 し (S20 ) 、 こ こ では 「 8 」 未満であ る と し た と き 、 次にキー入 力が 「 0 」 であ る か ど う かを判断す る (S21) 。 「 0 」 で な い場合 に は、 次に そ の数値力く 「 1 」 〜 「 9 」 の いずれ で あ る かを判断す る (S22) 。 そ し て、 そ .の数値をア ンパ ッ ク し た状態で M ( I X ) に格納す る (S23) 。 例えばそ の数値が 「 1 」 であれば 「 0 1 」 と し て格納す る 。
(5) 次に、 小数点フ ラ グが 「 1 」 であ る か ど う かを判 定 し (S26) 、 こ こ で は小数点フ ラ グ力 「 1 」 ではな い と す る と 、 '次に レ ジス タ M ( 0 0 0 F ) に レ ジス タ M ( 0
0 0 F ) — 1 の値を格納す る (S27) 。 初期値 M ( 0 0 0 F ) = 0 8 であ り 、 こ こ で は 「 0 7 」 と な る 。
(6) レ ジ ス タ I X に I X — 1 の値を格納す る (S28) 。
1 X の初期値は 「 0 0 0 E 」 であ り 、 こ こ では 「 0 0 0 D 」 と な り 桁位置が 1 桁下位に な る 。 桁数カ ウ ン タ を 1 イ ン ク リ メ ン ト す る (S29) 。 有効数字フ ラ グに 「 1 」 を セ ッ ト す る (S30) 。
次に、 再 び入力 ポ ー ト 3 0 の デ ー タ を 読 み 込 む処理 (S12) に戻 る 。 以上の処理を繰 り 返 し て、 「 5 」 「 7 」 . 「 1 」 「 4 」 と い う デー タ がア ド レ ス ( 0 0 0 X ) に順 次格納 さ れて い く 。
次 に。 キ ー 入力 と し て 「 . 」 が入力 し た場合 につ い て 説明す る 。
(7) キー入力 の種類を判定 し てそれが小数点 「 . 」 で あ る と す る と ( S 13 ) 、 小数点 フ ラ グに 「 1 」 をセ ッ 卜 し (S18) 、 次 に有効数字フ ラ グが 「 1 」 であ る か ど う かを 判断す る (S19) 。 こ こ で は、 有効数字フ ラ グが既 に 「 1 」 に セ ッ 卜 さ れて い る ので、 次 に再ぴ入力 ポ ー ト 3 0 の デ 一 夕 を読み込む処理 (S12) に戻 る 。
(8) 次 に、 再び小数点以下の数値が入力 し た場合 に は、 ス テ ッ プ (S12) 、 (S20) 〜 (S22) の処理を経由 し 、 次に 小数点 フ ラ グ力 「 1 」 に セ ッ 卜 さ れてい る 力、 ど う 力、を判 定す る が、 こ こ で は既 に 「 1 」 に セ ッ 卜 さ れて い る の で、 ス テ ッ プ (S27) の処理を飛ば し て ス テ ッ プ (S28) 以降の 処理に進む。
以上の処理を繰 り 返す こ と に よ り 、 小数点以下の数値 「 9 2 」 力《 ア ド レ ス ( 0 0 0 X ) に順次取 り 込 ま れて い
< 0
こ の よ う に し て数値 「 5 7 1 4 . 9 2 」 を入力 し た後 の ア ド レ ス ( 0 0 0 X ) の デー タ は図 1 4 B に示 さ れ る よ う に な る 。-
(9) 次に、 「 十 」 キーが入力す る と 、 キー入力の種類 が判断 さ れた 際に、 演算ルー チ ンが呼び出 さ れて演算処 理に移 る ( S 16 ) 。
ま ず。 M ( 0 0 0 F ) が 「 0 」 であ る かど う かを判断 し (S50) 、 こ こ で は 「 4 」 に設定 さ れて い る ので、 次に レ ジ ス 夕 I X に 「 0 」 をセ ッ 卜 し (S51) 、 M ( I X + 1 ) の値を M ( I X ) に格納す る 。 I X + 1 を レ ジ ス タ I X に格納 し て (S53) 、 こ の I X の値力《 「 0 0 0 E 」 と等 し く な つ たか ど う かにつ い て判断 し (S 54) 、 等 し く な けれ ば上記の処理 (S52) , (S53) の処理を繰 り 返す。 こ の処 理が繰 り 返 さ れ る こ と に よ り 、 入力 デー タ が 1 桁ずつ下 位側 (右方向) に シ フ ト す る 。
(10)次に、 I X力 「 0 0 0 E 」 に な る と (S 54) 、 M
( I X ) に 「 0 」 をセ ッ ト す る (S55) 。 ま り 、 「 0 0 0 E 」 の桁に 「 0 」 力 セ ッ ト さ れ る 。
M ( 0 0 0 F ) に M ( 0 0 0 F ) — 1 の値をセ ッ ト し 、 M ( 0 0 0 F ) が 「 4 」 であ っ た ので、 こ こ では 「 3 」 と な る。 こ の よ う に M ( 0 0 0 F ) の値を 「 1 」 ずつ減 じ て い き 、 M ( 0 0 0 F ) の値が零にな る ま で繰 り 返す (S50) 。 M ( 0 0 0 F ) の値が零に な っ た状態の デ一 夕 は図 1 6 C に示 さ れた状態に な り 、 小数点の位置合わせ が完了す る 。
(11 )フ ラ グ U F に 「 1 」 をセ ッ 卜 し ( S 57 ) 、 フ ラ グ D F に 「 1 」 を セ ッ 卜 す る (S58) 。 レ ジ ス タ I Y に 「 0 0 0 0 」 を セ ッ 卜 し (S59) 、 レ ジ ス 夕 I X に 「 0 0 1 0 」 をセ ッ 卜 す る (S60) 。
(12) M ( I X ) に M ( I X ) + M ( I Y ) + C F ( : C F の初期値は零) の演算 し た結果を格納す る ( こ の処 理 に つ い て は そ の詳細を後述す る 。 ) 。 次に、 レ ジ ス タ I Y及 び I X の 値を そ れ ぞれ 「 1 」 ずつ イ ン ク リ メ ン 卜 し (S62) , (S63) 、 レ ジ ス タ I X の値力、' 「 0 0 0 F 」 に な る ま で繰 り 返す (S64) 。 こ の よ う に し て、 ア ド レ ス
「 0 0 0 X 」 の値 と ア ド レ ス 「 0 0 1 X 」 の値 ( こ こ で は 「 0 」 で あ る 力 ) と を加算 し て、 ア ド レ ス 「 0 0 1 X 」 に格納す る 。 こ こ で は ア ド レ ス 「 0 0 1 X 」 の値 は 当初
「 0 」 で あ る 力、 ら 、 ア ド レ ス 「 o o o x」 の値を ァ ド レ ス 「 0 0 1 X 」 に コ ピ ー し た状態 と な り 、 図 1 6 D に示 さ れ た 状態 と な る 。
(13)次 に 、 フ ラ グ U F 及 び フ ラ グ D F.に 「 0 」 を そ れ ぞれセ ッ ト し (S65) , (S66) 、 有効桁を判断 し て 「 5 7 1 4 , 9 2 」 と い う 数値を L C D ノ、。ネ ノレ 4 0 に表示す る (S67) , (S68)
(14)次に、 加算値 「 9 6 . 1 3 8 4 」 をキ ー入力す る 。 こ の場合 も 上記に お い て 「 5 7 1 4 . 9 2 」 を入力 し た と き と 同様 に処理 さ れて ア ド レ ス 「 0 0 0 X 」 に 「 9 6 . 1 3 8 4 」 の デ ー タ が格納 さ れ る 。 こ の 時の状態 は 図 1
6 E に示 さ れ る と お り であ る 。
(15)次 に 「 == 」 キ ー が入力 さ れ る と 、 そ の キ ー の 種類 が判断 さ れ 「 = 」 キ ーであ る と 判断 さ れる と (S 13) 、 有 効数値フ ラ グが 「 0 」 であ る か ど う かを判断す る (S14) こ こ では既に有効数値フ ラ グ は 「 1 」 にセ ッ ト さ れて い る ので、 次に演算ルー チ ン を呼び出 し てそ の処理に移 る (S15) o
(16)演算ル — チ ンで は上述の場合 と 同様に処理ざれ、 加算項の小数点位置が調整 さ れ(S50) 〜 (S56) 、 図 1 6
F の状態が得 ら れ る 。 そ し て、 加算項 と 被加算項と の加 算演算が行われ、 そ の演算結果は図 1 6 G の と お り 、 ァ ド レ ス 「 0 0 I X」 に格納 さ れ る (S57) 〜 (S64) 。 上述 の場合と 同様に 、 フ ラ グ U F 及び フ ラ グ D F に 「 0 」 を それぞれセ ッ ト し (S65) , (S66) 、 有効桁を判断 し て演 算結果 「 5 8 1 1 . 0 5 8 6 」 を L C Dノヽ。ネ ノレ 4 0 に表 示す る (S67) , (S68) o
と こ ろ で、 M ( I X ) に M ( I X ) + M ( I Y ) + C F の演算 し た結果を格納す る 処理は、 プ.ロ グラ ム上次の よ う に表現 さ れ る 。
4 6 L D A , [ I X ]
O F A D C A , [ I Y ]
6 0 L D [ I X ] , A
なお、 上記 4 6 , 6 0 はマ シ ン コ ー ドの例であ る 。 こ の実施例 に お い て は、 内部バ ス は 1 6 ビ ッ ト 構成で あ る 力く、 上記の命令に お いて は下位 8 ビ ッ ト ( I Β 0 7 〜 0 0 ) の みを使用 し 、 実行サイ ク ルを低減す る た め に C P u の 内部構造は複数のバ ス ラ イ ン ( 内部バ ス 及 び外 部バ ス ) で構成 さ れて い る 。 こ の 命令 の実行は 図 1 7 に 示 さ れ る タ イ ミ ン グ チ ヤ 一 卜 に 示 さ れ る タ イ ミ ン グで処 理 さ れ る 。
こ こ で 、 デ ー タ パ ス の た め の.マ イ ク ロ イ ン ス ト ラ ク シ ョ ン 群 の 各命令 の 内容 は次の と お り で あ る 。
U M V E B : メ モ リ か ら 外部バ ス へ の読み 出 し
U I L V E B : 内部バ ス 下位か ら外部バ ス への転送 U E B V I L : 外部バ ス か ら 内部バ ス 下位へ の転送 U A V I L : A レ ジ ス タ か ら 内部バ ス 下位への 読み 出 し
U J L V I L : テ ン ポ ァ ラ リ レ ジ ス タ X 下位力、 ら 内部 バ ス 下位への読み 出 し
U E B V E L : 外部バ ス 力、 ら テ ン ポ ラ リ レ ジ ス タ A下 位への 書 き 込み
U I L V G L : 内 部バ ス 下位力、 ら テ ン.ボ ラ リ ア レ ジ ス 夕 B 下位への書 き 込 み
U I L V A : 内部バ ス下位力、 ら A レ ジ ス タ へ の書込み U W I T H C : キ ャ リ ー フ ラ グ 力、 ら テ ン ポ ラ リ キ ヤ リ 一 フ ラ グ へ の 書込 み
ま た 、 ァ ド レ ス 制御 の た め の マ イ ク ロ イ ン ス ト ラ ク シ ョ ン 群 の 各命令 の 内容 は 次の と お り で あ る 。.
U A D P C : ア ド レ ス ノく ス に P C を 出力す る 。
U A D I X : ァ ド レ ス バ ス に I X を 出力す る 。
U A D I Y : Ύ ド レ ス バ ス に I Y を 出力す る 。 図 1 7 の タ イ ミ ン グチ ヤ 一 ト カ、 ら も 明 ら かな よ う に 、 デ ー タ の流れ は次の よ う に な る 。
(1) 4 6 →外部バ ス E B (命令フ ユ ツ チ )
(2) ( I X ) → E B →内部ノく ス下位 8 ビ ッ ト I L → A レ ジ ス タ A reg
(3) 0 F — E B (命令 フ ユ ツ チ )
(4) ( I Y ) → E B →テ ン ポ ラ リ レ ジ ス タ A C T A ) A reg → I L — テ ン ポ ラ リ レ ジ ス タ B ( T B ) 、 キ ヤ リ ー フ ラ グ C F →テ ン ポ ラ リ キ ヤ リ ー フ ラ グ T C
(5) テ ン ポ ラ リ レ ジ ス タ X ( T X ) → I L → A reg A L U キ ャ リ ー 出力— C F 、
6 0 → E B (命令 フ ェ ッ チ )
(6) A reg → I L → E B → ( I X )
次 に 、 図 1 7 の④、 ⑤のバ ス サ イ ク ルの 間 に行われて い る A D D 命令につ い て説明す る 。
フ ラ グ ϋ F , D F が共 に 「 1 」 に セ ッ ト さ れて い る と き の加算命令 ( A D D 命令) は図 1 8 に示すよ う に な る 。 例え ば 「 1 9 + 5 8 」 を求め る 際 に は テ ン ポ ラ リ レ ジ ス 夕 A ( T A ) に は下位 8 ビ ッ 卜 に 「 1 9 」 が格納 さ れ、 テ ン ポ ラ リ レ ジ ス タ B ( T B ) に は下位 8 ビ ッ ト に 「 5 8 」 が格納 さ れて い る 。 そ し て、 そ の両者 と テ ン ポ ラ リ フ ラ グ T C と を加算 し 、 1 6 ビ ッ 卜 の ア ツ ダー 出力 C A L は デ シ マ ノレ ア ジ ャ ス ト フ イ ノレ 夕 · ア ン ノ ッ ク ロ ジ ッ ク に入力をす る 。 デ シ マ ゾレア ジ ャ ス ト フ イ ノレ タ · ア ン パ ッ ク ロ ジ ッ ク で は B C D 補正、 ア ンパ ッ ク 補正が行な われ、 そ の 出力 D A F は図示の よ う に な り 、 演算出力 は 「 0 〇 0 0 1 0 0 0 」 と な り 、 キ ャ リ ー フ ラ グ C F に 「 1 」 が セ ッ 卜 さ れ る 。
以上の よ う に し てァ ンパ ッ ク 演算及びデ シ マ ノレア ジ ャ ス ト 演算に よ る 加算処理を行 っ た例を示 し たが、 こ れ ら の演算 に よ れば次に述べ る 利点があ る こ と が分か る 。
a ) 図 1 5 に示 し た R A M 3 6 の デー タ 構造 に示す と お り 、 入力 デー タ に対 し て各桁を 1 0 進数で 1 ア ド レ ス 単位 に格納 し て い る た め、 加算項 と 被加算項 と の 間での 小数点位置を合わせ る のが容易 に行え る 。
b ) ま た、 各桁の加算を 1 0 進法 1 桁 ( B C D · 4 ビ ッ ト ) で出力す る こ と がで き 、 かつ そ の 1 桁の加算のォ ー バ — フ ロ ー力 キ ャ リ ー フ ラ グ C F に反映で き る た め、 上位桁への桁上げ処理が容易 にで き る 。
c ) パ ッ ク 命令及びア ン パ ッ ク 命令 は.1 ア ド レ ス · 2 桁 に濃縮 さ れた デー タ と 1 ァ ド レ ス · 1 桁 に還元 さ れた デー タ と の交互変換 に効果的であ る 。
と こ ろ で、 上述の加算命令が終了 し て後 そ の デー タ を 格納す る 際 に は プ ロ グ ラ ム でパ ッ ク 命令 ( P A C K 命令) を実行 さ せ る こ と に よ り 記憶容量の節約を図 る こ と がで さ る 。
こ こ で は、 A : 3 7 , B : 9 5 の数値を例 に説明す る 。 テ ン ポ ラ リ レ ジ ス タ A ( T A ) に は B と A と 力 < 1 6 ビ ッ ト デー タ と し て格納 さ れてお り 、 テ ン ポ ラ リ レ ジ ス 夕 B ( T B ) に は 「 0 0 0 0 H」 が格納 さ れ る 。 そ し て、 そ の両者を加算す る と 1 6 ビ ッ ト の ア ツ ダー 出力 C A L が得 られ、 それはデ シマ ルア ジ ヤ ス ト フ ィ ノレ 夕 · ア ンノ ッ ク ロ ジ ッ ク 回路 5 2 に入力 さ れ る 。 そ の 出力 D A F は 図示の よ う に な り 下位 4 ビ ッ ト の デー タ と 、 ア ツ ダ一 出 力 C A L の 9 ビ ッ ト 目 力、 ら 1 2 ビ ッ ト 目 の デ一 夕 と がノ、。 ッ ク さ れて A L U 2 2 の 出力 と し て得 ら れる 。 従 っ て、 A L U 2 2 の 出力 の下位 8 ビ ッ ト は有効デー タ と し て扱 われて R A M 3 6 に格納 さ れ る が、 上位 8 ビ ッ ト は無効 デー タ と し て扱われ る 。
こ の よ う にパ ッ ク さ れた デー タ を再び R A M 3 6 力、 ら 読み 出す場合に はプ ロ グラ ムで逆に ア ンパ ッ ク 命令 ( U N P A C K命令) を実行す る 。
こ こ では、 A : 6 5 の数値を例 ίこ説明す る 。
テ ン ポ ラ リ レ ジ ス タ A ( T A ) に は上位に 「 ◦ 0 H」 が、 下位に は A レ ジス 夕 の値が格納 さ れ.てお り 、 テ ン ポ ラ リ レ ジ ス 夕 B ( T B ) に は 「 0 0 0 0 H」 力 格納 さ れ る 。 そ し て、 そ の両者を加算す る と 1 6 ビ ッ ト の ア ツ ダ 一出力 C A L が得 ら れ、 それはデ シ マ ノレア ジ ャ ス ト フ ィ ルタ · ア ンパ ッ ク ロ ジ ッ ク 回路に入力 さ れる 。 そ の 出力 D A F は図示の よ う に な り 、 下位 4 ビ ヅ 卜 の デー タ はそ の ま ま A L U の 出力 の最下位 4 ビ ッ ト の デー タ と な り 、 次の 4 ビ ッ ト に は Γ 0 H 」 が揷入 さ れる 。 ま た次の 4 ビ ッ 卜 に は D A F の 出力の上位 4 ビ ッ 卜 の デー タ が出力 さ れ、 更に次の最上位 4 ビ ッ ト に は、 「 0 H 」 が挿入さ れ る 。 こ の よ う に し て ア ンパ ッ ク 化デー タ 「 0 6 0 5 」 が 得 ら れ る 。
A L U 2 2 の具体的な 回路構成 は図 2 1 A 〜図 2 9 に 示す と お り の構成に な っ て い る 。 図 2 1 A及び図 2 1 B は A L U の結線図であ り 、 図 2 2 A及び図 2 2 B は 1 6 ビ ッ ト ア ツ ダ一 回路、 図 2 3 はデ シ マ ルア ジ ャ ス ト フ ィ ル 夕 ♦ ア ンノ、。 ッ ク ロ ジ ッ ク 回路、 図 2 4 は A L U シ フ タ 、 図 2 5 は制御 フ ラ グの 各構成を示す回路図あ る 。 図 2 6 〜図 2 9 は図 2 5 に示 さ れ る 制御 フ ラ グを構成す る ラ ッ チ群の具体的 な 回路図であ る 。 図 2 5 は図 2 1 B の F L A G プ ロ ッ ク に対応 し 、 図 2 1 B は図 1 の コ ン デ ィ シ ョ ン フ ラ グ 2 6 に対応す る 。 図 2 6 は ゼ ロ フ ラ グ、 オ ー バ — フ ラ グ、 ネ ガテ ィ ブフ ラ グラ ッ チ部の 回路図であ る 。 図 2 7 は 2 ビ ッ 卜 割 り 込み フ ラ グラ ッ チ部回路図、 図 2 8 はキ ャ リ ー フ ラ グ ラ ッ チ部回路図、 図 2 9 は デ シ マ ル フ ラ グ、 ア ンパ ッ ク フ ラ グラ ッ チ部回路.図で あ る 。

Claims

請 求 の 範 囲
1 . 入力 デー タ をア ンパ ッ ク し た状態で取 り 込む入力手 段 と 、 .
ア ンパ ッ ク演算処理をす る 際に ア ンパ ッ ク フ ラ グがセ ッ ト さ れ る レ ジ ス タ と 、
複数の ビ ッ ト 幅の デー タ を演算処理す る こ と がで き 、 前記 レ ジ ス 夕 に ア ンパ ッ ク フ ラ グがセ ッ 卜 さ れ、 かつ短 ぃ ビ ッ ト 幅の デー タ 処理が命令 さ れて い る状態では、 ァ ン ノ、 ' ッ ク さ れた入力デー タ の 1 / 2 の ビ ッ ト 幅の デー タ につ い て演算 し 、 そ の上位 ビ ッ ト への キ ャ リ ー又はボ ロ 一をキ ャ リ ー フ ラ グに セ ッ 卜 す る A L U と
を有す る 半導体装置。
2 , A L U は、 1 6 ビ ッ ト 及び 8 ビ ッ ト の ビ ッ ト 幅の演 算処理機能を有 し 、 8 ビ ッ ト の ビ ッ ト 幅の デー タ の演算 処理が選択さ れ、 かつ ア ンパ ッ ク フ ラ グがセ ッ ト さ れて い る と き 、 下位 4 ビ ッ ト に つ い ての演算処理を行い、 こ の 4 ビ ッ 卜 目 の キ ヤ リ ー又 はボ ロ ーをキ ヤ リ 一 フ ラ グに セ ッ 卜 す る 請求項 1 記載の半導体装置。
3 . デ シマ ノレ フ ラ グ力 セ ッ 卜 さ れ る レ ジ ス タ を有 し 、 A L U は、 こ の デ シマ ルフ ラ グ力 セ ッ ト さ れてい る と き に は、 1 6 進の演算結果を 1 0 進デー タ に変換 し て出力す る 請求項 1 記載の半導体装置。
4 . A L U は、 演算結果を記憶装置 に格納す る 際に はァ ン ノ、。 ッ ク さ れた デー タ をパ ッ ク し て格納 し 、 記憶装置か ら デー タ を読み 出す際に は逆に ア ンパ ッ ク し て読み 出す 請求項 1 記載の半導体装置。
5 . 入力 デー タ を ア ン パ ッ ク し た状態で取 り 込む入力手 段 と 、 ア ンパ ッ ク 演算処理をす る 際に ア ンパ ッ ク フ ラ グ がセ ッ 卜 さ れ る レ ジ ス タ と 、 複数の ビ ッ ト 幅の デー タ を 演算処理す る こ と がで き 、 前記 レ ジ ス タ に ア ンパ ッ ク フ ラ グがセ ッ 卜 さ れ、 かつ短い ビ ッ ト 幅の デー タ 処理が命 令 さ れて い る 状態で は、 ァ ンパ ッ ク さ れた入力 デー タ の 1 / 2 の ビ ッ ト 輻の デー タ に つ い て演算 し 、 そ の上位 ビ ッ 卜 の キ ャ リ ー又は ボ ロ ー をキ ャ リ ー フ ラ グに セ ッ ト す る A L U と を有す る 半導体装置を、 内蔵 し た電子機器。
PCT/JP1991/001496 1990-11-02 1991-11-01 Semiconductor device WO1992008188A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2/297677 1990-11-02
JP29767790 1990-11-02

Publications (1)

Publication Number Publication Date
WO1992008188A1 true WO1992008188A1 (en) 1992-05-14

Family

ID=17849714

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP1991/001496 WO1992008188A1 (en) 1990-11-02 1991-11-01 Semiconductor device

Country Status (1)

Country Link
WO (1) WO1992008188A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7966482B2 (en) 1994-12-02 2011-06-21 Intel Corporation Interleaving saturated lower half of data elements from two source registers of packed data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6222144A (ja) * 1985-07-23 1987-01-30 Nec Corp 10進演算回路
JPS63175927A (ja) * 1987-01-12 1988-07-20 アメリカン テレフオン アンド テレグラフ カムパニ− 二進化十進/パックドデ−タの処理方法および処理装置
JPS6462726A (en) * 1987-09-03 1989-03-09 Fujitsu Ltd Adder-subtracter
JPS6462727A (en) * 1987-09-03 1989-03-09 Fujitsu Ltd Adder-subtracter

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6222144A (ja) * 1985-07-23 1987-01-30 Nec Corp 10進演算回路
JPS63175927A (ja) * 1987-01-12 1988-07-20 アメリカン テレフオン アンド テレグラフ カムパニ− 二進化十進/パックドデ−タの処理方法および処理装置
JPS6462726A (en) * 1987-09-03 1989-03-09 Fujitsu Ltd Adder-subtracter
JPS6462727A (en) * 1987-09-03 1989-03-09 Fujitsu Ltd Adder-subtracter

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7966482B2 (en) 1994-12-02 2011-06-21 Intel Corporation Interleaving saturated lower half of data elements from two source registers of packed data
US8190867B2 (en) 1994-12-02 2012-05-29 Intel Corporation Packing two packed signed data in registers with saturation
US8495346B2 (en) 1994-12-02 2013-07-23 Intel Corporation Processor executing pack and unpack instructions
US8521994B2 (en) 1994-12-02 2013-08-27 Intel Corporation Interleaving corresponding data elements from part of two source registers to destination register in processor operable to perform saturation
US8601246B2 (en) 1994-12-02 2013-12-03 Intel Corporation Execution of instruction with element size control bit to interleavingly store half packed data elements of source registers in same size destination register
US8639914B2 (en) 1994-12-02 2014-01-28 Intel Corporation Packing signed word elements from two source registers to saturated signed byte elements in destination register
US8793475B2 (en) 1994-12-02 2014-07-29 Intel Corporation Method and apparatus for unpacking and moving packed data
US8838946B2 (en) 1994-12-02 2014-09-16 Intel Corporation Packing lower half bits of signed data elements in two source registers in a destination register with saturation
US9015453B2 (en) 1994-12-02 2015-04-21 Intel Corporation Packing odd bytes from two source registers of packed data
US9116687B2 (en) 1994-12-02 2015-08-25 Intel Corporation Packing in destination register half of each element with saturation from two source packed data registers
US9141387B2 (en) 1994-12-02 2015-09-22 Intel Corporation Processor executing unpack and pack instructions specifying two source packed data operands and saturation
US9182983B2 (en) 1994-12-02 2015-11-10 Intel Corporation Executing unpack instruction and pack instruction with saturation on packed data elements from two source operand registers
US9223572B2 (en) 1994-12-02 2015-12-29 Intel Corporation Interleaving half of packed data elements of size specified in instruction and stored in two source registers
US9361100B2 (en) 1994-12-02 2016-06-07 Intel Corporation Packing saturated lower 8-bit elements from two source registers of packed 16-bit elements
US9389858B2 (en) 1994-12-02 2016-07-12 Intel Corporation Orderly storing of corresponding packed bytes from first and second source registers in result register

Similar Documents

Publication Publication Date Title
US3646522A (en) General purpose optimized microprogrammed miniprocessor
US5440702A (en) Data processing system with condition code architecture for executing single instruction range checking and limiting operations
JPS5811652B2 (ja) 演算ユニツト
US4893267A (en) Method and apparatus for a data processor to support multi-mode, multi-precision integer arithmetic
US6078940A (en) Microprocessor with an instruction for multiply and left shift with saturate
US5920497A (en) Method and apparatus for performing a double precision operation using a single instruction type
JP3479385B2 (ja) 情報処理装置
JPS6027030A (ja) マイクロプロセツサ
WO1992008188A1 (en) Semiconductor device
EP0594969B1 (en) Data processing system and method for calculating the sum of a base plus offset
US4352161A (en) Electronic calculator capable of dealing with variables
KR100328141B1 (ko) 적게변경된현존하는하드웨어에의해구현되는2진승산
JPH10187416A (ja) 浮動小数点演算装置
US20080256335A1 (en) Microprocessor, microcomputer, and electronic instrument
JPH0560629B2 (ja)
JP2000039995A (ja) 高性能マイクロプロセッサで使用するためのフレキシブル累算レジスタファイル
EP0547230B1 (en) Apparatus for sum-of-product operation
US5708800A (en) High speed microprocessor for processing and transferring N-bits of M-bit data
CA1173164A (en) Fraction calculator
US7237000B2 (en) Speed of execution of a conditional subtract instruction and increasing the range of operands over which the instruction would be performed correctly
US5142636A (en) Memory bank address calculation with reduced instruction execution cycles
US5086406A (en) Circuit arrangement for decimal arithmetic
KR100385233B1 (ko) 데이터 프로세싱 시스템의 익스포넌트 유닛
JP3551291B2 (ja) シリアル数値演算装置
JPS6019030B2 (ja) 教育用電子機器

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): JP KR US

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载