JPS63197220A - Normalizing circuit - Google Patents

Normalizing circuit

Info

Publication number
JPS63197220A
JPS63197220A JP62030317A JP3031787A JPS63197220A JP S63197220 A JPS63197220 A JP S63197220A JP 62030317 A JP62030317 A JP 62030317A JP 3031787 A JP3031787 A JP 3031787A JP S63197220 A JPS63197220 A JP S63197220A
Authority
JP
Japan
Prior art keywords
output
bit
shifter
register
outputs
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.)
Pending
Application number
JP62030317A
Other languages
Japanese (ja)
Inventor
Katsuhiko Ueda
勝彦 上田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP62030317A priority Critical patent/JPS63197220A/en
Publication of JPS63197220A publication Critical patent/JPS63197220A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To avoid such a case where the normalizing result is equal to -2<n> by performing the left shift by an extent equal to the value obtained by subtracting '1' from the output of a 1st means when the output of a 2nd means is equal to '1'. CONSTITUTION:A shifter control circuit A11 outputs the control outputs L0, L1 and L2 to a table 1 (not shown here) with the output of a register 10 defined as an input based on the input/output relation. A shifter control circuit B12 outputs the control output R based on the input/output relation shown in a table 2 (not shown here). Then a left 1-bit shifter 14 controlled by the output L0 is added together with a left 2-bit shifter 15 controlled by the output L1, a left 4-bit shifter 16 controlled by the output L2, and a right 1-bit shifter 13 controlled by the output R. The data shown in a table 2 is shifted left by an extent equal to the value subtracting a single bit and therefore can be normalized in an equivalent way as the shift mode of a conventional normalizing circuit in a state where a negative number is expressed in a compliment of '2'. It is not needed to use a subtractor that calculates a left shift number reduced by a single bit. Thus, a normalizing action is performed at a high speed.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、負数は2の補数で表現する数体系において、
補数の状態で正規化処理を行なう正規化回路に関するも
のである。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to a number system in which negative numbers are expressed as two's complement.
The present invention relates to a normalization circuit that performs normalization processing in a complement state.

従来の技術 従来の正規化回路としては、例えば特開昭59−188
740号公報「フローティング加算器」に、発明構成要
素の一つとして示されている。第3図はこの発明の実施
例の中から、浮動小数点データ仮数部正規化回路の部分
のみを抜きだしたものである。
2. Prior Art As a conventional normalization circuit, for example, Japanese Patent Laid-Open No. 59-188
It is disclosed in Japanese Patent No. 740 "Floating Adder" as one of the constituent elements of the invention. FIG. 3 shows only the floating point data mantissa normalization circuit extracted from the embodiment of the present invention.

1は浮動小数点の仮数部の演算を行なう演算ユニット、
2は演算結果を保持するレジスタ、3は演算ユニット1
の出力で最上位ビットからの連続する0”の数を数える
正規化シフト検出回路、4は正規化シフト検出回路3で
の検出結果を保持するレジスタ、5はレジスタ2の内容
をレジスタ4が示すビットだけ左シフトするシックであ
る。
1 is an arithmetic unit that performs floating-point mantissa operations;
2 is a register that holds the calculation results, 3 is calculation unit 1
A normalization shift detection circuit that counts the number of consecutive 0's from the most significant bit at the output of , 4 is a register that holds the detection result of normalization shift detection circuit 3, and 5 is a register 4 that indicates the contents of register 2. This is a chic that shifts left by a bit.

以上のように構成された、従来の回路においては、演算
ユニット】、の出力(これは本引用例においては常に正
になるように演算ユニット1の入力及び演算モードが制
御されている)の最上位ビットからの連続する”0″の
数が、正規化シフト検出回路3で検出され、その個数分
だけ、演算ユニット1の出力がシフタ5で左シフトされ
る。
In the conventional circuit configured as described above, the maximum output of the arithmetic unit 1 (in this cited example, the input and arithmetic mode of the arithmetic unit 1 are controlled so that it is always positive) is The number of consecutive "0"s starting from the upper bits is detected by the normalization shift detection circuit 3, and the output of the arithmetic unit 1 is shifted to the left by the shifter 5 by the detected number.

発明が解決しようとする問題点 しかしながら上記のような構成は、正規化対象のデータ
が正であることを条件にしており、2の補数表現された
負数を、予め絶対値化することなく、そのままの表現形
式で正規化することは出来ないという問題点を有してい
た。
Problems to be Solved by the Invention However, the above configuration requires that the data to be normalized be positive, and a negative number expressed as a two's complement is directly converted into an absolute value without being converted to an absolute value in advance. The problem was that it was not possible to normalize the expression format.

