WO2005024625A1 - Data processor - Google Patents

Data processor Download PDF

Info

Publication number
WO2005024625A1
WO2005024625A1 PCT/JP2003/010976 JP0310976W WO2005024625A1 WO 2005024625 A1 WO2005024625 A1 WO 2005024625A1 JP 0310976 W JP0310976 W JP 0310976W WO 2005024625 A1 WO2005024625 A1 WO 2005024625A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
rounding
bit
shifter
shift
Prior art date
Application number
PCT/JP2003/010976
Other languages
French (fr)
Japanese (ja)
Inventor
Tatsuo Ochiai
Osamu Akahira
Original Assignee
Hitachi Ulsi Systems 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 Hitachi Ulsi Systems Co., Ltd. filed Critical Hitachi Ulsi Systems Co., Ltd.
Priority to PCT/JP2003/010976 priority Critical patent/WO2005024625A1/en
Priority to JP2005508741A priority patent/JP4243277B2/en
Publication of WO2005024625A1 publication Critical patent/WO2005024625A1/en

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
    • 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/499Denomination or exception handling, e.g. rounding or overflow
    • G06F7/49942Significance control
    • G06F7/49947Rounding
    • 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/499Denomination or exception handling, e.g. rounding or overflow
    • G06F7/49942Significance control
    • G06F7/49947Rounding
    • G06F7/49957Implementation of IEEE-754 Standard

Definitions

  • the present invention relates to a data processing device, and more particularly to a technique for implementing a rounding operation with an efficient hardware configuration in a fixed-point arithmetic unit in a processor element.
  • Image processing including video compression is a repetition of a relatively simple calculation algorithm, and has high data parallelism for the same instruction. Therefore, to speed up image processing,
  • a S I MD (S i n g l e I n s t r u c t i o n M u l t i p l e D a t a s t r e am) parallel computing method is suitable.
  • MPEG ISO / IEC 14496-2 (MP EG 4), ISO / IEC 13818-2 (MP EG 2), and ISO / IEC 1 1 172-2 (MPEG 1)
  • MPEG ISO / IEC 14496-2 (MP EG 4), ISO / IEC 13818-2 (MP EG 2), and ISO / IEC 1 1 172-2 (MPEG 1)
  • the S IMD-type parallel computing architecture is applied to MPEG video compression, it is possible to use multiple processors as the calculation unit for the image block.
  • shift blocks in the detection range are arranged in local memories of multiple processors, the blocks to be compressed are broadcast from the control system to all processors, and the frame difference is calculated in parallel. Double the speed can be expected.
  • the block difference data between the block image to be compressed and the position of the detected motion vector is stored in the local memory of multiple processors, and DCT (or IDCT) or quantization (or inverse quantization) is calculated. Can be expected to speed up the number of processors by parallel processing. Disclosure of the invention
  • IEEE 754 is a floating-point format standard, for rounding an intermediate result of an operation to a predetermined bit of a mantissa and outputting the result.
  • this standard there are four types of rounding: nearest rounding, rounding in the ⁇ direction, rounding in the + ⁇ direction, and rounding in the 0 direction. Can be selected).
  • the data is rounded in one direction because it is simply truncated in hardware.
  • rounding in the + ⁇ direction, or rounding in the 0 direction it is necessary to do so by writing a program.
  • the bits to be rounded down are checked according to the desired rounding method, the state is determined, and the state is determined so that 1 is added to the least significant bit to be rounded.
  • An object of the present invention is to provide a data processing device capable of reducing the overhead of rounding processing with an efficient circuit configuration and efficiently improving the numerical calculation accuracy of an information processing device using a fixed-point arithmetic unit. It is in.
  • the data processing device of the present invention has the following features.
  • a processor including a shifter having a right bit shift operation function, an ALU having a carry-in function of adding 1-bit data to the least significant bit in addition of two input data, and the processor
  • a data processing device comprising a control unit controlled by a single instruction, wherein the shifter outputs data of a shift operation result and, at the same time, performs rounding evaluation on a bit truncated in the case of right bit shift.
  • the ALU has a rounding evaluation means for outputting 1-bit data indicating whether addition of "1" is necessary to the least significant bit of the shift operation result.
  • the ALU outputs one of the two input data to the output of the shifter.
  • the data used in the carry function is 1-bit data output by the rounding evaluation means of the shifter.
  • the shifter can output the right shift for digit alignment and the necessity of 1 addition for rounding at the same time as 1-bit data, and then the two Since the detected 1-bit data can be added simultaneously with the addition of the data, the time required for the rounding process for the data to be shifted rightward can be eliminated.
  • addition by 1 for rounding can be performed by the addition function with carry-in in the conventional ALU, it is only necessary to add a circuit for rounding evaluation to the shifter and 1-bit data output as the result.
  • the rounding evaluation means includes a rounding mode selection means.
  • a rounding process in a desired rounding mode can be realized with the same configuration as described above. For example, if the rounding mode in the operation of the above rounding evaluation circuit can be selected in response to a control signal from the control system, it can be used for the purpose of dynamically changing and using different rounding modes. Thus, a rounding process having the same effect as above can be performed.
  • the processor comprises a plurality of processors, and the rounding mode selecting means selects a rounding mode by data storage means provided for each of the plurality of processors.
  • the rounding evaluation is a logical sum of bits rounded down by the right bit shift.
  • the rounding evaluation is a logical product of the logical sum of the bits rounded down by the right bit shift and the sign of the shift operation data.
  • the operation of the rounding evaluation is performed by the logical product of the logical sum of the bits rounded down by the right bit shift in the shifter and the sign of the shift operation data, so that the signed data in the two's complement format is obtained.
  • Zero-direction rounding can be realized.
  • unidirectional rounding can be realized for signed absolute value format data.
  • the rounding evaluation is performed by calculating the logical sum of the bits excluding the most significant bit out of the bits truncated by the right bit shift and the least significant bit of the shift operation result, and the It is the logical product with the most significant bit. Accordingly, the operation of the rounding evaluation is performed by calculating the logical sum of the bits excluding the most significant bit of the bits truncated by the shift in the shifter and the least significant bit of the shift operation result and the bits truncated by the right shift.
  • the rounding mode selecting means needs to always negate the 1-bit data output from the rounding evaluation circuit to the ALU. It may be provided. At this time, it operates as one-direction rounding for signed data in 2's complement format. In addition, it operates as unsigned data or data in signed absolute value format as rounding in the 0 direction.
  • FIG. 1 is a block diagram showing a circuit configuration for implementing a rounding process according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing a detailed circuit configuration of the shifter of FIG.
  • FIG. 3 is a diagram showing a truth table of the operation in the rounding evaluation circuit of FIG.
  • FIG. 4 is a diagram showing a configuration of a SIMD parallel DSP including the circuit configuration of FIG.
  • FIG. 5 is a diagram showing a configuration in which storage means for designating the number of shift bits is added to the shifters of FIGS.
  • FIG. 6 is a diagram showing another configuration of the data operation execution unit of FIG.
  • FIG. 7 is a block diagram showing a detailed circuit configuration of the shifter of FIG.
  • FIG. 8 is a diagram showing a truth table of the operation in the rounding evaluation circuit of FIG.
  • FIG. 9 is a diagram showing a configuration in which a rounding process of the present invention is applied to a conventional data processing device.
  • FIG. 1 is a block diagram showing a circuit configuration for implementing a rounding process according to an embodiment of the present invention.
  • n represents the number of bits of the data signal, and may be, for example, 32 bits.
  • the shifter 10 performs a shift operation on the n-bit data transmitted selectively from the general-purpose register file 20 or externally via the shifter input line, and outputs the result to the n-bit shifter output latch 30 I do. At the same time, the rounding evaluation result is output to a 1-bit latch r40.
  • the selection of data in the shifter input line is performed by, for example, an externally applied control signal or the like.
  • the shift operation in the shifter 10 has an arithmetic-theoretical value shift function of left and right m ( ⁇ n) bit shifts, and although not shown, for example, an operation specified by a control signal or the like given from the outside is performed. Done.
  • arithmetic shift is a shift in which the input data is a binary number in 2's complement format, and the sign (MSB bit) of the shift operation is not changed. That is, in the case of right shift, the sign bit (input MSB bit) is packed in the number of upper shift bits of the output data in the arithmetic shift, and 0 in the logical shift.
  • shifter 10 has a rounding evaluation function, and outputs 1 to latch r 40 when it is necessary to add 1 to round the bits overflowing right by right shift into the output data of the right shift operation result. , Otherwise output 0 to latch r 40 c
  • the ALU 50 is connected to the shifter output latch 30, the general-purpose register file 20 or the first n-bit data or constant “0” transmitted from the outside via the ALU input line and the ALU input line. Via the line, the second n-bit data or constant "0" alternatively transmitted from the accumulative addition register ⁇ ⁇ R60 or the general-purpose register file 20 and a 1-bit latch r40 by the selector 90 Also Performs an arithmetic and logic operation on the 1-bit data selected from the latch CO 70 and outputs the result to the n-bit ALU output latch 80 and the accumulation register R 60.
  • the carry from the most significant bit (carry out) is output to the 1-bit latch CO70.
  • selection of data, selection of a constant 0, and selection of 1-bit data on the ALU input line and the ALU input line are performed by a force s (not shown), for example, an externally applied control signal or the like.
  • Arithmetic and logical operations in the ALU 50 have addition and subtraction as arithmetic operations and logical operation functions. Although not shown, for example, an operation specified by an externally applied control signal or the like is performed.
  • the arithmetic operation is a signed addition and subtraction in which the first data and the second data are binary numbers in a two's complement format, or an unsigned addition and subtraction in which the first data and the second data are unsigned binary numbers. Yes, and a carry-in function that adds 1-bit data to the least significant bit (LSB) at the same time can be selected for these two additions and subtractions.
  • LSB least significant bit
  • the logical operation is not particularly limited, but a logical sum, a logical product, an exclusive logical sum, a logical sum inverted, a logical product inverted, or an exclusive logical sum of the corresponding bits of the first data and the second data described above. This is a logical sum inversion.
  • n-bit data output from the ALU 50 in response to a control signal or the like given from the outside is written in the cumulative addition register $ R60.
  • the general-purpose register file 2 ⁇ includes, but is not limited to, one input and two outputs for a register group of n bits ⁇ multiple words, not shown, for example, writing to a register designated by an externally applied control signal or the like. Is read.
  • n-bit data alternatively transmitted from the shifter output latch 30 or the ALU output latch 80 via the RF write line is stored in the general register address 1 included in the control signal. Data is written to the register specified by (RFA1).
  • One of the two outputs of the general-purpose register file 20 is the control signal described above.
  • the data of the register specified by the general-purpose register address 0 (RFA0) included in is output and transmitted to the shifter input line and ALU input line.
  • the data of the register specified by the general-purpose register address 1 (RFA1) is output and transmitted to the ALU input 2 line and the outside.
  • the above output data is the data before the write.
  • the data width n 32 bits
  • the fixed-point position of the data is represented by the data name (number of integer bits; number of decimal bits), where the fixed-point position of the above three data Are A (10.22), B (1.31), and C (15.17), and the fixed-point position of the addition result X is X (16.16).
  • select general-purpose register file 20 for the shifter input line and transmit A (10.22) to the shifter.
  • processing step 1 the data obtained by arithmetically shifting A (10.22) to the right by 6 bits is output to shifter output latch 30, and the rounding evaluation result for the 6 bits that are truncated at the same time is output to latch r40. Is output.
  • the right 15-bit arithmetic shift operation is specified for the shifter 10.
  • the shifter output latch 30 is selected for the ALU input line, and the shift result of A in the processing step 1 is transmitted as the first data of the ALU 50.
  • a constant 0 is selected for the ALU input 2 line, and the second data of the ALU 50 is set to 0.
  • processing step 2 the data obtained by arithmetically shifting B (1.31) to the right by 15 bits is output to shifter output latch 30, and the rounding evaluation result for the 15 bits that are truncated at the same time are stored in latch r40. Is output.
  • the A LU50 rounds the 6 bits on the LSB side when A (10.22) is digit-aligned with A (16.16), and outputs the result to the cumulative addition register No. R60.
  • the shifter output latch 30 is selected for the ALU input line and the result of the shift of B in the processing step 2 is transmitted as the first data of the ALU 50.
  • the cumulative addition register # R0 is selected for the ALU input # line, and the rounding result of A in the processing step 2 is transmitted as the second data of the ALU 50.
  • processing step 3 the data obtained by arithmetically shifting C (15.17) to the right by one bit is output to shifter output latch 30, and the rounding evaluation result for one bit that is cut off at the same time is latch r4 Output to ⁇ . Also, the AL U50 rounds the 15 bits on the LSB side when B (1.3.1) is aligned with B (16.16), and A (1 6.16) Are added at the same time and output to the cumulative addition register No.R60.
  • the shifter output latch 30 is selected for the ALU input line, and the result of the C shift in the processing step 3 is transmitted as the first data of the ALU 50.
  • the cumulative addition register R60 is selected for the ALU input line, and the rounding and addition result of A and B in processing step 3 is transmitted as the second data of the ALU 50.
  • processing step 4 the ALU 50 rounded the 1 bit on the LSB side when aligning C (15.17) with B (16.16), and performed digit matching in processing step 2.
  • a (1 6. 16) and B (1 6. 16) are added to the addition result at the same time and output to the ALU output latch 80.
  • Select ALU output latch 80 for RF write line
  • processing step 5 the addition result obtained by performing rounding on (16.16) for A, B, and C and aligning the digits is output to the general-purpose register file 20, and the target X (16. 16)
  • processing steps equal to the number of data and two-step overs for the pipeline
  • processing steps for rounding off truncated bits generated by digit alignment can be eliminated.
  • FIG. 2 is a block diagram showing a detailed circuit configuration of the shifter of FIG.
  • a parallel shifter 100 performs a shift operation on n-bit data of a shifter input line according to a control signal and outputs n-bit data.
  • the arithmetic shift / logic shift selection signal is not particularly limited, but 0 indicates an arithmetic shift and 1 indicates a logical shift for the parallel shifter 100.
  • the number of shift bits is not particularly limited, but is a signal ( ⁇ m) in which ⁇ n is encoded in 2's complement format, where positive indicates the number of left shift bits and negative indicates the number of right shift bits.
  • the rounding mode selection signal is a signal that indicates the rounding mode to the rounding evaluation circuit 110, and is not particularly limited, but is 2 bits, B'OO is rounded in the ⁇ direction, and B'01 is rounded in the + ⁇ direction. , B '10 indicates rounding toward zero, and B' ll indicates rounding to the nearest. (However, B 'is a prefix for representing binary numbers.)
  • _ ⁇ direction rounding is the closest value that is not greater than the true value (the value represented by the input data) (the closest value that satisfies the condition among the values that can be expressed in the fixed-point position of the output data) This is a rounding mode of a rounding method.
  • + ⁇ direction rounding is a rounding mode that rounds to the nearest value that is not greater than the true value.
  • Round-to-zero is a rounding mode that rounds to the nearest value not greater than the absolute value of the true value.
  • the round-to-nearest mode is a rounding mode that rounds to the nearest value unconditionally. However, if the two nearest values are equidistant from the true value, round to the nearest value that results in LSB "0".
  • the rounding evaluation circuit 110 converts the lower 1 m I bits of the input data (that is, the bits to be truncated) into the above shift result. (Output of parel shifter 100) In the rounding mode specified by the rounding mode selection signal, whether 1 addition is necessary or not is evaluated. If 1 addition is required, 1 bit is output, indicating 1; otherwise, 0 is output.
  • FIG. 3 shows a truth table of the operation in the rounding evaluation circuit 110 of FIG.
  • the 1-bit output signal R as the evaluation result is expressed by the following logical expression for each rounding mode.
  • R (logical sum of truncated bits)
  • R (most significant bit of truncated data)
  • u means a logical sum
  • n means a logical product c
  • i-th bit indicates that the LSB of the input data is 0, and the MSB is n_1, and each bit is Indicates the bit at the position that becomes number i when numbered consecutively from 0 to n-1.
  • FIG. 4 is a diagram showing a configuration of a SIMD parallel DSP including the circuit configuration of FIG. 1, and is configured on, for example, a semiconductor substrate.
  • control unit 200 includes, but is not limited to, a program execution control unit 220 including a program memory 210 and a data control unit 240 including a data memory 230. It is comprised including.
  • the program memory 210 and the data memory 230 can input and output data from outside, and can perform information processing according to a calculation procedure (calculation algorithm) set from outside.
  • the processor array 250 is composed of a plurality of identically configured processors 260, and all processors 260 are controlled by a common data path via an instruction path, a broadcast data bus, and a tri-state buffer. c is also connected to, each processor 2 6 0, common processor selection signals and control of the tri-state buffers provided corresponding to each processor 2 6 0 is input, always only by controlling Yunitto 2 0 0 Processor 260 is selected.
  • the processor 260 includes a processor control unit 270 and a data operation execution unit 280.
  • the data operation execution unit 280 can have, for example, the circuit configuration shown in FIG.
  • the processor control unit 270 controls the data calculation execution unit based on an instruction given from the control unit 200 via an instruction path.
  • the instruction output by the program execution control unit 220 in the control unit 200 in synchronization with the processing step is, for example, VLIW (Very Long Instruction WORD), and the operation of each unit is controlled horizontally. Is done.
  • the instructions of each step output by the control unit 200 include the file corresponding to each section. A plurality of function blocks can be controlled horizontally in one step.
  • an instruction to the processor 260 (processor instruction field) is transmitted to all the processors 260 via the instruction path. That is, the control unit 200 controls all the processors 260 with the same instruction.
  • the processor instruction field transmitted to the processor 260 is transmitted to the processor controller 270 in the processor 260.
  • the processor control unit 270 operates in accordance with the instruction (processor control unit instruction field) for the processor control unit 270 in the transmitted processor instruction field, and executes the instruction (data operation) for the data operation execution unit 280. (Execution section instruction field) to the data operation execution section 280.
  • the processor control unit 270 negates all the write instructions in the data operation execution unit instruction field to the processor selection signal. Then, it is transmitted to the data operation execution unit 280.
  • the processor control unit 270 receives a condition code signal (CC) from the data operation execution unit 280. If there is a group mask execution instruction in the instruction in the processor control section instruction field, the processor control section 270 executes all the write instructions in the data operation execution section instruction field with the designated condition code. The signal is masked and transmitted to the data operation execution unit 280.
  • This condition code signal is, although not particularly limited, a signal indicating the operation state of the data operation execution unit 280, and a carry (carry-out) output from the ALU 50 in FIG. 1 via the latch CO 70. Although not shown in FIG. 1, a sign (MSB of data) signal output from the ALU 50 via the latch 80 and a zero (the operation result is 0) When Asserted) and overflow (MSB carry signal and MSB—exclusive OR of 1-bit carry signal).
  • the data operation execution unit instruction field transmitted to the data operation execution unit 280 in the processor 260 includes a shifter instruction field for the shifter 10, an ALU instruction field for the ALU 50, and a general-purpose register for the general-purpose register file 20.
  • the file instruction field is completed, and the function blocks of the circuit configuration shown in FIG. 1 are controlled, so that the rounding processes exemplified in the above processing steps 1 to 5 can be realized.
  • the rounding mode selection signal for the rounding evaluation circuit in the shifter shown in FIG. 2 is controlled by a rounding mode selection register R M R 290 provided in the processor control unit 270.
  • the data of the broadcast data path is written into the rounding mode selection register RMR290 when there is an RMR write instruction by an instruction in the processor control unit instruction field.
  • the rounding mode selection register RMR290 since the rounding mode selection signal shown in FIGS. 2 and 3 is 2 bits, the rounding mode selection register RMR290 has a 2-bit configuration and is inputted from the broadcast data path. The lower 2 bits of n (for example, 32) bit data are written.
  • the operation result of the processor 260 is taken out to the outside by selecting a desired processor 260 by the processor selection signal, and the tri-state buffer 300 of the processor 260 becomes a drive state and the data is output.
  • data unique to each processor can be obtained by adding storage means for specifying the number of shift bits of the shift operation.
  • FIG. 5 shows an embodiment in which storage means for designating the number of shift bits is added to the shifter according to the present invention described in FIGS.
  • the data is set in response to a write instruction added in the data operation execution unit instruction field.
  • the data to be written to the shift bit register SBR 400 is not particularly limited, but is the data transmitted from the ALU 50 via the overflow processing circuit 410.
  • the overflow processing circuit 410 inputs the n-bit data output from the ALU 50 as a 2's complement binary integer, and outputs the 2's complement 2 bits of the number of bits constituting the shift bit register SBR 400. Rounds the high-order bit to a decimal integer and outputs.
  • the output of the ALU 50 is one of 31 to 31, the value is output, but the output of the ALU 50 is 3 2 In the above cases (positive overflow), 31 is output, and when the output of ALU 50 is less than 132 (negative overflow), 131 is output.
  • the output of the number of shift bits to the shifter 10 is selected by the selector 420 from the instruction in the instruction field of the data operation execution section and the shift bit register SBR 400.
  • the control of the selector 420 is not particularly limited, for example, the maximum shift number specified by the instruction in the instruction field of the data operation execution section is a negative maximum value (when the shift bit number is 6 bits, 1 3 2), select the SBR output, otherwise select the number of shift bits specified by the instruction in the instruction field in the data execution unit instruction field.
  • the switching is performed by “0” and “1” of the output of the comparator circuit 30.
  • FIG. 6 shows a circuit configuration in which a multiplier and a local memory LM are added to the circuit configuration shown in FIG. 1 as another circuit configuration example of the data operation execution unit in the processor in FIG.
  • a multiplier 500 is provided with a shifter output latch 30 via a multiplier input line ⁇ , a general-purpose register file 20 or first n-bit data which is selectively transmitted from outside, and a multiplier. Multiplied by the second n-bit data transmitted from the general-purpose register file 20 or the output latch 520 of the local memory LM510 via the input-input line, and multiplied by 2 Transmits n bits (64 bits when 11 is 3 2) data to multiplier output latch 53 °.
  • the selection of data at the multiplier input line and the multiplier input line is not shown, but is made by, for example, a control signal given from the outside.
  • the output of the multiplier output latch 530 is transmitted to the shifter input line.
  • the local memory LM510 is composed of an n-bit ⁇ multiple-mode RAM (Random Access Memory). Although not shown, for example, a shifter output latch is provided in response to an externally applied control signal or the like. 30, ALU output The n-bit data selectively transmitted from the latch 80 or the outside is written into the address transmitted from the local memory pointer register LMP R 550 in the LM address control unit 540. 'Alternatively, the data stored in the address is read out to the local memory output latch 520 at the subsequent stage.
  • n-bit ⁇ multiple-mode RAM Random Access Memory
  • the output of the local memory output latch 520 is transmitted to the multiplier input line, the shifter input line and the ALU input line.
  • the LM address controller 540 includes a local memory pointer register LMPR 550 that outputs a write Z read address of the local memory LM 510. Increment, decrement, or write the data transmitted from the ALU output latch 80.
  • the output of the local memory pointer register LMPR550 is transmitted to the RF write line in addition to the address to the local memory LM510, and can be saved to the general-purpose register file 20 and operated by the ALU 50.
  • the functional blocks described in FIG. 1 are changed in accordance with the output data width of the multiplier 500 and the input data of the shifter 600.
  • the width has increased.
  • FIG. 7 is a block diagram showing a detailed circuit configuration of the shifter of FIG.
  • the parallel shifter 610 performs the same shift operation as the parallel shifter 100 shown in FIG. 2 on the basis of the MSB of the input data of 2 n bits, and outputs n bits.
  • the difference from the parallel shifter 100 described with reference to FIG. 2 is that when overflow does not occur in the left shift, the output of the number of LSB shift bits is 0 in FIG. 2 while the output of the parallel shifter 610 in FIG. Below the data This is the upper bit of n-bit data.
  • FIG. 8 shows a truth table of the operation in the rounding evaluation circuit shown in FIG. Since the above-described parallel shifter 610 of FIG. 7 shifts the input 2 n-bit data with reference to the MSB and outputs n bits, a truncated bit is generated even in the left bit (including 0-bit shift).
  • the rounding evaluation circuit 620 in FIG. 7 is different from the operation of the rounding evaluation circuit 110 in FIG. 2 in that the 2 n-bit input data is independent of the shift direction of the shift operation (ie, always). The difference is that the truncated bits in are evaluated.
  • a relatively small-scale circuit was added to an information processing device that can process parallel algorithms such as image processing or neural networks at high speeds with an SIMD-type parallel DSP composed of one control system and multiple processors.
  • the rounding function can be incorporated without increasing the number of processing steps, and this achieves the object of the present invention of efficiently improving the numerical calculation accuracy of an information processing device using a fixed-point arithmetic unit.
  • FIG. 9 shows a configuration in which the rounding process of the present invention is applied to a conventional data processing device.
  • the processor constituting the data processing device includes an arithmetic unit 11, a local memory unit 12, and a tristate buffer 13.
  • the operation unit 11 includes a processor control circuit 1101, including the rounding mode selection register RMR290 of the present embodiment, a latch circuit 1102, 1105, 1107, 1112, 1114, a general register file 1103, Multiplier 1104, Condition code register (CCR) 1106 including CO register 70 of this embodiment, Accumulation register 1108, ALU (arithmetic logic unit) 50 of this embodiment, selector 90, SBR (shift bit) Register) 110, the shifter 10 and the touch r40 of the present embodiment, and the absolute difference calculator 113.
  • processor control circuit 1101 including the rounding mode selection register RMR290 of the present embodiment, a latch circuit 1102, 1105, 1107, 1112, 1114, a general register file 1103, Multiplier 1104, Condition code register (CCR) 1106 including CO register 70 of this embodiment, Accumulation register 1108, ALU (arithmetic logic unit) 50 of this embodiment,
  • the local memory unit 12 has addresses for generating address signals of the local memories (LM0, LM1) 1202, 1204, and the local memory 1202. Address operation circuit 1203 for generating an address signal for the local memory 1204, and selectors 1205, 1206, 1207, 1208, and 1209.
  • the operation of the data processing device shown in FIG. 9 is as follows.
  • the shifter 10, the latch r40, the ALU (arithmetic logic unit) 50, and the selector 90 perform the operations described in the present embodiment. Is the same as the operation of the data processing device described in Japanese Patent Application No. 2003_23076.
  • the addition of the rounder evaluation function to the shifter block requires only the rounding mode selection signal and the 1-bit output signal as the evaluation result, and the overhead of the rounding process can be reduced with an efficient circuit configuration.
  • the numerical calculation accuracy of the information processing device using the fixed-point arithmetic unit is efficiently improved.
  • the present invention can be applied to a single processor, that is, a general DSP, and can be applied to a semiconductor device equipped with a DSP such as an SIMD type parallel DSP.
  • the present invention can be applied to a circuit configuration for processing a floating-point operation. Furthermore, the present invention can also be applied to an arithmetic execution unit (EXEcut iount Unit) of a CPU represented by an SH microcomputer.
  • EXEcut iount Unit arithmetic execution unit of a CPU represented by an SH microcomputer.
  • the present invention can be applied to all digital signal processing devices that require rounding.

