KR200156144Y1 - A circuit of absolute value - Google Patents
A circuit of absolute value Download PDFInfo
- Publication number
- KR200156144Y1 KR200156144Y1 KR2019960035186U KR19960035186U KR200156144Y1 KR 200156144 Y1 KR200156144 Y1 KR 200156144Y1 KR 2019960035186 U KR2019960035186 U KR 2019960035186U KR 19960035186 U KR19960035186 U KR 19960035186U KR 200156144 Y1 KR200156144 Y1 KR 200156144Y1
- Authority
- KR
- South Korea
- Prior art keywords
- register
- arithmetic operator
- absolute value
- overflow
- output
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods 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/544—Methods 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 for evaluating functions by calculation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods 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/57—Arithmetic 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
- G06F7/575—Basic arithmetic logic units, i.e. devices selectable to perform either addition, subtraction or one of several logical operations, using, at least partially, the same circuitry
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Complex Calculations (AREA)
Abstract
본 고안은 절대값 계산 회로에 관한 것으로 특히, 절대값 계산시 오버플로어가 발생하면 최대 양수를 출력시키는 회로를 부가함으로써 프로그램을 간단히 함은 물론 처리 시간을 줄일 수 있도록 안출한 것이다. 이러한 본 고안은 입력 데이타를 각기 저장하는 레지스터(210)(220)와, 상기 레지스터(210 또는 220)의 출력 데이타를 입력으로 절대값을 계산하고 오버플로어 여부를 판단하는 산술 연산기(230)와, 이 산술 연산기(230)의 오버플로어 신호에 따라 레지스터(250)의 출력값 '7FFFh'과 상기 산술 연산기(230)의 출력값중 하나를 선택하는 멀티플렉서(260)와, 이 멀티플렉서(260)의 출력값을 저장하여 출력하는 레지스터(24)로 구성한다.The present invention relates to an absolute value calculation circuit, and in particular, to simplify the program and reduce the processing time by adding a circuit that outputs the maximum positive number when an overflow occurs during the absolute value calculation. The present invention is a register (210) (220) for storing the input data, respectively, the arithmetic operator (230) for calculating the absolute value and determining whether or not to overflow the output data of the register (210 or 220), A multiplexer 260 for selecting one of the output value '7FFFh' of the register 250 and the output value of the arithmetic operator 230 according to the overflow signal of the arithmetic operator 230, and the output value of the multiplexer 260 And a register 24 for output.
Description
본 고안은 최대 음수 처리 기술에 관한 것으로 특히, 최대 음수 처리를 위한 절대값 계산을 하드웨어적으로 수행하도록 한 절대값 계산 회로에 관한 것이다.The present invention relates to a maximum negative number processing technique, and more particularly, to an absolute value calculating circuit that allows hardware to perform absolute value calculation for maximum negative number processing.
일반적으로 프로세서는 입력 데이타의 연산 처리시 음의 정수는 양의 정수로 만들게 된다.In general, a processor makes a negative integer a positive integer when processing input data.
예를 들어, 16비트 프로세서의 경우 음의 정수에 절대값을 취하여 양의 정수를 만들 때 '8000H(=-32768)'에 해당하는 절대값(=32768)은 16비트에서는 표시 불가능하여 '-32768'로 표시한다.For example, for a 16-bit processor, the absolute value (= 32768) corresponding to '8000H (= -32768)' cannot be displayed in 16-bit when the absolute value is taken from a negative integer to produce a positive integer. '
그런데, 보통 절대값 계산시 음수를 그대로 유지하면 에러가 발생하므로 프로그램에서 '-32768'을 '+32767'로 교체하여 계산한다.However, if you keep the negative number in the absolute value calculation, an error occurs. Therefore, the program calculates by replacing '-32768' with '+32767'.
여기서, 16비트가 나타낼 수 있는 정수의 범위는 '8000H~7FFFH(-32768~+32767)'이다.Here, the range of integers that can be represented by 16 bits is '8000H to 7FFFH (-32768 to +32767)'.
종래 기술은 도1의 블럭도에 도시된 바와 같이, 2개의 입력 데이타를 각기 저장하는 레지스터(110)(120)와, 상기 레지스터(110)(120)의 저장 데이타를 감산하여 절대값을 계산하는 산술 연산기(130)와, 이 산술 연산기(130)의 출력값을 저장하는 레지스터(140)으로 구성된다.As shown in the block diagram of FIG. 1, the prior art calculates an absolute value by subtracting registers 110 and 120 for storing two input data, respectively, and storing data of the registers 110 and 120, respectively. The arithmetic operator 130 and the register 140 which stores the output value of this arithmetic operator 130 are comprised.
이와 같은 종래 기술의 동작 과정을 도2의 신호 흐름도를 참조하여 설명하면 다음과 같다.The operation of the prior art will be described with reference to the signal flowchart of FIG. 2.
먼저, 레지스터(110)(120)에는 16비트의 데이타가 교대로 저장되어 진다.First, 16 bits of data are alternately stored in the registers 110 and 120.
이때, 산술 연산기(130)는 레지스터(110 또는 120)의 저장 데이타를 입력받아 최상위 비트가 1인지 판단하게 된다.In this case, the arithmetic operator 130 receives the stored data of the register 110 or 120 and determines whether the most significant bit is one.
이에 따라, 최상위 비트가 0이면 입력 데이타를 그대로 레지스터(140)에 저장하여 출력시키게 된다.Accordingly, when the most significant bit is 0, the input data is stored in the register 140 as it is and output.
만일, 입력 데이타의 최상위 비트가 1인 경우 산술 연산기(130)는 입력 데이타의 모든 비트에 대하여 보수를 취한 후 1을 더하여 절대값을 산출하고 그 결과가 '8000h'인지 판단하게 된다.If the most significant bit of the input data is 1, the arithmetic operator 130 takes a complement of all the bits of the input data, adds 1 to calculate an absolute value, and determines whether the result is '8000h'.
상기에서 입력 데이타가 '8000h'가인 경우 보수를 취하여 1을 더하여도 '8000h'가 된다.In the case where the input data is '8000h', even if 1 is added to the complement, it becomes '8000h'.
따라서, 결과가 '8000h'가 아닌 경우 산술 연산기(130)는 그 결과값을 레지스터(140)에 저장하여 출력시키게 된다.Therefore, when the result is not '8000h', the arithmetic operator 130 stores the result in the register 140 and outputs the result.
만일, 결과가 '8000h'이면 산술 연산기(130)는 오버플로어 발생을 알리는 신호를 출력하게 된다.If the result is '8000h', the arithmetic operator 130 outputs a signal indicating the overflow occurrence.
이때, 산술 연산기(130)는 오버플로어가 발생하면 아래와 같은 프로그램을 수행하여 결과값을 '7FFFh'로 출력하게 된다.In this case, when the overflow occurs, the arithmetic operator 130 outputs the result value as '7FFFh' by executing the following program.
A=ABS(A) ;A = ABS (A);
C=7FFFh ;C = 7FFFh;
if overflow A=C ;if overflow A = C;
이에 따라, 레지스터(140)에는 '7FFFh'값이 저장되어 진다.Accordingly, the value '7FFFh' is stored in the register 140.
그러나, 이러한 종래의 기술은 하드웨어에 의해 절대값의 계산이 불가능하여 프로그램으로 처리하므로 프로그램이 복잡해짐은 물론 처리 시간이 길어지는 문제점이 있다.However, such a conventional technique is impossible to calculate the absolute value by hardware, so the program is complicated and the processing time is long.
따라서, 본 고안은 종래 기술의 단점을 개선하기 위하여 최대 음수처리를 위한 회로를 부가함으로써 프로그램을 간단히 함은 물론 처리시간도 줄일 수 있도록 안출한 최대 음수처리를 위한 절대값 계산회로를 제공함에 목적이 있다.Accordingly, an object of the present invention is to provide an absolute value calculation circuit for maximal negative processing, which can simplify the program and reduce processing time by adding a circuit for maximal negative processing to improve the disadvantage of the prior art. have.
도1은 종래 기술에 따른 블럭도.1 is a block diagram according to the prior art;
도2는 도1에서 산술 연산기의 처리를 위한 신호 흐름도.2 is a signal flow diagram for the processing of the arithmetic operator in FIG.
도3은 본 고안에 따른 실시예를 보인 블럭도.Figure 3 is a block diagram showing an embodiment according to the present invention.
* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings
210, 220, 240, 250 : 레지스터 230 : 산술 연산기210, 220, 240, 250: Register 230: Arithmetic operator
본 고안에 따른 절대값 계산 회로는 도3의 블럭도에 도시한 바와 같이, 입력 데이타를 각기 저장하는 레지스터(210)(220)와, 상기 레지스터(210 또는 220)의 출력데이타를 입력으로 절대값을 계산하고 오버플로어 여부를 판단하는 산술 연산기(230)와, 이 산술 연산기(230)의 오버플로어 신호에 따라 레지스터(250)의 최대 양수('7FFFh')와 상기 산술 연산기(230)의 출력값중 하나를 선택하는 멀티플렉서(260)와, 이 멀티플렉서(260)의 출력값을 저장하여 출력하는 레지스터(240)로 구성한다.As shown in the block diagram of FIG. 3, the absolute value calculating circuit according to the present invention uses the registers 210 and 220 for storing input data and the output data of the registers 210 or 220 as inputs. And an arithmetic operator 230 for determining whether or not to overflow, and a maximum positive number ('7FFFh') of the register 250 and an output value of the arithmetic operator 230 according to the overflow signal of the arithmetic operator 230. The multiplexer 260 which selects one, and the register 240 which stores and outputs the output value of this multiplexer 260 are comprised.
이와같이 구성한 본 고안의 실시예에 대한 동작 및 작용 효과를 설명하면 다음과 같다.Referring to the operation and effect of the embodiment of the present invention configured as described above are as follows.
먼저, 레지스터(210)(220)에는 16비트의 데이타가 교대로 저장되어진다.First, 16 bits of data are alternately stored in the registers 210 and 220.
이때, 산술 연산기(230)는 레지스터(210 또는 220)의 저장 데이타를 입력받아 최상위 비트가 1인지 판단하게 된다.At this time, the arithmetic operator 230 receives the stored data of the register 210 or 220 and determines whether the most significant bit is one.
이에 따라, 최상위 비트가 0이면 입력 데이타를 그대로 레지스터(240)에 저장하여 출력시키게 된다.Accordingly, when the most significant bit is 0, the input data is stored in the register 240 as it is and output.
만일, 입력 데이타의 최상위 비트가 1인 경우 사눌 연산기(230)는 입력 데이타의 모든 비트에 대하여 보수를 취한 후 1을 더하여 절대값을 산출하고 그 결과가 '8000h'인지 판단하게 된다.If the most significant bit of the input data is 1, the Sanur operator 230 takes a complement of all the bits of the input data, adds 1 to calculate an absolute value, and determines whether the result is '8000h'.
상기에서 입력 데이타가 '8000h'인 경우 보수를 취하여 1을 더하여도 '8000h'가 된다.In the case where the input data is '8000h', the complement is added and 1 becomes '8000h'.
이때, 결과가 '8000h'가 아니면 산술 연산기(230)는 오버플로어 신호를 액티브함이 없이 결과값을 출력하게 된다.At this time, if the result is not '8000h', the arithmetic operator 230 outputs a result value without activating the overflow signal.
이에 따라, 산술 연산기(230)의 오버플로어 신호가 인액티브 상태이므로 멀티플렉서(260)는 상기 산술 연산기(230)의 출력값을 선택하여 레지스터(240)에 저장시키게 된다.Accordingly, since the overflow signal of the arithmetic operator 230 is in an inactive state, the multiplexer 260 selects the output value of the arithmetic operator 230 and stores it in the register 240.
만일, 결과가 '8000h'이면 산술 연산기(230)는 오버플로어 발생을 알리는 신호를 멀티플렉서(260)에 출력하게 된다.If the result is '8000h', the arithmetic operator 230 outputs a signal indicating the overflow to the multiplexer 260.
이에 따라, 산술 연산기(230)의 오버플로어 신호가 액티브 상태가 되므로 멀티플렉서(260)는 상기 산술 연산기(230)의 출력값을 선택하는 것이 아니라 레지스터(250)에 저장된 최대 양수('7FFFh')를 선택하여 레지스터(240)에 저장시키게 된다.Accordingly, since the overflow signal of the arithmetic operator 230 becomes active, the multiplexer 260 selects the maximum positive number ('7FFFh') stored in the register 250 rather than selecting the output value of the arithmetic operator 230. To be stored in the register 240.
상기에서 상세히 설명한 바와 같이 본 고안은 오버플로어 발생시 프로그램에 의한 복잡한 연산 처리를 수행하는 것이 아니라 하드웨어를 구성하여 오버플로어 발생시 해당 연산값을 출력하도록 함으로써 연산 처리를 위한 프로그램이 간단해짐은 물론 처리 시간이 짧아지는 효과가 있다.As described in detail above, the present invention does not perform a complicated operation processing by a program when an overflow occurs, but by configuring the hardware to output a corresponding operation value when an overflow occurs, the program for the operation processing is simplified as well as processing time. There is a shortening effect.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR2019960035186U KR200156144Y1 (en) | 1996-10-24 | 1996-10-24 | A circuit of absolute value |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR2019960035186U KR200156144Y1 (en) | 1996-10-24 | 1996-10-24 | A circuit of absolute value |
Publications (2)
Publication Number | Publication Date |
---|---|
KR19980021864U KR19980021864U (en) | 1998-07-15 |
KR200156144Y1 true KR200156144Y1 (en) | 1999-09-01 |
Family
ID=19470577
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR2019960035186U KR200156144Y1 (en) | 1996-10-24 | 1996-10-24 | A circuit of absolute value |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR200156144Y1 (en) |
-
1996
- 1996-10-24 KR KR2019960035186U patent/KR200156144Y1/en not_active IP Right Cessation
Also Published As
Publication number | Publication date |
---|---|
KR19980021864U (en) | 1998-07-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0656582B1 (en) | Parallel adding and averaging circuit and method | |
JP3487903B2 (en) | Arithmetic device and arithmetic method | |
JPH05216624A (en) | Arithmetic unit | |
JP2596909B2 (en) | Digital processing device with min / max search instructions | |
JPS62191926A (en) | Arithmetic unit | |
KR200156144Y1 (en) | A circuit of absolute value | |
KR100627993B1 (en) | Three input split-adder | |
JPH0346024A (en) | Floating point computing element | |
JPH1091395A (en) | Processor | |
JP4372822B2 (en) | Parity prediction circuit and logical operation circuit using the same | |
EP0265948A2 (en) | Data processor capable of immediately calculating branch address in relative address branch | |
JPH07146777A (en) | Arithmetic unit | |
JP2004013519A (en) | Arithmetic method and arithmetic circuit | |
KR940007722A (en) | High Speed Microprocessor Branch Decision Circuit | |
KR100385233B1 (en) | Exponent unit for data processing system | |
KR930002850B1 (en) | Variable bit field making processor circuit | |
JP2664750B2 (en) | Arithmetic device and arithmetic processing method | |
JP3530418B2 (en) | Multiplier | |
KR100431707B1 (en) | Method for processing exponents on multiplication/division operation of floating point operation | |
JPH04195629A (en) | Arithmetic flag generation device | |
RU2225638C2 (en) | Arithmetic operations in data processing system | |
JP2665067B2 (en) | Floating point adder / subtracter | |
JPH04160533A (en) | Microprocessor | |
JPS62152042A (en) | Arithmetic processor | |
JPH0816550A (en) | Digital arithmetic circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
REGI | Registration of establishment | ||
FPAY | Annual fee payment |
Payment date: 20050524 Year of fee payment: 7 |
|
LAPS | Lapse due to unpaid annual fee |