本発明はかかる点に鑑み、2の補数表現された負数も絶
対値化せずに2の補数表現で正規化し、かつ正規化結果
が −(2−2)〜+(2−2”) e ・ ・(1) 七なる(ここでmはデータビット長、21は符号n−m
+1 ビットの重み、2   は最下位ビットの重み)、すな
わち正規化結果が−2”とならないように正規化する正
規化回路を提供することを目的とする。
In view of this point, the present invention normalizes negative numbers expressed in two's complement representation without converting them to absolute values, and the normalization result is -(2-2) to +(2-2'') e・ ・(1) Seven (here m is the data bit length, 21 is the code nm
+1 is the weight of the bit, 2 is the weight of the least significant bit), that is, the normalization result is not -2''.

問題点を解決するための手段 本発明は、負数は2の補数で示されるデータを保持する
レジスタと、前記レジスタ出力の符号ビットが”0”の
時は、符号ピッ)・を除く最上位ビットからの連続する
”0”の個数を、符号ビットが”1”の詩は、符号ビッ
トを除く最上位ビットからの連続する”1”の個数を出
力する第1の手段と、前記レジスタ出力のデータが最下
位ビットから連続する”0”を持つか否かを検査し、持
つ場合は”1”を、持たない場合は”0′を出力する第
2の手段と、前記第2の手段の出力が”0”の時には前
記第1の手段の出力で前記レジスタの出力を左シフトし
、前記第2の手段の出力が”1”の時には前記第1の手
段の出力から1だけ減じた数だけ左シフトするシフト手
段とをもつ正規化回路である。
Means for Solving the Problems The present invention provides a register that holds data in which negative numbers are expressed as two's complement numbers, and when the sign bit of the register output is "0", the most significant bit excluding the sign pip). The first means outputs the number of consecutive 0's from the most significant bit excluding the sign bit, and the first means outputs the number of consecutive 1's from the most significant bit excluding the sign bit. a second means for inspecting whether or not the data has consecutive "0"s starting from the least significant bit, and outputs "1" if the data does, and outputs "0" if it does not; When the output is "0", the output of the register is shifted to the left by the output of the first means, and when the output of the second means is "1", the number is subtracted by 1 from the output of the first means. This is a normalization circuit having a shift means for shifting to the left by .

作用 本発明は前記した構成により、 ・符号ビットが”0”の時 符号ビットを除(最上位ビットからの連続する”0”の
個数 ・符号ビットが”じの時 ) 符号ビットを除く最上位ビットからの連続する”l
”の個数1−に ここで に=1=前記レジスタ出力のデータが最下位ビットから
連続する0”を持つ 場合 に=0:前記レジスタ出力のデータが最下位ビットから
連続する”0”を持た ない場合 で示される個数分だけ、前記シフト手段で左シフトする
ものである。
Effects The present invention has the above-described configuration, - When the sign bit is "0", remove the sign bit (number of consecutive "0"s from the most significant bit - when the sign bit is "same"). Consecutive "l" from bit
``Number 1 - where = 1 = If the data of the register output has consecutive 0's from the least significant bit = 0: The data of the register output has consecutive 0's from the least significant bit. The shift means shifts to the left by the number indicated in the case where there is no.