Abstract

A data processor enabling reduction of overhead of rounding with an efficient circuit constitution and enabling efficient improvement of the numeric operation accuracy of an information processor using a fixed-point calculating unit. The data processor comprises a processor including a shifter (10) having a right bit-shift calculation function and an ALU (50) having a carry-in function of adding one-bit data to the least significant bit when two numbers of input data are added, and a control unit (200) for controlling the processor by a single instruction. The shifter (10) has a rounding evaluation circuit (110) for outputting the data on the result of shift operation, performing rounding evaluation of the bit rounded down when data is right-bit-shifted and outputting one-bit data representing whether or not it is necessary to add “1” to the least significant bit of the shift calculation result. The ALU (50) handles one of the two number of input data as output data of the shifter (10) and handles the data used by the carry-in function as one-bit data outputted from the rounding evaluation circuit (110).

Description

データ処理装置 Data processing device
技術分野 Technical field
本発明は、 データ処理装置に関し、 特にプロセッサエレメントにおける固定 小数点演算器で、 効率的なハードウエア構成により丸め演算を実現する技術に 関する。  The present invention relates to a data processing device, and more particularly to a technique for implementing a rounding operation with an efficient hardware configuration in a fixed-point arithmetic unit in a processor element.
明 背景技術 田 動画圧縮を含めた画像処理は、 比較的単純な計算アルゴリズムの反復であり、 同一命令に対するデータ並列性が大きい。 そのため、 画像処理の高速化には、 Description Background Art Image processing including video compression is a repetition of a relatively simple calculation algorithm, and has high data parallelism for the same instruction. Therefore, to speed up image processing,
S I MD (S i n g l e I n s t r u c t i o n Mu l t i p l e D a t a s t r e am) 型並列計算手法が適する。 A S I MD (S i n g l e I n s t r u c t i o n M u l t i p l e D a t a s t r e am) parallel computing method is suitable.
動画圧縮規格としては、 MPEG (I SO/I EC 14496-2 (MP E G 4) , I S O/ I EC 13818-2 (MP E G 2) , I S O/ I E C 1 1 172-2 (MPEG 1) ) が知られている。 この動画圧縮規格によれば、 デ ジタル化された画像をプロック分割して各プロック毎に動きべクトルを検出し、 DTC (離散コサイン変換) 、 及び量子化を施し、 ハフマン符号化して画像デ ータを圧縮する。  MPEG (ISO / IEC 14496-2 (MP EG 4), ISO / IEC 13818-2 (MP EG 2), and ISO / IEC 1 1 172-2 (MPEG 1)) are known as video compression standards. Has been. According to this video compression standard, a digitized image is divided into blocks, motion vectors are detected for each block, DTC (Discrete Cosine Transform) and quantization are performed, and Huffman coding is performed on the image data. Compress the data.
S IMD型並列計算アーキテクチャを MP EG動画圧縮に適用すると、 複数 のプロセッサを上記画像ブロックの計算単位とすることがきる。 すなわち、 動 きべクトル検出では、 検出範囲のシフトプロックを複数プロセッサのローカル メモリに配置し、 制御系から圧縮対象のプロックを全プロセッサにブロードキ ャストしてフレーム差を並列演算することで、 プロセッサ数倍の高速化が期待 できる。 また、 圧縮対象のブロック画像あるいは検出した動きベクトル位置と のプロック単位のフレーム差データを複数プロセッサのローカルメモリに配置 し、 DCT (あるいは I D CT) あるいは量子化 (あるいは逆量子化) の計算 を並列演算することで、 プロセッサ数倍の高速化が期待できる。 発明の開示 If the S IMD-type parallel computing architecture is applied to MPEG video compression, it is possible to use multiple processors as the calculation unit for the image block. In other words, in motion vector detection, shift blocks in the detection range are arranged in local memories of multiple processors, the blocks to be compressed are broadcast from the control system to all processors, and the frame difference is calculated in parallel. Double the speed can be expected. In addition, the block difference data between the block image to be compressed and the position of the detected motion vector is stored in the local memory of multiple processors, and DCT (or IDCT) or quantization (or inverse quantization) is calculated. Can be expected to speed up the number of processors by parallel processing. Disclosure of the invention
本発明者らの検討によれば、 上記した技術では、 固定小数点形式のデータに ついて、 乗算によって変更されるビット数の調整あるいは加減算で整数部の有 効桁数を調整するための小数点位置の変更は、 プロセッサ内のシフタで行われ る。 このとき、 乗算結果を所定のデータ幅に縮小するために L S B側のビット を削除あるいはシフタによる右ビットシフトする場合には、 演算精度の劣化を 避けるためにデータの L S Bに対して丸め処理が必要である。  According to the study of the present inventors, in the above-described technique, for fixed-point format data, adjustment of the number of bits changed by multiplication or adjustment of the number of significant digits of the integer part by addition or subtraction is performed. Changes are made in shifters within the processor. At this time, if the bits on the LSB side are deleted or the bits are shifted to the right by a shifter to reduce the multiplication result to a predetermined data width, rounding of the LSB of the data is required to avoid deterioration in calculation accuracy It is.
丸め処理には、 浮動小数点形式の規格である I E E E 7 5 4において、 演算 の途中結果を仮数部の所定ビットに丸めて出力するために定められた方法があ る。 本規格によれば、 最近値丸め、 _∞方向丸め、 +∞方向丸め、 及び 0方向 丸めの 4種の方法があり、 アプリケーションは必要な精度に応じて何れかの丸 め方法 (以下丸めモードと記载する) を選択可能とされる。  In the rounding process, there is a method defined in IEEE 754, which is a floating-point format standard, for rounding an intermediate result of an operation to a predetermined bit of a mantissa and outputting the result. According to this standard, there are four types of rounding: nearest rounding, rounding in the ∞ direction, rounding in the + ∞ direction, and rounding in the 0 direction. Can be selected).
上記した技術では、 ハード的には単に切り捨てのために、 データは一∞方向 の丸めとなる。 その他の最近値丸め、 +∞方向丸め、 あるいは 0方向丸めを用 いるためには、 プログラムの記述によってソフト的に行う必要がある。 すなわ ち、 プログラムの記述によって、 所望の丸め方法に応じて切り捨てるビットを 調べその状態について判断し丸める最下位ビットに 1を加算するように動作さ せる。  In the above technique, the data is rounded in one direction because it is simply truncated in hardware. In order to use other round-to-nearest rounds, rounding in the + ∞ direction, or rounding in the 0 direction, it is necessary to do so by writing a program. In other words, according to the description of the program, the bits to be rounded down are checked according to the desired rounding method, the state is determined, and the state is determined so that 1 is added to the least significant bit to be rounded.
しかしながら、 プログラムによる上記丸め処理の実現では、 切り捨てるビッ トを評価するためのシフ ト演算と、 その状態を判断するための A L U (开算 Ί術'に- " 理演算ュニッ ト) によるコンディションコードの取得処理が必要となる。 そのため、 ハード的に無策な _∞方向の場合には、 例えばパイプライン処理 によって見かけ上の 1データを 1ステップで処理可能とされる演算であっても その他の最近値丸め、 +∞方向丸め、 あるいは 0方向丸めを用いる場合には丸 めのための処理ステップが必要となり、 速度性能が劣化する。 特に、 S I MD 型並列演算器構成では、 1つのプログラムに対して複数の演算データが同時に 存在するため、 データ状態に応じた処理ステップの分岐による高速化は困難で あり、 全ケースの処理ステップ時間が必要となる。 However, in the above-described rounding processing implemented by a program, a shift operation for evaluating the bits to be truncated and an ALU (arithmetic operation unit) for judging the state of the shift code are used to determine the state. Therefore, in the case of the _∞ direction, which is inconvenient in terms of hardware, for example, even if it is an operation that can process apparent 1 data in 1 step by pipeline processing, other recent values When using rounding, rounding in the + 0 direction, or rounding in the 0 direction, a processing step for rounding is required, and the speed performance is deteriorated. Simultaneous calculation data Since it exists, it is difficult to increase the processing speed by branching processing steps according to the data state, and processing step time is required for all cases.
本発明の目的は、 効率的な回路構成で丸め処理のオーバヘッド低減でき、 固 定小数点演算器を用いた情報処理装置の数値演算精度を効率的に向上すること のできるデータ処理装置を提供することにある。  An object of the present invention is to provide a data processing device capable of reducing the overhead of rounding processing with an efficient circuit configuration and efficiently improving the numerical calculation accuracy of an information processing device using a fixed-point arithmetic unit. It is in.
本発明の前記並びにその他の目的と新規な特徴は、 本明細書の記述及び添付 図面から明らかになるであろう。  The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.
本願において開示される発明のうち、 代表的なものの概要を簡単に説明すれ ば、 次のとおりである。  The following is a brief description of an outline of typical inventions disclosed in the present application.
すなわち、 本発明のデータ処理装置は、 以下のような特徴を有するものであ る。  That is, the data processing device of the present invention has the following features.
( 1 ) 右ビットシフト演算機能を有するシフタと、 2つの入力データの加算に、 最下位ビットに 1ビットデータを加算するキャリーイン機能を有する A L Uと を含んで構成されたプロセッサと、 前記プロセッサを単一命令で制御する制御 ユニットとで構成されるデータ処理装置であって、 上記シフタは、 シフト演算 結果のデータを出力すると同時に、 右ビットシフトの場合に切り捨てられるビ ットについて丸め評価をしてシフト演算結果の最下位ビットに " 1 " 加算が必 要か否かを示す 1ビットデータを出力する丸め評価手段を有し、 上記 A L Uは、 2入力データの内の一方を上記シフタの出力データとし、 上記キヤリーィン機 能で用いるデータを上記シフタの丸め評価手段が出力する 1ビットデータとす るものである。  (1) a processor including a shifter having a right bit shift operation function, an ALU having a carry-in function of adding 1-bit data to the least significant bit in addition of two input data, and the processor A data processing device comprising a control unit controlled by a single instruction, wherein the shifter outputs data of a shift operation result and, at the same time, performs rounding evaluation on a bit truncated in the case of right bit shift. The ALU has a rounding evaluation means for outputting 1-bit data indicating whether addition of "1" is necessary to the least significant bit of the shift operation result. The ALU outputs one of the two input data to the output of the shifter. The data used in the carry function is 1-bit data output by the rounding evaluation means of the shifter.
これにより、 異なる小数点位置のデータを加算する場合、 整数桁を保証する ために、 整数桁の少ないデータを右シフトして桁合わせをしてから加算する。 上記のように構成したことによって、 先ずシフタにおいて桁合わせのための右 シフトと同時に丸め処理のための 1加算の要否が 1ビットデータとして出力で き、 次に A L Uにおいて桁合わせされた 2つのデータの加算と同時にこの検出 された 1ビットデータを加算できるので、 右シフトするデータについての丸め 処理に要する時間を解消することができる。 また、 丸めのための 1加算は、 従来技術の A L Uにおけるキャリーイン付き 加算機能とすることができるので、 シフタへの丸め評価と該結果としての 1ビ ットデータ出力の回路を追加するだけですむ。 In this way, when adding data with different decimal places, data with few integer digits are right-shifted and digit-aligned to ensure integer digits before addition. With the configuration described above, first, the shifter can output the right shift for digit alignment and the necessity of 1 addition for rounding at the same time as 1-bit data, and then the two Since the detected 1-bit data can be added simultaneously with the addition of the data, the time required for the rounding process for the data to be shifted rightward can be eliminated. In addition, since addition by 1 for rounding can be performed by the addition function with carry-in in the conventional ALU, it is only necessary to add a circuit for rounding evaluation to the shifter and 1-bit data output as the result.
( 2 ) 上記シフタにおける右シフト演算及び上記 A L Uにおけるキヤリーイン 機能の加算は、 2の補数形式のデータに対応した演算である。  (2) The right shift operation in the shifter and the addition of the carry-in function in the ALU are operations corresponding to two's complement data.
これにより、 上記シフタ及び A L Uの演算を従来技術である 2の補数形式の 演算とすることで、 符号付き演算に対して、 上記同様の構成で丸め処理を実現 することができる。 例えば、 上記シフタ及び A L Uの演算を制御系からの制御 信号に呼応して符号無し演算または符号付き演算の何れかに選択可能とすれば、 符号無しデータ及び符号付きデータが混在するような利用目的であっても、 上 記同様の効果の丸め処理が可能となる。  Thus, by performing the arithmetic operation of the shifter and the ALU as an arithmetic operation of the two's complement format, which is a conventional technique, it is possible to realize a rounding process for a signed arithmetic operation with the same configuration as described above. For example, if the operation of the shifter and ALU can be selected to either unsigned operation or signed operation in response to a control signal from the control system, the purpose of use is to mix unsigned data and signed data. Even with this, rounding with the same effect as described above can be performed.
( 3 ) 丸めモード選択手段を有し、 上記丸め評価手段は、 該丸めモード選択手 段  (3) There is a rounding mode selection means, and the rounding evaluation means includes a rounding mode selection means.
で選択可能な複数の丸めモードの個々に対応した丸め評価を行うものである。 これにより、 上記丸め評価回路を、 複数の丸めモードに対応させることで、 上記同様の構成で所望の丸めモードの丸め処理を実現することができる。 例え ば、 上記丸め評価回路の動作における丸めモードを制御系からの制御信号に呼 応して選択可能とすれば、 異なる丸めモー,ドを動的に変更して用いるような利 用目的に対して、 上記同様の効果の丸め処理が可能となる。 Is to perform rounding evaluation corresponding to each of a plurality of rounding modes that can be selected. Thus, by making the rounding evaluation circuit correspond to a plurality of rounding modes, a rounding process in a desired rounding mode can be realized with the same configuration as described above. For example, if the rounding mode in the operation of the above rounding evaluation circuit can be selected in response to a control signal from the control system, it can be used for the purpose of dynamically changing and using different rounding modes. Thus, a rounding process having the same effect as above can be performed.
( 4 ) 上記プロセッサは複数からなり、 上記丸めモード選択手段は、 上記複数 のプロセッサの個々に設けられたデータ記憶手段によって丸めモードを選択す るものである。  (4) The processor comprises a plurality of processors, and the rounding mode selecting means selects a rounding mode by data storage means provided for each of the plurality of processors.
これにより、 上記丸めモードを選択する手段を、 プロセッサ毎に設けたレジ スタなどの記憶手段とすることで、 制御系から複数のプロセッサに対する制御 信号の本数を低減できる効果がある。  This makes it possible to reduce the number of control signals from the control system to a plurality of processors by using the means for selecting the rounding mode as a storage means such as a register provided for each processor.
( 5 ) 上記丸め評価は、 上記右ビットシフトで切り捨てられるビットの論理和 である。  (5) The rounding evaluation is a logical sum of bits rounded down by the right bit shift.
これにより、 上記丸め評価の動作を、 上記シフタにおける右ビットシフトで 切り捨てられるビットの論理和とすることで、 符号無しデータあるいは 2の補 数形式の符号付きデータに対して +∞方向丸め (切り上げ) を実現することが できる。 また、 符号付き絶対値形式のデータに対して、 符号の∞方向丸めを実 現することができる。 Thereby, the operation of the rounding evaluation can be performed by the right bit shift in the shifter. By calculating the logical sum of the bits to be truncated, + ∞ direction rounding (rounding up) can be realized for unsigned data or signed data in 2's complement format. In addition, sign-direction rounding in signed absolute value format data can be realized.
( 6 ) 上記丸め評価は、 上記右ビットシフトで切り捨てられるビットの論理和 と、 シフト演算データの符号との論理積である。  (6) The rounding evaluation is a logical product of the logical sum of the bits rounded down by the right bit shift and the sign of the shift operation data.
これにより、 上記丸め評価の動作を、 上記シフタにおける右ビットシフトで 切り捨てられるビットの論理和と、 シフト演算データの符号との論理積とする ことで、 2の補数形式の符号付きデータに対して 0方向丸めを実現することが できる。 また、 符号付き絶対値形式のデータに対して、 一∞方向丸めを実現す ることができる。  Accordingly, the operation of the rounding evaluation is performed by the logical product of the logical sum of the bits rounded down by the right bit shift in the shifter and the sign of the shift operation data, so that the signed data in the two's complement format is obtained. Zero-direction rounding can be realized. In addition, unidirectional rounding can be realized for signed absolute value format data.
( 7 ) 上記丸め評価は、 上記右ビットシフトで切り捨てられるビットの内の最 上位ビットを除くビットとシフト演算結果の最下位ビットとの論理和と、 上記 右ビットシフトで切り捨てられるビットの内の最上位ビットとの論理積である。 これにより、 上記丸め評価の動作を、 上記シフタにおけるシフトで切り捨て られるビットの内の最上位ビットを除くビットとシフト演算結果の最下位ビッ トとの論理和と、 上記右シフトで切り捨てられるビットの内の最上位ビットと の論理積とすることで、 符号無しデータ、 2の補数形式の符号付きデータある いは符号付き絶対値形式のデータに対して、 最近値丸めを実現することができ る。  (7) The rounding evaluation is performed by calculating the logical sum of the bits excluding the most significant bit out of the bits truncated by the right bit shift and the least significant bit of the shift operation result, and the It is the logical product with the most significant bit. Accordingly, the operation of the rounding evaluation is performed by calculating the logical sum of the bits excluding the most significant bit of the bits truncated by the shift in the shifter and the least significant bit of the shift operation result and the bits truncated by the right shift. By performing a logical AND with the most significant bit in, recent value rounding can be realized for unsigned data, signed two's complement data, or signed absolute value data. .
( 8 ) 1つの半導体基板に構成されたものである。  (8) It is configured on one semiconductor substrate.
上記データ処理装置によれば、 さらに、 従来の技術同様に切り捨てを実現す るためには、 上記丸めモード選択手段によって、 上記丸め評価回路から上記 A L Uへの 1ビットデータ出力を常にネゲートする状態を設ければよい。 このと き、 2の補数形式の符号付きデータに対して一∞方向丸めとして動作する。 ま た、 符号無しデータあるいは符号付き絶対値形式のデータに対して 0方向丸め (切り捨て) として動作する。  According to the data processing device, in order to realize truncation in the same manner as in the related art, the rounding mode selecting means needs to always negate the 1-bit data output from the rounding evaluation circuit to the ALU. It may be provided. At this time, it operates as one-direction rounding for signed data in 2's complement format. In addition, it operates as unsigned data or data in signed absolute value format as rounding in the 0 direction.
上記のごとく丸め評価回路を設けたことによるシフタの端子追加は、 モード 指定の信号と A L Uへの 1ビットデータ出力信号だけですむ。 また、 シフタに 追加する丸め評価回路が、 複数の丸めモードに対応させたとしても、 切り捨て るビッ小の論理和を共通にすることができるので回路規模は少なくてすむ。 以上のように、 効率的な回路構成で丸め処理のオーバへッド低減を達成する 図面の簡単な説明 Addition of shifter terminals by providing the rounding evaluation circuit as described above Only the specified signal and the 1-bit data output signal to the ALU are required. Also, even if the rounding evaluation circuit added to the shifter is compatible with multiple rounding modes, the circuit size can be reduced because the logical sum of the bits to be truncated can be made common. As described above, the overhead reduction of the rounding processing is achieved with an efficient circuit configuration.
図 1は、 本発明の一実施の形態である丸め処理を実現する回路構成を示すブ ロック図である。  FIG. 1 is a block diagram showing a circuit configuration for implementing a rounding process according to an embodiment of the present invention.
図 2は、 図 1のシフタの詳細な回路構成を示すプロック図である。  FIG. 2 is a block diagram showing a detailed circuit configuration of the shifter of FIG.
図 3は、 図 2の丸め評価回路における動作の真理値表を示す図である。 図 4は、 図 1の回路構成を含んだ S I MD型の並列 D S Pの構成を示す図で ある。  FIG. 3 is a diagram showing a truth table of the operation in the rounding evaluation circuit of FIG. FIG. 4 is a diagram showing a configuration of a SIMD parallel DSP including the circuit configuration of FIG.
図 5は、 図 2, 図 3のシフタにシフトビット数を指定する記憶手段を追加す る構成を示す図である。  FIG. 5 is a diagram showing a configuration in which storage means for designating the number of shift bits is added to the shifters of FIGS.
図 6は、 図 4のデータ演算実行部の別の構成を示す図である。  FIG. 6 is a diagram showing another configuration of the data operation execution unit of FIG.
図 7は、 図 6のシフタの詳細な回路構成を示すプロック図である。  FIG. 7 is a block diagram showing a detailed circuit configuration of the shifter of FIG.
図 8は、 図 7の丸め評価回路における動作の真理値表を示す図である。 図 9は、 従来のデータ処理装置に本発明の丸め処理を適用した構成を示す図 である。 発明を実施するための最良の形態  FIG. 8 is a diagram showing a truth table of the operation in the rounding evaluation circuit of FIG. FIG. 9 is a diagram showing a configuration in which a rounding process of the present invention is applied to a conventional data processing device. BEST MODE FOR CARRYING OUT THE INVENTION
以下、 本発明の実施の形態を図面に基づいて詳細に説明する。 なお、 実施の 形態を説明するための全図において、 同一部材には同一の符号を付し、 その繰 り返しの説明は省略する。  Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In all the drawings for describing the embodiments, the same members are denoted by the same reference numerals, and the description thereof will not be repeated.
図 1は、 本発明の一実施の形態である丸め処理を実現する回路構成を示すブ ロック図である。  FIG. 1 is a block diagram showing a circuit configuration for implementing a rounding process according to an embodiment of the present invention.
図 1において、 nはデータ信号のビット数を表し、 例えば 3 2ビットとする ことができる。 シフタ 1 0は、 シフタ入力ラインを介して、 汎用レジスタファイル 2 0また は外部から択一的に伝達された nビッ トデータについて、 シフ ト演算し、 結果 を nビットのシフタ出力ラッチ 3 0に出力する。 同時に、 丸め評価結果を 1ビ ッ トのラッチ r 4 0に出力する。 In FIG. 1, n represents the number of bits of the data signal, and may be, for example, 32 bits. The shifter 10 performs a shift operation on the n-bit data transmitted selectively from the general-purpose register file 20 or externally via the shifter input line, and outputs the result to the n-bit shifter output latch 30 I do. At the same time, the rounding evaluation result is output to a 1-bit latch r40.
ここで、 シフタ入力ラインでのデータの選択は、 図示しないが、 例えば、 外 部から与えられる制御信号などで為される。  Here, although not shown, the selection of data in the shifter input line is performed by, for example, an externally applied control signal or the like.
シフタ 1 0におけるシフ ト演算は、 左右 m ( < n ) ビッ トシフ トの算術 -論 値シフ ト機能を有し、 図示しないが、 例えば、 外部から与えられる制御信号な どで指定された演算が為される。  The shift operation in the shifter 10 has an arithmetic-theoretical value shift function of left and right m (<n) bit shifts, and although not shown, for example, an operation specified by a control signal or the like given from the outside is performed. Done.
算術シフトと論理シフ トの相違は、 算術シフトが入力データを 2の補数形式 の 2進数としたシフ トであって、 シフ ト演算による符号 (M S Bビッ ト) が変 更されない点である。 すなわち、 右シフ トの場合、 算術シフ トでは出力データ の上位シフトビット数には符号ビット (入力の M S Bビット) が詰められ、 論 理シフトでは 0が詰められる。  The difference between arithmetic shift and logical shift is that arithmetic shift is a shift in which the input data is a binary number in 2's complement format, and the sign (MSB bit) of the shift operation is not changed. That is, in the case of right shift, the sign bit (input MSB bit) is packed in the number of upper shift bits of the output data in the arithmetic shift, and 0 in the logical shift.
左シフトの場合、 出力データの下位シフトビット数には算術及び論理シフト 共に 0が詰められるが、 算術シフトでは入力データの上位のシフトビット数 + 1ビットが同じでない入力データに対してオーバフロ一処理が為され、 入力デ ータの符号に等しい最大値 (3 2ビッ 卜の場合、 正の最大値は H' 7fffffff、 負の最大値は H' 80000000、 ただし H'は 1 6進数を表すための接頭詞) が出力 される。  In the case of left shift, the number of lower shift bits of the output data is padded with 0 for both arithmetic and logical shifts, but in arithmetic shift, overflow processing is performed on input data where the number of upper shift bits + 1 bit of input data is not the same. The maximum value equal to the sign of the input data (for 32 bits, the maximum positive value is H '7fffffff, the maximum negative value is H' 80000000, but H 'is hexadecimal. Is output.
さらに、 シフタ 1 0は丸め評価機能を有し、 右シフトで右にあふれるビット を上記右シフト演算結果の出力データに丸めるために 1加算が必要な場合には ラッチ r 4 0に 1を出力し、 それ以外の場合にはラッチ r 4 0に 0を出力する c Further, shifter 10 has a rounding evaluation function, and outputs 1 to latch r 40 when it is necessary to add 1 to round the bits overflowing right by right shift into the output data of the right shift operation result. , Otherwise output 0 to latch r 40 c
A L U 5 0は、 A L U入力①ラインを介して、 シフタ出力ラッチ 3 0、 汎用 レジスタファイル 2 0または外部から択一的に伝達された第 1の nビットデー タまたは定数 " 0 " と、 A L U入力②ラインを介して、 累積加算レジスタ∑R 6 0または汎用レジスタファイル 2 0から択一的に伝達された第 2の nビット データまたは定数 " 0 " と、 セレクタ 9 0により 1ビットのラッチ r 4 0また はラッチ CO 70から選択された 1ビットデータとについて、 算術論理演算し、 結果を nビットの ALU出力ラッチ 80及び累積加算レジスタ∑R 60に出力 する。 The ALU 50 is connected to the shifter output latch 30, the general-purpose register file 20 or the first n-bit data or constant “0” transmitted from the outside via the ALU input line and the ALU input line. Via the line, the second n-bit data or constant "0" alternatively transmitted from the accumulative addition register 汎 用 R60 or the general-purpose register file 20 and a 1-bit latch r40 by the selector 90 Also Performs an arithmetic and logic operation on the 1-bit data selected from the latch CO 70 and outputs the result to the n-bit ALU output latch 80 and the accumulation register R 60.
同時に、 最上位ビットからの桁上がり (キャリーアウト) を 1ビットのラッ チ CO70に出力する。 ここで、 ALU入力①ライン及び ALU入力②ライン でのデータの選択、 定数 0の選択、 及び 1ビットデータの選択は、 図示しない 力 s、 例えば、 外部から与えられる制御信号などで為される。  At the same time, the carry from the most significant bit (carry out) is output to the 1-bit latch CO70. Here, selection of data, selection of a constant 0, and selection of 1-bit data on the ALU input line and the ALU input line are performed by a force s (not shown), for example, an externally applied control signal or the like.
ALU 50における算術 ·論理演算は、 算術演算としての加減算、 及び論理 演算機能を有し、 図示しないが、 例えば、 外部から与えられる制御信号などで 指定された演算が為される。 算術演算は、 上記第 1のデータと第 2のデータを 2の補数形式の 2進数とした符号付き加減算、 または上記第 1のデータと第 2 のデータを符号無し 2進数とした符号無し加減算であり、 さらに、 これら 2つ の加減算において、 最下位ビット (LSB) に 1ビットデータを同時に加算す るキャリーィン機能が選択可能である。  Arithmetic and logical operations in the ALU 50 have addition and subtraction as arithmetic operations and logical operation functions. Although not shown, for example, an operation specified by an externally applied control signal or the like is performed. The arithmetic operation is a signed addition and subtraction in which the first data and the second data are binary numbers in a two's complement format, or an unsigned addition and subtraction in which the first data and the second data are unsigned binary numbers. Yes, and a carry-in function that adds 1-bit data to the least significant bit (LSB) at the same time can be selected for these two additions and subtractions.
論理演算は、 特に制限されないが、 上記第 1のデータと第 2のデータの各対 応するビットについての、 論理和、 論理積、 排他的論理和、 論理和反転、 論理 積反転、 または排他的論理和反転である。  The logical operation is not particularly limited, but a logical sum, a logical product, an exclusive logical sum, a logical sum inverted, a logical product inverted, or an exclusive logical sum of the corresponding bits of the first data and the second data described above. This is a logical sum inversion.
累積加算レジスタ∑R 60は、 図示しないが、 例えば、 外部から与えられる 制御信号などに呼応して ALU 50が出力する nビットデータが書き込まれる。 汎用レジスタファイル 2◦は、 特に制限されないが、 nビット X複数ワード のレジスタ群について 1入力 2出力で構成され、 図示しないが、 例えば、 外部 から与えられる制御信号などで指定されたレジスタへの書き込みと読み出しが 為される。  Although not shown, for example, n-bit data output from the ALU 50 in response to a control signal or the like given from the outside is written in the cumulative addition register $ R60. The general-purpose register file 2 ◦ includes, but is not limited to, one input and two outputs for a register group of n bits × multiple words, not shown, for example, writing to a register designated by an externally applied control signal or the like. Is read.
すなわち、 上記制御信号に呼応して、 RF書込ラインを介して、 シフタ出力 ラツチ 30あるいは ALU出力ラッチ 80から択一的に伝達された nビットデ ータが、 制御信号に含まれる汎用レジスタアドレス 1 (RFA1) で指定され たレジスタに書き込まれる。  That is, in response to the control signal, n-bit data alternatively transmitted from the shifter output latch 30 or the ALU output latch 80 via the RF write line is stored in the general register address 1 included in the control signal. Data is written to the register specified by (RFA1).
また、 汎用レジスタファイル 20の 2つの出力の内、 一方は、 上記制御信号 に含まれる汎用レジスタアドレス 0 (RFA0) で指定されたレジスタのデー タが出力され、 シフタ入力ライン及び ALU入力①ラインに伝達される。 他方 は、 上記汎用レジスタアドレス 1 (RFA1) で指定されたレジスタのデータ が出力され、 ALU入力②ライン及び外部に伝達される。 なお、 汎用レジスタ アドレス 1 (RFA 1) で指定されたレジスタについて、 上記書き込みが為さ れる場合、 上記出力データは書き込み前のデータとなる。 One of the two outputs of the general-purpose register file 20 is the control signal described above. The data of the register specified by the general-purpose register address 0 (RFA0) included in is output and transmitted to the shifter input line and ALU input line. On the other hand, the data of the register specified by the general-purpose register address 1 (RFA1) is output and transmitted to the ALU input ② line and the outside. In addition, when the above write is performed for the register specified by the general-purpose register address 1 (RFA 1), the above output data is the data before the write.
次に、 上記図 1の回路構成例による丸め処理を用いた動作について、 以下例 題で説明する。  Next, the operation using the rounding process according to the circuit configuration example of FIG. 1 will be described with an example below.
まず、 例題として、 汎用レジスタファイル 20に格納された固定小数点位置 が異なる 3つの 2の補数形式の 2進数 A, B, Cを加算し、 汎用レジスタファ ィル 20に格納する場合の動作を説明する。  First, as an example, the operation when three two's complement binary numbers A, B, and C with different fixed-point positions stored in general-purpose register file 20 are added and stored in general-purpose register file 20 will be described. I do.
ここでは、 説明を簡単するため、 データ幅 n = 32ビットとし、 データの固 定小数点位置を、 データ名 (整数ビット数. 小数ビット数) 、 で表すとき、 上 記 3つのデータの固定小数点位置を A (1 0. 22) 、 B (1. 3 1) 、 C (15. 1 7) とし、 加算結果 Xの固定小数点位置を X (16. 16) とする。  Here, for simplicity, the data width n = 32 bits, and the fixed-point position of the data is represented by the data name (number of integer bits; number of decimal bits), where the fixed-point position of the above three data Are A (10.22), B (1.31), and C (15.17), and the fixed-point position of the addition result X is X (16.16).
[処理ステップ 1]  [Processing step 1]
汎用レジスタファイル 20に対して、 A (10. 22) が格納されているァ ドレスを RF AOで指定して A (10. 22) を出力させる。  For the general register file 20, specify the address where A (10.22) is stored by RF AO and output A (10.22).
同時に、 シフタ入力ラインに対して、 汎用レジスタファイル 20を選択し、 シフタに A (10. 22) を伝達する。  At the same time, select general-purpose register file 20 for the shifter input line and transmit A (10.22) to the shifter.
同時に、 シフタ 10に対して、 右 6ビット算術シフト演算を指定する。  At the same time, the right 6-bit arithmetic shift operation is specified for the shifter 10.
以上による制御で、 処理ステップ 1では、 A (10. 22) を右 6ビット算 術シフトしたデータがシフタ出力ラッチ 30に出力され、 同時に切り捨てられ る 6ビットについての丸め評価結果がラッチ r 40に出力される。  With the above control, in processing step 1, the data obtained by arithmetically shifting A (10.22) to the right by 6 bits is output to shifter output latch 30, and the rounding evaluation result for the 6 bits that are truncated at the same time is output to latch r40. Is output.
[処理ステップ 2]  [Processing step 2]
汎用レジスタファイル 20に対して、 B (1. 31) が格納されているアド レスを RF AOで指定して B (1. 3 1) を出力させる。  For the general-purpose register file 20, specify the address where B (1.31) is stored by RF AO and output B (1.31).
同時に、 シフタ入力ラインに対して、 汎用レジスタファイル 20を選択し、 シフタに B (1. 3 1) を伝達する。 At the same time, select general register file 20 for the shifter input line, Transmit B (1.3.1) to the shifter.
同時に、 シフタ 10に対して、 右 15ビット算術シフト演算を指定する。 同時に、 ALU入力①ラインに対して、 シフタ出力ラッチ 30を選択し、 A LU 50の第 1のデータとして処理ステップ 1での Aのシフト結果を伝達する。 同時に、 ALU入力②ラインに対して、 定数 0を選択し、 ALU 50の第 2 のデータを 0とする。  At the same time, the right 15-bit arithmetic shift operation is specified for the shifter 10. At the same time, the shifter output latch 30 is selected for the ALU input line, and the shift result of A in the processing step 1 is transmitted as the first data of the ALU 50. At the same time, a constant 0 is selected for the ALU input ② line, and the second data of the ALU 50 is set to 0.
同時に、 ALU50に対して、 キャリーインをラッチ r 40とするキャリー ィン機能付き符号付き加算演算を指定する。  At the same time, a signed addition operation with a carry-in function that sets the carry-in to latch r40 is specified for ALU50.
同時に、 累積加算レジスタ∑R 60に対して、 書き込みを指定する。  At the same time, write is specified for cumulative addition register No. R60.
以上による制御で、 処理ステップ 2では、 B (1. 31) を右 15ビット算 術シフトしたデータがシフタ出力ラッチ 30に出力され、 同時に切り捨てられ る 15ビットについての丸め評価結果がラッチ r 40に出力される。 また、 A LU50によって、 A (10. 22) を A (16. 1 6) に桁合わせする際の L SB側 6ビットに対する丸め処理がされ、 累積加算レジスタ∑R60に出力 される。  With the above control, in processing step 2, the data obtained by arithmetically shifting B (1.31) to the right by 15 bits is output to shifter output latch 30, and the rounding evaluation result for the 15 bits that are truncated at the same time are stored in latch r40. Is output. The A LU50 rounds the 6 bits on the LSB side when A (10.22) is digit-aligned with A (16.16), and outputs the result to the cumulative addition register No. R60.
[処理ステップ 3]  [Processing step 3]
汎用レジスタファイル 20に対して、 C (15. 1 7) が格納されているァ ドレスを RFA0で指定して C (15. 17) を出力させる。  Specify the address where C (15.17) is stored in general-purpose register file 20 by RFA0 and output C (15.17).
同時に、 シフタ入力ラインに対して、 汎用レジスタファイル 20を選択し、 シフタ 10に C (15. 17) を伝達する。  At the same time, select the general-purpose register file 20 for the shifter input line, and transmit C (15.17) to the shifter 10.
同時に、 シフタ 10に対して、 右 1ビット算術シフト演算を指定する。  At the same time, the right 1-bit arithmetic shift operation is specified for the shifter 10.
同時に、 ALU入力①ラインに対して、 シフタ出力ラッチ 30を選択し、 A LU 50の第 1のデータとして処理ステップ 2での Bのシフト結果を伝達する。 同時に、 ALU入力②ラインに対して、 累積加算レジスタ∑R 0を選択し、 ALU 50の第 2のデータとして処理ステップ 2での Aの丸め処理結果を伝達 する。  At the same time, the shifter output latch 30 is selected for the ALU input line and the result of the shift of B in the processing step 2 is transmitted as the first data of the ALU 50. At the same time, the cumulative addition register # R0 is selected for the ALU input # line, and the rounding result of A in the processing step 2 is transmitted as the second data of the ALU 50.
同時に、 ALU 50に対して、 キャリーインをラッチ r 40とするキャリー ィン機能付き符号付き加算演算を指定する。 同時に、 累積加算レジスタ∑R 60に対して、 書き込みを指定する。 At the same time, for the ALU 50, a signed addition operation with a carry-in function with the carry-in latch r40 is specified. At the same time, write is specified for cumulative addition register No. R60.
以上による制御で、 処理ステップ 3では、 C (15. 1 7) を右 1ビット算 術シフトしたデータがシフタ出力ラッチ 30に出力され、 同時に切り捨てられ る 1ビットについての丸め評価結果がラッチ r 4◦に出力される。 また、 AL U50によって、 B (1. 3 1) を B (16. 16) に桁合わせする際の L S B側 15ビットに対する丸め処理と、 処理ステップ 2で桁合わせされた A (1 6. 16) への加算が同時にされ、 累積加算レジスタ∑R 60に出力される。  With the above control, in processing step 3, the data obtained by arithmetically shifting C (15.17) to the right by one bit is output to shifter output latch 30, and the rounding evaluation result for one bit that is cut off at the same time is latch r4 Output to ◦. Also, the AL U50 rounds the 15 bits on the LSB side when B (1.3.1) is aligned with B (16.16), and A (1 6.16) Are added at the same time and output to the cumulative addition register No.R60.
[処理ステ プ 4]  [Processing Step 4]
ALU入力①ラインに対して、 シフタ出力ラッチ 30を選択し、 ALU 50 の第 1のデータとして処理ステップ 3での Cのシフト結果を伝達する。  The shifter output latch 30 is selected for the ALU input line, and the result of the C shift in the processing step 3 is transmitted as the first data of the ALU 50.
同時に、 ALU入力②ラインに対して、 累積加算レジスタ∑R 60を選択し、 ALU 50の第 2のデータとして処理ステップ 3での Aと Bの丸め ·加算結果 を伝達する。  At the same time, the cumulative addition register R60 is selected for the ALU input line, and the rounding and addition result of A and B in processing step 3 is transmitted as the second data of the ALU 50.
同時に、 ALU50に対して、 キャリーインをラッチ r 40とするキャリー ィン機能付き符号付き加算演算を指定する。  At the same time, a signed addition operation with a carry-in function that sets the carry-in to latch r40 is specified for ALU50.
以上による制御で、 処理ステップ 4では、 ALU 50によって、 C (15. 17) を B (16. 16) に桁合わせする際の L S B側 1ビットに対する丸め 処理と、 処理ステップ 2で桁合わせされた A (1 6. 1 6) と B (1 6. 1 6) の加算結果への加算が同時にされ、 ALU出力ラッチ 80に出力される。  With the control described above, in processing step 4, the ALU 50 rounded the 1 bit on the LSB side when aligning C (15.17) with B (16.16), and performed digit matching in processing step 2. A (1 6. 16) and B (1 6. 16) are added to the addition result at the same time and output to the ALU output latch 80.
[処理ステップ 5]  [Processing step 5]
RF書込ラインに対して、 ALU出力ラッチ 80を選択する。  Select ALU output latch 80 for RF write line.
汎用レジスタファイル 20に対して、 X (16. 16) を格納するァドレス を RFA1で指定して、 書き込みを指定する。  Specify the address for storing X (16.16) in RFA1 for general register file 20, and specify writing.
以上による制御で、 処理ステップ 5では、 A、 B及び Cについて (16. 1 6) に丸め処理を施して桁合わせした加算結果が汎用レジスタファイル 20に 出力され、 目的とされる X (16. 16) を得る。  With the above control, in processing step 5, the addition result obtained by performing rounding on (16.16) for A, B, and C and aligning the digits is output to the general-purpose register file 20, and the target X (16. 16)
以上、 説明したように、 固定小数点位置が異なる複数データの加算について、 データ数に等しい処理ステップとパイプラインのための 2ステツプのオーバへ ッドで処理することができ、 桁合わせで発生する切り捨てビットに対する丸め 処理のための処理ステップを解消することができる。 As described above, for the addition of multiple data with different fixed-point positions, processing steps equal to the number of data and two-step overs for the pipeline The processing steps for rounding off truncated bits generated by digit alignment can be eliminated.
次に、 図 1のシフタ 1 0の詳細な回路構成について説明する。  Next, a detailed circuit configuration of the shifter 10 of FIG. 1 will be described.
図 2は、 図 1のシフタの詳細な回路構成を示すプロック図である。  FIG. 2 is a block diagram showing a detailed circuit configuration of the shifter of FIG.
図 2において、 パレルシフタ 1 0 0は、 シフタ入力ラインの nビッ トデータ について、 制御信号に従ってシフト演算して nビット出力する。  In FIG. 2, a parallel shifter 100 performs a shift operation on n-bit data of a shifter input line according to a control signal and outputs n-bit data.
制御信号の内、 算術シフ ト/論理シフ ト選択信号は、 特に制限されないが、 パレルシフタ 1 0 0に対して 0が算術シフト、 1が論理シフトを指示する。 シフトビット数は、 特に制限されないが、 ± nを 2の補数形式でエンコード した値 (mとする) の信号で、 正が左シフトビット数、 負が右シフトビット数 を指示する。  Among the control signals, the arithmetic shift / logic shift selection signal is not particularly limited, but 0 indicates an arithmetic shift and 1 indicates a logical shift for the parallel shifter 100. The number of shift bits is not particularly limited, but is a signal (± m) in which ± n is encoded in 2's complement format, where positive indicates the number of left shift bits and negative indicates the number of right shift bits.
丸めモード選択信号は、 丸め評価回路 1 1 0に対して丸めモードを指示する 信号で、 特に制限されないが、 2ビットとされ、 B' OO が _∞方向丸め、 B' 01 が +∞方向丸め、 B ' 10 が 0方向丸め、 B ' ll が最近値丸めを指示する。 (ただ し B'は 2進数を表すための接頭詞)  The rounding mode selection signal is a signal that indicates the rounding mode to the rounding evaluation circuit 110, and is not particularly limited, but is 2 bits, B'OO is rounded in the ∞ direction, and B'01 is rounded in the + ∞ direction. , B '10 indicates rounding toward zero, and B' ll indicates rounding to the nearest. (However, B 'is a prefix for representing binary numbers.)
ここで、 _∞方向丸めとは、 真値 (入力データが表す値) より大きくない最 近値 (出力データの固定小数点位置で表現可能な値の内で、 条件を満たした最 も近い値) に丸める方式の丸めモードである。  Here, _∞ direction rounding is the closest value that is not greater than the true value (the value represented by the input data) (the closest value that satisfies the condition among the values that can be expressed in the fixed-point position of the output data) This is a rounding mode of a rounding method.
+∞方向丸めとは、 真値より大きくない最近値に丸める方式の丸めモードで ある。  + ∞ direction rounding is a rounding mode that rounds to the nearest value that is not greater than the true value.
0方向丸めとは、 真値の絶対値より大きくない最近値に丸める方式の丸めモ 一ドである。  Round-to-zero is a rounding mode that rounds to the nearest value not greater than the absolute value of the true value.
最近値丸めとは、 無条件に最近値に丸める方式の丸めモードである。 ただし、 2つの最近値が真値から等距離にある場合、 L S Bカ " 0 " となる最近値に丸 める。  The round-to-nearest mode is a rounding mode that rounds to the nearest value unconditionally. However, if the two nearest values are equidistant from the true value, round to the nearest value that results in LSB "0".
丸め評価回路 1 1 0は、 上記シフトビット数 mの指示が右シフトビッ ト数 (m < 0 ) である場合、 入力データの下位の 1 m I ビット (すなわち切り捨て られるビット) を、 上記シフ ト結果 (パレルシフタ 1 0 0の出力) に丸めるた めに 1加算が必要か否かを、 上記丸めモード選択信号で指示された丸めモード で評価し、 1加算が必要な場合は 1、 不要な場合は 0を示す 1ビットを出力す る。 When the instruction of the number of shift bits m is the number of right shift bits (m <0), the rounding evaluation circuit 110 converts the lower 1 m I bits of the input data (that is, the bits to be truncated) into the above shift result. (Output of parel shifter 100) In the rounding mode specified by the rounding mode selection signal, whether 1 addition is necessary or not is evaluated. If 1 addition is required, 1 bit is output, indicating 1; otherwise, 0 is output.
図 3には、 上記図 2の丸め評価回路 1 1 0における動作の真理値表が示され る。  FIG. 3 shows a truth table of the operation in the rounding evaluation circuit 110 of FIG.
図 3に示す真理値表に基づき、 評価結果としての 1ビット出力信号 Rを、 丸 めモード毎の論理式で表記すれば以下になる。  Based on the truth table shown in FIG. 3, the 1-bit output signal R as the evaluation result is expressed by the following logical expression for each rounding mode.
①ー∞方向丸め: R = 0  ①-∞ Rounding: R = 0
② +∞方向丸め: R = (切り捨てられるビットの論理和)  ② Rounding in the + ∞ direction: R = (logical sum of truncated bits)
= (入力データの第 i m I _ 1ビット 〜 第 0ビットの論理和) = (OR of input data bit i m I _ 1 to bit 0)
③ 0方向丸め: R = (入力データが負) n (切り捨てられるビッ トの論理和) ③ Rounding in the 0 direction: R = (input data is negative) n (OR of bits to be truncated)
= (入力データの M S B ) Π (入力データの第 I m I _ 1ビッ ト 〜 第 0ビ ットの論理和) = (MSB of input data) Π (logical sum of 1st bit to 0th bit of input data)
④最近値丸め: R = (切り捨てられるデータの内の最上位ビット)  ④ Round-to-nearest: R = (most significant bit of truncated data)
n { ( (切り捨てられるデータの内の最上位を除くビット) u (出力データ の L S Bとなるビット) } n {((bits excluding the most significant bits of the data to be truncated) u (bits to be the LSB of output data)}
= (入力データの第 I m I— 1ビット) Π { (第 I m I— 2ビッ ト〜第 0ビッ トの論理和) U (入力データの第 I m I ビット) }  = (Im I bit of input data-1 bit) Π {(I m I-OR of bit 2 to 0 bit) U (I m I bit of input data)}
ここで、 上記論理式において、 「u」 は論理和、 「n」 は論理積を意味する c また、 「第 iビット」 は入力データの L S Bを 0、 M S Bを n _ 1として各ビ ットに 0から n— 1まで連続する整数で番号付けたときに番号 i となる位置の ビットを示す。 Here, in the above logical expression, “u” means a logical sum, “n” means a logical product c , and “i-th bit” indicates that the LSB of the input data is 0, and the MSB is n_1, and each bit is Indicates the bit at the position that becomes number i when numbered consecutively from 0 to n-1.
以上、 図 2〜 3で説明したように、 シフタ 1 0に丸め機能を設けたことによ りシフタプロックに追加される端子は、 丸めモード選択信号と評価結果として の 1ビット出力信号だけですみ、 これにより、 例えば、 半導体基板上に回路を プロック分割して実装する場合のプロック間配線を最小限にすることができる c さらに、 丸めモードの複数に対応したとしても、 上記論理式における (第 1 m I 一 2ビット〜第 0ビットの論理和) などの論理の共通化ができるので、 実装 面積の増大を抑えることができるという効果がある。 As described above with reference to Figs. 2 and 3, only the rounding mode selection signal and the 1-bit output signal as the evaluation result need to be added to the shifter block due to the rounding function provided in shifter 10. Thereby, for example, it is possible to minimize the wiring between blocks when the circuit is divided into blocks on the semiconductor substrate and mounted. C Further, even if a plurality of rounding modes are supported, Since the logic such as 1m I1 2nd bit to the 0th bit (OR) can be shared, implementation There is an effect that an increase in area can be suppressed.
次に、 図 1の回路構成を含んで構成されるプロセッサの複数と、 これらのプ 口セッサを制御する 1つの制御ュニットとで構成される S I MD型の並列 D S Pの構成について説明する。  Next, a description will be given of a configuration of an SIMD type parallel DSP composed of a plurality of processors including the circuit configuration of FIG. 1 and one control unit for controlling these processors.
図 4は、 図 1の回路構成を含んだ S I MD型の並列 D S Pの構成を示す図で あり、 例えば半導体基板上に構成される。  FIG. 4 is a diagram showing a configuration of a SIMD parallel DSP including the circuit configuration of FIG. 1, and is configured on, for example, a semiconductor substrate.
図 4において、 制御ユニット 2 0 0は、 特に制限されないが、 プログラムメ モリ 2 1 0を含んだプログラム実行制御部 2 2 0と、 データメモリ 2 3 0を含 んだデータ制御部 2 4 0とを含んで構成される。  In FIG. 4, the control unit 200 includes, but is not limited to, a program execution control unit 220 including a program memory 210 and a data control unit 240 including a data memory 230. It is comprised including.
これらのプログラムメモリ 2 1 0及びデータメモリ 2 3 0には、 外部からの データの入出力が可能であり、 外部から設定された計算手順 (計算ァルゴリズ ム) に従った情報処理が可能である。  The program memory 210 and the data memory 230 can input and output data from outside, and can perform information processing according to a calculation procedure (calculation algorithm) set from outside.
プロセッサアレイ 2 5 0は、 同一構成のプロセッサ 2 6 0の複数で構成され、 全プロセッサ 2 6 0は、 命令パス、 ブロードキャストデータバス、 及びトライ ステートバッファを介した共通データパスで制御ュニット 2 0 0に接続される c また、 各プロセッサ 2 6 0には、 各プロセッサ 2 6 0に対応して設けられた トライステートバッファの制御と共通のプロセッサ選択信号が入力され、 制御 ュニット 2 0 0によって常に唯一のプロセッサ 2 6 0が選択される。 The processor array 250 is composed of a plurality of identically configured processors 260, and all processors 260 are controlled by a common data path via an instruction path, a broadcast data bus, and a tri-state buffer. c is also connected to, each processor 2 6 0, common processor selection signals and control of the tri-state buffers provided corresponding to each processor 2 6 0 is input, always only by controlling Yunitto 2 0 0 Processor 260 is selected.
プロセッサ 2 6 0は、 プロセッサ制御部 2 7 0とデータ演算実行部 2 8 0を 含んで構成される。  The processor 260 includes a processor control unit 270 and a data operation execution unit 280.
データ演算実行部 2 8 0は、 例えば、 図 1記載の回路構成とすることができ る。  The data operation execution unit 280 can have, for example, the circuit configuration shown in FIG.
プロセッサ制御部 2 7 0は、 制御ュニット 2 0 0から命令パスを介して与え られる命令に基づき、 データ演算実行部を制御する。  The processor control unit 270 controls the data calculation execution unit based on an instruction given from the control unit 200 via an instruction path.
制御ュニット 2 0 0内のプログラム実行制御部 2 2 0が処理ステップに同期 して出力する命令は、 例えば、 V L I W (V e r y L o n g I n s t r u c t i o n W o r d ) 方式とされ、 各部の動作が水平に制御される。 すなわ ち、 制御ュニット 2 0 0が出力する各ステップの命令には各部に対応したフィ ールドが設けられ、 1ステップで複数の機能プロックを水平に制御することが できる。 The instruction output by the program execution control unit 220 in the control unit 200 in synchronization with the processing step is, for example, VLIW (Very Long Instruction WORD), and the operation of each unit is controlled horizontally. Is done. In other words, the instructions of each step output by the control unit 200 include the file corresponding to each section. A plurality of function blocks can be controlled horizontally in one step.
上記命令の内、 プロセッサ 2 6 0に対する命令 (プロセッサ命令フィール ド) は、 命令パスを介して全プロセッサ 2 6 0に伝達される。 すなわち、 制御 ユニット 2 0 0は、 全プロセッサ 2 6 0を同一の命令で制御する。  Among the above instructions, an instruction to the processor 260 (processor instruction field) is transmitted to all the processors 260 via the instruction path. That is, the control unit 200 controls all the processors 260 with the same instruction.
プロセッサ 2 6 0に伝達された上記プロセッサ命令フィールドは、 プロセッ サ 2 6 0内のプロセッサ制御部 2 7 0に伝達される。  The processor instruction field transmitted to the processor 260 is transmitted to the processor controller 270 in the processor 260.
プロセッサ制御部 2 7 0は、 上記伝達されたプロセッサ命令フィールドの内、 プロセッサ制御部 2 7 0に対する命令 (プロセッサ制御部命令フィールド) に 従って動作し、 データ演算実行部 2 8 0に対する命令 (データ演算実行部命令 フィールド) をデータ演算実行部 2 8 0に伝達する。  The processor control unit 270 operates in accordance with the instruction (processor control unit instruction field) for the processor control unit 270 in the transmitted processor instruction field, and executes the instruction (data operation) for the data operation execution unit 280. (Execution section instruction field) to the data operation execution section 280.
このとき、 プロセッサ制御部 2 7 0は、 プロセッサ制御部命令フィールド内 の命令でァドレスマスク実行指示がある場合には、 データ演算実行部命令フィ ールドの内の全ての書き込み命令をプロセッサ選択信号のネゲートでマスクし て、 データ演算実行部 2 8 0に伝達する。 これによつて、 プロセッサ 2 6 0の 1つを選択して動作させることが可能であり、 例えば、 データ演算実行部 2 8 〇内の汎用レジスタファイル 2 0に対して、 各プロセッサ固有のデータを設定 することができる。  At this time, if there is an address mask execution instruction in the instruction in the processor control unit instruction field, the processor control unit 270 negates all the write instructions in the data operation execution unit instruction field to the processor selection signal. Then, it is transmitted to the data operation execution unit 280. This makes it possible to select and operate one of the processors 260. For example, data specific to each processor is stored in the general-purpose register file 20 in the data operation execution unit 28 #. Can be set.
また、 プロセッサ制御部 2 7 0には、 データ演算実行部 2 8 0よりコンディ シヨンコード信号 (C C ) が入力される。 プロセッサ制御部 2 7 0は、 プロセ ッサ制御部命令フィールド内の命令でグループマスク実行指示がある場合には、 データ演算実行部命令フィールドの内の全ての書き込み命令を、 指定されたコ ンディションコード信号でマスクして、 データ演算実行部 2 8 0に伝達する。 このコンディションコード信号は、 特に制限されないが、 データ演算実行部 2 8 0の演算状態を示す信号であり、 図 1における A L U 5 0からラッチ C O 7 0を介して出力される桁上がり (キャリーアウト) 信号であり、 さらに、 図 1の図示しないが、 上記桁上がり信号と同様に A L U 5 0からラッチ 8 0を介 して出力される符号 (データの M S B ) 信号、 零 (演算結果が 0であるときァ サートされる) 信号、 及びオーバフロー (M S Bの桁上がり信号と M S B— 1 ビットの桁上がり信号の排他的論理和) 信号である。 The processor control unit 270 receives a condition code signal (CC) from the data operation execution unit 280. If there is a group mask execution instruction in the instruction in the processor control section instruction field, the processor control section 270 executes all the write instructions in the data operation execution section instruction field with the designated condition code. The signal is masked and transmitted to the data operation execution unit 280. This condition code signal is, although not particularly limited, a signal indicating the operation state of the data operation execution unit 280, and a carry (carry-out) output from the ALU 50 in FIG. 1 via the latch CO 70. Although not shown in FIG. 1, a sign (MSB of data) signal output from the ALU 50 via the latch 80 and a zero (the operation result is 0) When Asserted) and overflow (MSB carry signal and MSB—exclusive OR of 1-bit carry signal).
これによつて、 プロセッサ 2 6 0の内部状態に応じた動作が可能であり、 例 えば演算結果が負であったプロセッサ 2 6 0のみグループマスクして、 このデ ータを 0からの減算で符号反転することにより絶対値をとるといつた条件実行 が可能である。  This makes it possible to operate in accordance with the internal state of the processor 260. For example, only the processor 260 whose operation result is negative is group-masked, and this data is subtracted from 0. When the absolute value is obtained by inverting the sign, it is possible to execute the condition any time.
プロセッサ 2 6 0内のデータ演算実行部 2 8 0に伝達されるデータ演算実行 部命令フィールドには、 シフタ 1 0に対するシフタ命令フィールド、 A L U 5 0に対する A L U命令フィールド及び汎用レジスタファイル 2 0に対する汎用 レジスタファイル命令フィ一ルドがぁり、 図 1記載の回路構成の各機能ブロッ クを制御して、 上記処理ステツプ 1〜 5に例示した丸め処理を実現することが できる。  The data operation execution unit instruction field transmitted to the data operation execution unit 280 in the processor 260 includes a shifter instruction field for the shifter 10, an ALU instruction field for the ALU 50, and a general-purpose register for the general-purpose register file 20. The file instruction field is completed, and the function blocks of the circuit configuration shown in FIG. 1 are controlled, so that the rounding processes exemplified in the above processing steps 1 to 5 can be realized.
ここで、 図 2に記載したシフタ内の丸め評価回路に対する丸めモード選択信 号は、 上記プロセッサ制御部 2 7 0に設けられた丸めモード選択レジスタ R M R 2 9 0によって制御される。 この丸めモード選択レジスタ RMR 2 9 0には、 上記プロセッサ制御部命令フィールド内の命令で R M R書き込み指示がある場 合に、 ブロードキャストデータパスのデータが書き込まれる。  Here, the rounding mode selection signal for the rounding evaluation circuit in the shifter shown in FIG. 2 is controlled by a rounding mode selection register R M R 290 provided in the processor control unit 270. The data of the broadcast data path is written into the rounding mode selection register RMR290 when there is an RMR write instruction by an instruction in the processor control unit instruction field.
このとき、 特に制限されないが、 図 2〜 3記載の丸めモード選択信号は 2ビ ットのため丸めモード選択レジスタ RMR 2 9 0は 2ビッ ト構成とされ、 ブロ ードキャストデータパスから入力する n (例えば 3 2 ) ビットデータの下位 2 ビッ卜が書き込まれる。  At this time, although not particularly limited, since the rounding mode selection signal shown in FIGS. 2 and 3 is 2 bits, the rounding mode selection register RMR290 has a 2-bit configuration and is inputted from the broadcast data path. The lower 2 bits of n (for example, 32) bit data are written.
丸めモードは各処理ステップ毎に変更する用途が少ないため、 命令パスに丸 めモード選択のためのフィールドを設ける必要がなく、 上記丸めモード選択レ ジスタ RMR 2 9 0によるレジスタ設定とすることができ、 これによつて、 命 令パス幅の増大を低減する効果を得る。  Since the rounding mode has few applications to be changed for each processing step, there is no need to provide a field for selecting the rounding mode in the instruction path, and the register can be set by the above-mentioned rounding mode selection register RMR290. This has the effect of reducing the increase in instruction path width.
上記プロセッサ 2 6 0の演算結果の外部への取り出しは、 上記プロセッサ選 択信号で所望のプロセッサ 2 6 0を選択することによって、 該プロセッサ 2 6 0のトライステートバッファ 3 0 0がドライブ状態となりデータ共通データパ スを介して制御ュニットに出力されることで為される。 The operation result of the processor 260 is taken out to the outside by selecting a desired processor 260 by the processor selection signal, and the tri-state buffer 300 of the processor 260 becomes a drive state and the data is output. Common data path Output to the control unit via the
以上説明したように、 図 4記載の S I MD型並列 D S Pの半導体装置におい て、 1つの制御系から出力される単一の命令とデータについて複数のプロセッ サ 2 6 0が内に持つ固有データとの演算を並列に処理していくことによって、 加減算を基本とする並列アルゴリズムを適切な丸め処理による演算で高速に処 理することが可能となる。  As described above, in the semiconductor device of the SI MD type parallel DSP shown in FIG. 4, for a single instruction and data output from one control system, the unique data held by a plurality of processors 260 By performing these operations in parallel, a parallel algorithm based on addition and subtraction can be processed at high speed by an operation by appropriate rounding.
以上説明した実施の形態では、 本発明の丸め処理に焦点を絞って説明したが、 利用目的に応じて、 種々変更可能であることは言うまでもない。  In the embodiment described above, the rounding processing of the present invention has been focused on, but it is needless to say that various changes can be made according to the purpose of use.
例えば、 上記した S I MD型並列 D S Pの各プロセッサにおいて、 シフ ト演 算のシフ トビット数を指定する記憶手段を追加することによって、 各プロセッ サ固有のデータとすることができる。  For example, in each processor of the SMD-type parallel DSP described above, data unique to each processor can be obtained by adding storage means for specifying the number of shift bits of the shift operation.
図 5には、 上記図 2〜 3で説明した本発明によるシフタに、 上記シフ トビッ ト数を指定する記憶手段を追加する場合の実施例が示される。  FIG. 5 shows an embodiment in which storage means for designating the number of shift bits is added to the shifter according to the present invention described in FIGS.
図 5において、 上記記憶手段としてシフトビットレジスタ S B R 4 0 0は、 図 2記載のシフタにおけるシフ トビット数を表現するのに必要なビット数 (例 えば n = 3 2とするとき 6ビッ ト) で構成され、 上記データ演算実行部命令フ ィールド内に追加した書き込み指示に呼応してデータが設定される。  In FIG. 5, the shift bit register SBR 400 as the storage means has the number of bits required to express the number of shift bits in the shifter shown in FIG. 2 (for example, 6 bits when n = 32). The data is set in response to a write instruction added in the data operation execution unit instruction field.
シフトビットレジスタ S B R 4 0 0に書き込むデータは、 特に制限されない が A L U 5 0の出力データがオーバフロー処理回路 4 1 0を介して伝達された データである。 オーバフロー処理回路 4 1 0は、 A L U 5 0の出力である nビ ットデータを 2の補数形式の 2進整数として入力し、 シフ トビットレジスタ S B R 4 0 0の構成ビット数の 2の補数形式の 2進整数に上位ビットを丸めて出 力する。  The data to be written to the shift bit register SBR 400 is not particularly limited, but is the data transmitted from the ALU 50 via the overflow processing circuit 410. The overflow processing circuit 410 inputs the n-bit data output from the ALU 50 as a 2's complement binary integer, and outputs the 2's complement 2 bits of the number of bits constituting the shift bit register SBR 400. Rounds the high-order bit to a decimal integer and outputs.
すなわち、 シフトビットレジスタ S B R 4 0 0の構成ビット数を 6ビットと したとき、 A L U 5 0の出力が一 3 1〜3 1の場合はその値を出力するが、 A L U 5 0の出力が 3 2以上の場合 (正のオーバフロー) には 3 1を出力し、 A L U 5 0の出力が一 3 2以下の場合 (負のオーバフロー) には一 3 1を出力す る。 また、 シフタ 1 0へのシフトビット数の出力は、 上記データ演算実行部命令 フィールド内の命令と、 上記シフトビッ トレジスタ S B R 4 0 0とから、 セレ クタ 4 2 0によって選択される。 このセレクタ 4 2 0の制御は、 特に制限され ないが、'例えば、 上記データ演算実行部命令フィールド内の命令で指定された シフトビット数が負の最大値 (シフトビット数が 6ビットの場合は一 3 2 ) で あるとき、 S B R出力を選択し、 その他の場合は上記データ演算実行部命令フ ィールド内の命令で指定されるシフトビット数を選択するように、 データのコ ンペア回路 4 3◦で為され、 コンペァ回路 3 0の出力の 「0」 、 「1」 により 切替が行われる。 That is, when the number of configuration bits of the shift bit register SBR 400 is set to 6 bits, if the output of the ALU 50 is one of 31 to 31, the value is output, but the output of the ALU 50 is 3 2 In the above cases (positive overflow), 31 is output, and when the output of ALU 50 is less than 132 (negative overflow), 131 is output. The output of the number of shift bits to the shifter 10 is selected by the selector 420 from the instruction in the instruction field of the data operation execution section and the shift bit register SBR 400. Although the control of the selector 420 is not particularly limited, for example, the maximum shift number specified by the instruction in the instruction field of the data operation execution section is a negative maximum value (when the shift bit number is 6 bits, 1 3 2), select the SBR output, otherwise select the number of shift bits specified by the instruction in the instruction field in the data execution unit instruction field. The switching is performed by “0” and “1” of the output of the comparator circuit 30.
上記説明した実施の形態について、 画像処理やニューラルネットワークなど の並列アルゴリズムを高速処理するためには、 上記プロセッサに、 積和演算を 高速処理するための乗算器、 及びプロセッサ固有のデータをより多く分散配置 させるためのローカルメモリを設ければよい。  In the embodiment described above, in order to process parallel algorithms such as image processing and neural networks at high speed, a multiplier for performing high-speed product-sum operations and more processor-specific data are distributed to the processor. What is necessary is just to provide the local memory for arrangement.
図 6には、 図 4におけるプロセッサ内のデータ演算実行部の別の回路構成例 として、 図 1に記載した回路構成に乗算器及びローカルメモリ L Mを追加した 回路構成が示される。  FIG. 6 shows a circuit configuration in which a multiplier and a local memory LM are added to the circuit configuration shown in FIG. 1 as another circuit configuration example of the data operation execution unit in the processor in FIG.
図 6において、 乗算器 5 0 0は、 乗算器入力①ラインを介して、 シフタ出力 ラッチ 3 0、 汎用レジスタファイル 2 0または外部から択一的に伝達される第 1の nビットデータと、 乗算器入力②ラインを介して、 汎用レジスタファイル 2 0またはローカルメモリ L M 5 1 0の出力ラッチ 5 2 0から択一的に伝達さ れた第 2の nビットデータとについて、 乗算し、 結果の 2 nビット (11が3 2 のとき 6 4ビット) データを乗算器出力ラッチ 5 3◦に伝達する。 ここで、 乗 算器入力①ライン及び乗算器入力②ラインでのデータの選択は、 図示しないが、 例えば、 外部から与えられる制御信号などで為される。  In FIG. 6, a multiplier 500 is provided with a shifter output latch 30 via a multiplier input line 、, a general-purpose register file 20 or first n-bit data which is selectively transmitted from outside, and a multiplier. Multiplied by the second n-bit data transmitted from the general-purpose register file 20 or the output latch 520 of the local memory LM510 via the input-input line, and multiplied by 2 Transmits n bits (64 bits when 11 is 3 2) data to multiplier output latch 53 °. Here, the selection of data at the multiplier input line and the multiplier input line is not shown, but is made by, for example, a control signal given from the outside.
乗算器出力ラッチ 5 3 0の出力は、 シフタ入力ラインに伝達される。  The output of the multiplier output latch 530 is transmitted to the shifter input line.
ローカルメモリ L M 5 1 0は、 nビッ ト X複数ヮードの R AM (R a n d o m A c c e s s M e m o r y ) で構成され、 図示しないが、 例えば、 外部 から与えられる制御信号などに呼応して、 シフタ出力ラッチ 3 0、 A L U出力 ラッチ 80または外部から択一的に伝達された nビットデータについて、 LM ァドレス制御部 540内のローカルメモリポィンタレジスタ LMP R 550か ら伝達されるァドレスに書き込む。 'または、 該ァドレスに格納されているデー タを後段のローカルメモリ出力ラッチ 520に読み出す。 The local memory LM510 is composed of an n-bit × multiple-mode RAM (Random Access Memory). Although not shown, for example, a shifter output latch is provided in response to an externally applied control signal or the like. 30, ALU output The n-bit data selectively transmitted from the latch 80 or the outside is written into the address transmitted from the local memory pointer register LMP R 550 in the LM address control unit 540. 'Alternatively, the data stored in the address is read out to the local memory output latch 520 at the subsequent stage.
ローカルメモリ出力ラッチ 520の出力は、 乗算器入力②ライン、 シフタ入 力ライン及び ALU入力②ラインに伝達される。  The output of the local memory output latch 520 is transmitted to the multiplier input line, the shifter input line and the ALU input line.
LMァドレス制御部 540は、 ローカルメモリ LM510の書き込み Z読み 出しァドレス出力するローカルメモリポインタレジスタ LMPR 550を含み、 図示しないが、 例えば、 外部から与えられる制御信号などに従って、 ロー力ノレ メモリポインタレジスタ LMPR 550のインク リメント、 デイクリメント、 あるいは ALU出力ラッチ 80から伝達されたデータの書き込みを行う。  The LM address controller 540 includes a local memory pointer register LMPR 550 that outputs a write Z read address of the local memory LM 510. Increment, decrement, or write the data transmitted from the ALU output latch 80.
ローカルメモリポインタレジスタ L MP R 550の出力は、 ローカルメモリ LM510へのァドレスの他に、 RF書込ラインに伝達され汎用レジスタファ ィル 20への退避や、 ALU 50による演算が可能となる。  The output of the local memory pointer register LMPR550 is transmitted to the RF write line in addition to the address to the local memory LM510, and can be saved to the general-purpose register file 20 and operated by the ALU 50.
上記、 乗算器 500、 ローカルメモリ LM510、 及び LMア ドレス制御部 540の追加により、 図 1に記載した機能ブロックの変更点は、 乗算器 500 の出力データ幅に対応して、 シフタ 600の入力データ幅が増加したことであ る。  With the addition of the multiplier 500, the local memory LM510, and the LM address control unit 540, the functional blocks described in FIG. 1 are changed in accordance with the output data width of the multiplier 500 and the input data of the shifter 600. The width has increased.
シフタ入力ラインのデータ幅の 2 nビットについて、 上記制御信号で選択さ れたデータが汎用レジスタファイル 20、 外部またはローカルメモリ出力ラッ チ 520の nビットデータの場合には、 シフタ入力ラインの MS B側 nビット に伝達され、 このとき、 シフタ入力ラインの L S B側の nビットは 0となる。 図 7には、 図 6のシフタの詳細な回路構成を示すプロック図が示される。 図 7において、 パレルシフタ 6 10は、 2 nビットの入力データの MS Bを 基準として、 図 2に記載のパレルシフタ 100と同様のシフト演算を行い、 n ビット出力する。 図 2で説明したパレルシフタ 100との相違点は、 左シフト において、 オーバフローが発生しない場合、 L S B側シフ トビット数の出力が、 図 2では 0であるのに対して、 図 7のパレルシフタ 610では入力データの下 位 nビットデータの内の上位ビットとした点である。 If the data selected by the above control signal is n-bit data of general-purpose register file 20 or external or local memory output latch 520 for 2 n bits of the data width of the shifter input line, the MSB of the shifter input line The n bits on the LSB side of the shifter input line become 0 at this time. FIG. 7 is a block diagram showing a detailed circuit configuration of the shifter of FIG. In FIG. 7, the parallel shifter 610 performs the same shift operation as the parallel shifter 100 shown in FIG. 2 on the basis of the MSB of the input data of 2 n bits, and outputs n bits. The difference from the parallel shifter 100 described with reference to FIG. 2 is that when overflow does not occur in the left shift, the output of the number of LSB shift bits is 0 in FIG. 2 while the output of the parallel shifter 610 in FIG. Below the data This is the upper bit of n-bit data.
図 8には、 図 7に記載の丸め評価回路における動作の真理値表が示される。 図 7の上記説明したパレルシフタ 610は、 入力の 2 nビットデータについて MS Bを基準にしてシフトして nビットを出力するため、 左ビット (0ビット シフトを含む) でも切り捨てビットが発生する。 これに対応して、 図 7におけ る丸め評価回路 620は、 図 2における丸め評価回路 1 10の動作に対して、 シフト演算のシフト方向によらず (すなわち常に) 、 2 nビット入力データの 内の切り捨てビットを評価する点が異なる。  FIG. 8 shows a truth table of the operation in the rounding evaluation circuit shown in FIG. Since the above-described parallel shifter 610 of FIG. 7 shifts the input 2 n-bit data with reference to the MSB and outputs n bits, a truncated bit is generated even in the left bit (including 0-bit shift). Correspondingly, the rounding evaluation circuit 620 in FIG. 7 is different from the operation of the rounding evaluation circuit 110 in FIG. 2 in that the 2 n-bit input data is independent of the shift direction of the shift operation (ie, always). The difference is that the truncated bits in are evaluated.
以上により、 画像処理あるいはニューラルネットワークなどの並列アルゴリ ズムを、 1つの制御系と複数のプロセッサで構成される S IMD型並列 DS P で高速に処理する情報処理装置に、 比較的小規模の回路追加で処理ステップの 増加なく丸め処理機能を組み込むことができ、 このことが、 固定小数点演算器 を用いた情報処理装置の数値演算精度を効率的に向上するという本発明の目的 を達成する。  As described above, a relatively small-scale circuit was added to an information processing device that can process parallel algorithms such as image processing or neural networks at high speeds with an SIMD-type parallel DSP composed of one control system and multiple processors. Thus, the rounding function can be incorporated without increasing the number of processing steps, and this achieves the object of the present invention of efficiently improving the numerical calculation accuracy of an information processing device using a fixed-point arithmetic unit.
図 9には、 従来のデータ処理装置に本発明の丸め処理を適用した構成が示さ れる。  FIG. 9 shows a configuration in which the rounding process of the present invention is applied to a conventional data processing device.
図 9において、 データ処理装置を構成するプロセッサは、 演算ュュット 1 1、 ローカルメモリュニッ ト 12、 及びトライステートバッファ 1 3とを含む。 演算ュニット 1 1は、 本実施の形態の丸めモード選択レジスタ RMR 290 を含むプロセッサ制御回路 1 101、 ラッチ回路 1 102, 1 105, 1 10 7, 1 1 12, 11 14、 汎用レジスタファイル 1 103、 乗算来 1 104、 本実施の形態の COレジスタ 70を含むコンディションコードレジスタ (C C R) 1 106、 累積レジスタ 1 108、 本実施の形態の ALU (算術論理演算 ユニット) 50及びセレクタ 90、 SBR (シフトビットレジスタ) 1 1 10、 本実施の形態のシフタ 10及びタツチ r 40、 差分絶対値演算器 1 1 13を含 む。  In FIG. 9, the processor constituting the data processing device includes an arithmetic unit 11, a local memory unit 12, and a tristate buffer 13. The operation unit 11 includes a processor control circuit 1101, including the rounding mode selection register RMR290 of the present embodiment, a latch circuit 1102, 1105, 1107, 1112, 1114, a general register file 1103, Multiplier 1104, Condition code register (CCR) 1106 including CO register 70 of this embodiment, Accumulation register 1108, ALU (arithmetic logic unit) 50 of this embodiment, selector 90, SBR (shift bit) Register) 110, the shifter 10 and the touch r40 of the present embodiment, and the absolute difference calculator 113.
ローカルメモリユニット 12は、 ローカルメモリ (LM0, LM1) 120 2, 1204、 ローカルメモリ 1202のアドレス信号を生成するためのアド レス演算回路 1201、 ローカルメモリ 1204のァドレス信号を生成するた めのアドレス演算回路 1203、 セレクタ 1205, 1206, 1207, 1 208, 1209を含む。 The local memory unit 12 has addresses for generating address signals of the local memories (LM0, LM1) 1202, 1204, and the local memory 1202. Address operation circuit 1203 for generating an address signal for the local memory 1204, and selectors 1205, 1206, 1207, 1208, and 1209.
また、 図 9に示すデータ処理装置の動作は、 シフタ 10、 ラッチ r 40、 A LU (算術論理演算ユニット) 50、 及びセレクタ 90は、 本実施の形態で説 明した動作をし、 その他の動作については、 特願 2003 _ 23076号に示 されるデータ処理装置の動作と同様である。  The operation of the data processing device shown in FIG. 9 is as follows. The shifter 10, the latch r40, the ALU (arithmetic logic unit) 50, and the selector 90 perform the operations described in the present embodiment. Is the same as the operation of the data processing device described in Japanese Patent Application No. 2003_23076.
以上、 本発明者によってなされた発明をその実施の形態に基づき具体的に説 明したが、 本発明は前記実施の形態に限定されるものではなく、 その要旨を逸 脱しない範囲で種々変更可能であることはいうまでもない。  Although the invention made by the inventor has been specifically described based on the embodiment, the invention is not limited to the embodiment and can be variously modified without departing from the gist of the invention. Needless to say,
本願発明によって開示される発明のうち、 代表的なものによって得られる効 果を簡単に説明すれば、 以下の通りである。  The effects obtained by typical aspects of the invention disclosed by the present invention will be briefly described as follows.
シフタに丸め評価機能を設けたことによりシフタプロックに追加される端子 は、 丸めモード選択信号と評価結果としての 1ビット出力信号だけですみ、 効 率的な回路構成で丸め処理のオーバヘッド低減できるので、 固定小数点演算器 を用いた情報処理装置の数値演算精度が効率的に向上する。 産業上の利用可能性  The addition of the rounder evaluation function to the shifter block requires only the rounding mode selection signal and the 1-bit output signal as the evaluation result, and the overhead of the rounding process can be reduced with an efficient circuit configuration. The numerical calculation accuracy of the information processing device using the fixed-point arithmetic unit is efficiently improved. Industrial applicability
1個プロセッサ、 すなわち一般的な D S Pに適用することができ、 S IMD 型並列 DS Pをはじめとする DS Pを搭載した半導体装置に応用することがで きる。  The present invention can be applied to a single processor, that is, a general DSP, and can be applied to a semiconductor device equipped with a DSP such as an SIMD type parallel DSP.
また、 浮動小数点演算を処理するための回路構成に応用することができる。 さらには、 SHマイコンに代表される CPUの演算実行部 (E X e c u t i o n Un i t ) に適用することもできる。  Further, it can be applied to a circuit configuration for processing a floating-point operation. Furthermore, the present invention can also be applied to an arithmetic execution unit (EXEcut iount Unit) of a CPU represented by an SH microcomputer.
その他、 丸め処理が必要なデジタル信号処理装置全般にも適用することもで きる。  In addition, the present invention can be applied to all digital signal processing devices that require rounding.

Claims

請 求 の 範 囲 The scope of the claims
1 . 右ビットシフト演算機能を有するシフタと、 2つの入力データの加算に、 最下位ビットに 1ビットデータを加算するキヤリーィン機能を有する A L Uと を含んで構成されたプロセッサと、  1. A processor including a shifter having a right bit shift operation function, and an ALU having a carry-in function of adding 1-bit data to the least significant bit in addition of two input data,
前記プロセッサを単一命令で制御する制御ユエットとで構成されるデータ処 理装置であって、  A control unit for controlling said processor with a single instruction, comprising:
上記シフタは、 シフト演算結果のデータを出力すると同時に、 右ビットシフ トの場合に切り捨てられるビットについて丸め評価をしてシフト演算結果の最 下位ビットに " 1 " 加算が必要か否かを示す 1ビットデータを出力する丸め評 価手段を有し、  The shifter outputs the data of the shift operation result, and at the same time, performs rounding evaluation on the bits rounded down in the case of right bit shift, and 1 bit indicating whether addition of "1" is necessary to the least significant bit of the shift operation result It has a rounding evaluation means for outputting data,
上記 A L Uは、 2入力データの内の一方を上記シフタの出力データとし、 上 記キヤリーィン機能で用いるデータを上記シフタの丸め評価手段が出力する 1 ビットデータとすることを特徴とするデータ処理装置。  A data processing device wherein the ALU is one of two input data as output data of the shifter, and the data used in the carry-in function is 1-bit data output by the rounding evaluation means of the shifter.
2 . 上記シフタにおける右シフト演算及び上記 A L Uにおけるキヤリーィン機 能の加算は、 2の補数形式のデータに対応した演算であることを特徴とする請 求項 1記載のデータ処理装置。  2. The data processing device according to claim 1, wherein the right shift operation in the shifter and the addition of the carry-in function in the ALU are operations corresponding to two's complement data.
3 . 丸めモード選択手段を有し、 上記丸め評価手段は、 該丸めモード選択手段 で選択可能な複数の丸めモードの個々に対応した丸め評価を行うことを特徴と する請求項 1または 2記載のデータ処理装置。  3. The method according to claim 1, further comprising a rounding mode selection unit, wherein the rounding evaluation unit performs rounding evaluation corresponding to each of a plurality of rounding modes selectable by the rounding mode selection unit. Data processing device.
4 . 上記プロセッサは複数からなり、 上記丸めモード選択手段は、 上記複数の プロセッサの個々に設けられたデータ記憶手段によって丸めモードを選択する ことを特徴とする請求項 1乃至 3の何れか 1項に記載のデータ処理装置。 4. The processor according to any one of claims 1 to 3, wherein the processor comprises a plurality of processors, and the rounding mode selecting means selects a rounding mode by data storage means provided individually for the plurality of processors. A data processing device according to claim 1.
5 . 上記丸め評価は、 上記右ビッ トシフトで切り捨てられるビッ トの論理和で あることを特徴とする請求項 1乃至 4の何れか 1項に記載のデータ処理装置。 5. The data processing device according to claim 1, wherein the rounding evaluation is a logical sum of bits rounded down by the right bit shift.
6 . 上記丸め評価は、 上記右ビットシフトで切り捨てられるビットの論理和と、 シフト演算データの符号との論理積であることを特徴とする請求項 2乃至 4の 何れか 1項に記載のデータ処理装置。 6. The data according to any one of claims 2 to 4, wherein the rounding evaluation is a logical product of a logical sum of bits rounded down by the right bit shift and a sign of shift operation data. Processing equipment.
7 . 上記丸め評価は、 上記右ビットシフトで切り捨てられるビットの内の最上 位ビットを除くビットとシフト演算結果の最下位ビットとの論理和と、 上記右 ビットシフトで切り捨てられるビットの内の最上位ビットとの論理積であるこ とを特徴とする請求項 1乃至 4の何れか 1項に記載のデータ処理装置。 7. The rounding evaluation is based on the most significant bit 5. The logical product of a logical sum of a bit excluding a significant bit and a least significant bit of a shift operation result and a most significant bit of the bits rounded down by the right bit shift. The data processing device according to claim 1.
8 . 1つの半導体基板に構成されたことを特徴とする請求項 1乃至 7の何れか 8. The semiconductor device according to claim 1, wherein the semiconductor device is formed on one semiconductor substrate.
1項に記載のデータ処理装置。 The data processing device according to item 1.
PCT/JP2003/010976 2003-08-28 2003-08-28 Data processor WO2005024625A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2003/010976 WO2005024625A1 (en) 2003-08-28 2003-08-28 Data processor
JP2005508741A JP4243277B2 (en) 2003-08-28 2003-08-28 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2003/010976 WO2005024625A1 (en) 2003-08-28 2003-08-28 Data processor

Publications (1)

Publication Number Publication Date
WO2005024625A1 true WO2005024625A1 (en) 2005-03-17

Family

ID=34260081

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2003/010976 WO2005024625A1 (en) 2003-08-28 2003-08-28 Data processor

Country Status (2)

Country Link
JP (1) JP4243277B2 (en)
WO (1) WO2005024625A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015506022A (en) * 2011-12-07 2015-02-26 エイアールエム リミテッド Apparatus and method for rounding floating point values to integer floating point values
CN106611216A (en) * 2016-12-29 2017-05-03 北京旷视科技有限公司 Computing method and device based on neural network
WO2017181562A1 (en) * 2016-04-18 2017-10-26 中国科学院计算技术研究所 Method and system for processing neural network
JP2018142049A (en) * 2017-02-27 2018-09-13 株式会社日立製作所 Information processing apparatus, image recognition apparatus and method of setting parameter for convolution neural network

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08202530A (en) * 1995-01-24 1996-08-09 Hitachi Ltd Processor and method for floating decimal point addition and subtraction having before-normalization rounding means
JP2000010762A (en) * 1998-06-19 2000-01-14 Mitsubishi Electric Corp Floating-point operation device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08202530A (en) * 1995-01-24 1996-08-09 Hitachi Ltd Processor and method for floating decimal point addition and subtraction having before-normalization rounding means
JP2000010762A (en) * 1998-06-19 2000-01-14 Mitsubishi Electric Corp Floating-point operation device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015506022A (en) * 2011-12-07 2015-02-26 エイアールエム リミテッド Apparatus and method for rounding floating point values to integer floating point values
WO2017181562A1 (en) * 2016-04-18 2017-10-26 中国科学院计算技术研究所 Method and system for processing neural network
US11580367B2 (en) 2016-04-18 2023-02-14 Institute Of Computing Technology, Chinese Academy Of Sciences Method and system for processing neural network
CN106611216A (en) * 2016-12-29 2017-05-03 北京旷视科技有限公司 Computing method and device based on neural network
JP2018142049A (en) * 2017-02-27 2018-09-13 株式会社日立製作所 Information processing apparatus, image recognition apparatus and method of setting parameter for convolution neural network

Also Published As

Publication number Publication date
JPWO2005024625A1 (en) 2006-11-02
JP4243277B2 (en) 2009-03-25

Similar Documents

Publication Publication Date Title
JP5273866B2 (en) Multiplier / accumulator unit
JP3711147B2 (en) A set of instructions that process packed data
US6009451A (en) Method for generating barrel shifter result flags directly from input data
KR100329339B1 (en) An apparatus for performing multiply-add operations on packed data
US7047272B2 (en) Rounding mechanisms in processors
JP4064989B2 (en) Device for performing multiplication and addition of packed data
CN109634558B (en) Programmable mixed precision arithmetic unit
JP3701401B2 (en) Microprocessor having saturated operation instructions
WO2005024625A1 (en) Data processor
US4823300A (en) Performing binary multiplication using minimal path algorithm
JPH0346024A (en) Floating point computing element
US5685008A (en) Computer Processor utilizing logarithmic conversion and method of use thereof
US5696986A (en) Computer processor utilizing logarithmic conversion and method of use thereof
US5907500A (en) Motion compensation adder for decoding/decompressing compressed moving pictures
US7051062B2 (en) Apparatus and method for adding multiple-bit binary-strings
US6981012B2 (en) Method and circuit for normalization of floating point significants in a SIMD array MPP
JP2645422B2 (en) Floating point processor
JP2000081966A (en) Arithmetic unit
JP2002157114A (en) Multiplier and integrated circuit device having the same
JP5261738B2 (en) Semiconductor device
US20020194238A1 (en) Method and circuit for alignment of floating point significands in a SIMD array MPP
JPH11102353A (en) Floating-point product-sum operating element
WO2008077803A1 (en) Simd processor with reduction unit
JPH1166045A (en) Multiplier
KR100434391B1 (en) The architecture and the method to process image data in real-time for DSP and Microprocessor

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): CN JP KR SG US

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2005508741

Country of ref document: JP

122 Ep: pct application non-entry in european phase