実施例 第1図は本発明の一実施例における正規化回路の構成図
を示すものである。説明の簡単化のため、データフォー
マットは第2図に示すような、符号ビットSを最上位ビ
ットとし N=(−1)−3−2°+zn−、$ 2−’ ・・・
(2)国 1 を、表現する8ビツトデータを考える。第1図において
10は、負数は2の補数で示されるデータを保持するレ
ジスタ、11は、レジスタ10の出力を入力とし表1に
示す入出力関係に従って制御出力し01LL、、L2を
出力する、組み合わせ論理回路で構成されたシフタ制御
回路A112は、レジスタ10の出力を入力とし表2に
示す入出力関係に従って制御出力Rを出力する、組み合
わせ論理回路で構成されたシフタ制御回路Bである。1
3はシフタili制御回路B12の出力Rが”1”の時
、レジスタ10の出力を右に1ビットシフトする右1ビ
ツトシフタである。14は右1ビツトシフタ13の出力
を左に1ビットシフトする左1ビツトシツク、15は左
1ビツトシフタ14の出力を左に2ビットシフトする左
2ビツトシフタ、16は左2ビツトシフタ15の出力を
左に4ビットシフトする左4ビツトシフタであり、それ
ぞれシフタ制御回路Allの出力Lo1L+s L2が
”1”の時動作する。
Embodiment FIG. 1 shows a configuration diagram of a normalization circuit in an embodiment of the present invention. To simplify the explanation, the data format is as shown in FIG. 2, with the sign bit S as the most significant bit, N=(-1)-3-2°+zn-, $2-'...
(2) Consider 8-bit data representing country 1. In FIG. 1, 10 is a register that holds data in which negative numbers are represented by two's complement; 11 is a register that receives the output of register 10, controls output according to the input/output relationship shown in Table 1, and outputs 01LL, L2; The shifter control circuit A112 made up of a combinational logic circuit is a shifter control circuit B made up of a combinational logic circuit which receives the output of the register 10 as an input and outputs a control output R according to the input/output relationship shown in Table 2. 1
3 is a right 1-bit shifter that shifts the output of the register 10 by 1 bit to the right when the output R of the shifter ili control circuit B12 is "1". 14 is a left 1-bit shifter that shifts the output of the right 1-bit shifter 13 to the left by 1 bit, 15 is a left 2-bit shifter that shifts the output of the left 1-bit shifter 14 by 2 bits to the left, and 16 is a left 2-bit shifter that shifts the output of the left 2-bit shifter 15 by 4 bits to the left. This is a left 4-bit shifter that performs bit shifting, and each operates when the output Lo1L+sL2 of the shifter control circuit All is "1".

以上のように構成された本実施例の正規化回路について
、以下その動作を説明する。
The operation of the normalization circuit of this embodiment configured as described above will be described below.

先ず、データNをレジスタ10に格納する。シフタ81
11回路Allは表1に従い、符号ビットSが”0”の
時は、符号ビットを除(最上位ビットからの連続する”
0”の個数を、符号ビットか”l”の時は、符号ビット
を除(最上位ビットからの連続する”1”の個数を数え
、結果を2進数L2、Ll。
First, data N is stored in the register 10. shifter 81
All 11 circuits follow Table 1, and when the sign bit S is "0", the sign bit is removed (consecutive from the most significant bit).
If it is the sign bit or “l”, divide the sign bit (count the number of consecutive “1”s starting from the most significant bit, and convert the result to binary numbers L2 and Ll).

LOで出力する。Output in LO.

符号ビットSが”0”の時は、左4ビツトシフタ16、
左2ビツトシフタ15、左1ビツトシフタ14がそれぞ
れ、制御信号L!、L1%[、oに従ってシフト動作を
行ない、2 の重みをもつビットが“1”となる結果が
、左4ビツトシフタ16から出力される。
When the sign bit S is “0”, the left 4-bit shifter 16,
The left 2-bit shifter 15 and the left 1-bit shifter 14 each receive the control signal L! , L1%[, o, and the left 4-bit shifter 16 outputs a result in which the bit with a weight of 2 becomes "1".

符号ビットSが”1”の時も、左4ビツトシフタ16、
左2ビツトシツク15、左1ビツトシフタ14は、制御
信号L2、L1%LOに従ってシフト動作を行なう。し
かしレジスタ10のデータが浮動小数点データの仮数部
である場合には、データが表2の入力欄に示したような
場合、次の理由によりシフトの補正を行なう必要がある
Even when the sign bit S is “1”, the left 4-bit shifter 16,
The left 2-bit shifter 15 and the left 1-bit shifter 14 perform shift operations in accordance with control signals L2 and L1%LO. However, when the data in register 10 is the mantissa part of floating point data, and the data is as shown in the input column of Table 2, it is necessary to perform shift correction for the following reason.

従来の技術で述べたように、本発明の正規化回路は正規
化結果が(1)式で示したものになるよう正規化処理を
行なう。これは、本発明の正規化回路で正規化した結果
が、従来例に示したような従来からの正規化回路で正規
化した結果と、全ての場合で等しくさせるためである。
As described in the related art section, the normalization circuit of the present invention performs normalization processing so that the normalization result becomes as shown in equation (1). This is to make the result of normalization by the normalization circuit of the present invention equal to the result of normalization by the conventional normalization circuit as shown in the conventional example in all cases.

本実施例では、(1)式でのn、mは、それぞれ0.8
であるので、正規化結果は −<2−2)〜+(2−2)・・・(3)となるように
正規化する必要がある。すなわち正規化結果が−2とな
らないように正規化する。
In this example, n and m in equation (1) are each 0.8
Therefore, it is necessary to normalize the normalization result so that it becomes -<2-2) to +(2-2)...(3). That is, normalization is performed so that the normalization result does not become -2.

ここで、表1に従ってシフトを行なうと、表2の入力欄
に示したビットパターンの場合1ビット余分にシフトさ
れ、左4ビツトシフタ16の出力は1ooooooo、
すなわち、−2が出力されてしまう。
Here, if the shift is performed according to Table 1, the bit pattern shown in the input column of Table 2 will be shifted by one extra bit, and the output of the left 4-bit shifter 16 will be 1oooooooo,
In other words, -2 is output.

そこでこれらの場合、表1に従うシフタ制御回路Bll
の出力し!、Ll、LOから1だけ減じた結果で左シフ
トを行なうことが必要になる。このため、シック制御回
路B12を設けている。レジスタ10に表2の入力欄に
示したビットパターンが入力された時、シック制御回路
B12の出力Rは”1′″となり、右1ビツトシフタ1
3を動作させる。すなわち、左1ビツトシフタ14への
入力を予め右に1ビットシフトしてお(ことにより、1
ビット余分に左シフトが行なわれることを防ぐ。
Therefore, in these cases, the shifter control circuit Bll according to Table 1
Output! , Ll, it becomes necessary to perform a left shift with the result of subtracting 1 from LO. For this reason, a sick control circuit B12 is provided. When the bit pattern shown in the input column of Table 2 is input to the register 10, the output R of the thick control circuit B12 becomes "1'", and the right 1 bit shifter 1
Operate 3. In other words, the input to the left 1-bit shifter 14 is shifted 1 bit to the right in advance (by doing so, the input to the left 1-bit shifter 14 is
Prevents left shifting by extra bits.

以上のように、本実施例によれば、レジスタlOの出力
を入力とし表1に示す入出力関係に従って制御出力lo
、L’1L2を出力するシフタ制御回路A11、表2に
示す入出力関係に従って制御出力Rを出力するシフタ制
御回路B12、制御出力しoで制御される左1ビツトシ
フタ14、制御出力1. tで制御される左2ビツトシ
フタ15、制御出力し2で制御される左4ビツトシフタ
16、制御出力Rで制御される右1ビツトシフタ13と
を設け、表2に示したデータは1ビツト少なく左シフト
を行なうことにより、負数を2の補数で表現した状態で
、従来の正規化回路でシフトしたものと等価の正規化を
行なうことができる。また、1ビツト少ない左シフト数
を算出するための減算器は必要とせず、高速の正規化が
可能となる。
As described above, according to this embodiment, the output of the register LO is input, and the control output LO is set according to the input/output relationship shown in Table 1.
, L'1L2, a shifter control circuit B12 that outputs a control output R according to the input/output relationship shown in Table 2, a left 1-bit shifter 14 controlled by the control output o, a control output 1. A left 2-bit shifter 15 controlled by t, a left 4-bit shifter 16 controlled by control output 2, and a right 1-bit shifter 13 controlled by control output R are provided, and the data shown in Table 2 is shifted left by 1 bit less. By doing this, it is possible to perform normalization equivalent to that shifted by a conventional normalization circuit while representing a negative number as a two's complement number. Further, a subtracter for calculating the number of left shifts that is one bit smaller is not required, and high-speed normalization is possible.

表  1 表  2 発明の詳細 な説明したように、本発明によれば、負数を2の補数で
表現した状態で、従来の正規化回路でシフトしたものと
等価の正規化を行なうことができ、その実用的効果は大
きい。
Table 1 Table 2 As described in detail, according to the present invention, it is possible to perform normalization equivalent to that shifted by a conventional normalization circuit when a negative number is expressed in two's complement. Its practical effects are great.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明における一実施例の正規化回路の構成図
、第2図はデータフォーマットの一例の説明図、第3図
は従来の正規化回路の構成図である。 11・・・シフタ制御回路A112・・・シフタ制御回
路B113・・・右1ビツトシツク、14・・・左1ビ
ツトシフタ、15・・・左2ビツトシフタ、16・・・
左4ビツトシフタ。 代理人の氏名 弁理士 中尾敏男ほか1老込     
      N− 第2図 第3図
FIG. 1 is a block diagram of a normalization circuit according to an embodiment of the present invention, FIG. 2 is an explanatory diagram of an example of a data format, and FIG. 3 is a block diagram of a conventional normalization circuit. 11...Shifter control circuit A112...Shifter control circuit B113...Right 1-bit shifter, 14...Left 1-bit shifter, 15...Left 2-bit shifter, 16...
Left 4-bit shifter. Name of agent: Patent attorney Toshio Nakao and 1 senior citizen
N- Figure 2 Figure 3

Claims (2)

【特許請求の範囲】[Claims] (1)負数は2の補数で示されるデータを保持するレジ
スタと、前記レジスタ出力の符号ビットが”0”の時は
、符号ビットを除く最上位ビットからの連続する”0”
の個数を、符号ビットが”1”の時は、符号ビットを除
く最上位ビットからの連続する”1”の個数を出力する
第1の手段と、前記レジスタ出力のデータが最下位ビッ
トから連続する”0”を持つか否かを検査し、持つ場合
は”1”を、持たない場合は”0”を出力する第2の手
段と、前記第2の手段の出力が”0”の時には前記第1
の手段の出力で前記レジスタの出力を左シフトし、前記
第2の手段の出力が”1”の時には前記第1の手段の出
力から1だけ減じた数だけ左シフトするシフト手段とを
備えたことを特徴とする正規化回路。
(1) Negative numbers are stored in a register that holds data expressed in two's complement, and when the sign bit of the register output is “0”, consecutive “0” from the most significant bit excluding the sign bit
When the sign bit is "1", the first means outputs the number of consecutive "1"s from the most significant bit excluding the sign bit, and the data of the register output is consecutive from the least significant bit. a second means for checking whether or not the second means has "0", and outputs "1" if it has, and outputs "0" if not; and when the output of the second means is "0". Said first
Shifting means for shifting the output of the register to the left using the output of the means, and shifting the output of the register to the left by a number subtracted by 1 from the output of the first means when the output of the second means is "1". A normalization circuit characterized by:
(2)シフト手段が、第1の手段の出力に応じて左シフ
トを行なう左方向シフタ及び、前記左方向シフタに直列
に接続され、第2の手段の出力が”1”の時に右1ビッ
トシフトを行なう右方向シフタとから構成された特許請
求の範囲第1項記載の正規化回路。
(2) The shift means is connected in series to a left shifter that performs a left shift according to the output of the first means, and the left shifter, and when the output of the second means is "1", the right 1 bit is set. 2. The normalization circuit according to claim 1, comprising a rightward shifter for performing a shift.
JP62030317A 1987-02-12 1987-02-12 Normalizing circuit Pending JPS63197220A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62030317A JPS63197220A (en) 1987-02-12 1987-02-12 Normalizing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62030317A JPS63197220A (en) 1987-02-12 1987-02-12 Normalizing circuit

Publications (1)

Publication Number Publication Date
JPS63197220A true JPS63197220A (en) 1988-08-16

Family

ID=12300415

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62030317A Pending JPS63197220A (en) 1987-02-12 1987-02-12 Normalizing circuit

Country Status (1)

Country Link
JP (1) JPS63197220A (en)

Similar Documents

Publication Publication Date Title
JPS6382513A (en) Barrel shifter
US4617641A (en) Operation unit for floating point data having a variable length exponent part
JPH04290122A (en) Numerical expression conversion device
JPS5829539B2 (en) arithmetic unit
US4924421A (en) Priority encoding system
EP0044450B1 (en) Digital adder circuit
JPS63197220A (en) Normalizing circuit
JPS63167930A (en) Floating point arithmetic unit
JPH0511980A (en) Overflow detecting method and circuit
JP2605848B2 (en) Non-restoring divider
JPH11126157A (en) Method and circuit for multiplication
JP3187402B2 (en) Floating point data addition / subtraction circuit
JP3109080B2 (en) Word length limiting circuit
JP2996024B2 (en) Multiplication circuit
JPH0435777B2 (en)
JPH0426495B2 (en)
JPS63115229A (en) Element shift system
JPH051498B2 (en)
JPH02267625A (en) Integer part take-out system using floating point arithmetic
JPS63278141A (en) Division circuit
JPS61177542A (en) Adding and subtracting device using both sign complementary number and sign absolute value
JPH0253819B2 (en)
JPH05233218A (en) Arithmetic circuit for three fundamental rules
JPH01111229A (en) Floating point adder/subtractor
JPH04312120A (en) Floating point adder/subtractor