RU2498392C1 - Device to predict exceptional situation "accuracy loss" of "multiplication with accumulation" operation unit - Google Patents

Device to predict exceptional situation "accuracy loss" of "multiplication with accumulation" operation unit Download PDF

Info

Publication number
RU2498392C1
RU2498392C1 RU2012130917/08A RU2012130917A RU2498392C1 RU 2498392 C1 RU2498392 C1 RU 2498392C1 RU 2012130917/08 A RU2012130917/08 A RU 2012130917/08A RU 2012130917 A RU2012130917 A RU 2012130917A RU 2498392 C1 RU2498392 C1 RU 2498392C1
Authority
RU
Russia
Prior art keywords
mantissa
zeros
sum
value
accuracy
Prior art date
Application number
RU2012130917/08A
Other languages
Russian (ru)
Inventor
Павел Сергеевич Зубковский
Евгений Вячеславович Ивасюк
Original Assignee
Открытое акционерное общество "КОНСТРУКТОРСКОЕ БЮРО "КОРУНД-М" (ОАО КБ "КОРУНД-М")
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 Открытое акционерное общество "КОНСТРУКТОРСКОЕ БЮРО "КОРУНД-М" (ОАО КБ "КОРУНД-М") filed Critical Открытое акционерное общество "КОНСТРУКТОРСКОЕ БЮРО "КОРУНД-М" (ОАО КБ "КОРУНД-М")
Priority to RU2012130917/08A priority Critical patent/RU2498392C1/en
Application granted granted Critical
Publication of RU2498392C1 publication Critical patent/RU2498392C1/en

Links

Images

Landscapes

  • Complex Calculations (AREA)

Abstract

FIELD: information technologies.
SUBSTANCE: device comprises a subblock of prediction of a sum of fractional parts, a counter of senior zeros of the sum of fractional parts, registers of fractional parts of numbers, input registers of number exponents, a counter of junior zeros of the summand fractional parts, a subblock of calculation of a shift of levelling and prediction of a shift of preliminary normalisation, a comparator of early loss of accuracy, a counter of junior zeros of a sum of fractional parts, a comparator of late loss of accuracy.
EFFECT: accelerated process of performance of a flow of independent commands of multiplication with accumulation with permitted exceptional situation of accuracy loss.
5 dwg, 1 tbl

Description

Изобретение относится к области вычислительной техники, а именно: к вычислительным системам на основе микропроцессоров с сопроцессорами вещественной и комплексной арифметики.The invention relates to the field of computer technology, namely: to computer systems based on microprocessors with coprocessors of material and complex arithmetic.

Известны различные варианты структурной организации вычислительных устройств микропроцессоров, зависящие от способов обработки исключительных ситуаций при операциях над вещественными или комплексными числами. Так, в системах поддерживающих точные исключения стандарта IEEE754 необходимым является присутствие устройства, реализующего механизм отмены результатов всех операций, выполнившихся после операции, которая вызвала исключение. Так как длительность большинства инструкций вещественной арифметики больше длительности целочисленных операций, то при одновременном выполнении целочисленной и вещественной инструкций, возможна ситуация, при которой целочисленная инструкция будет завершена до окончания вещественной и отменить результат первой очень затруднительно.There are various options for the structural organization of computing devices of microprocessors, depending on how to handle exceptional situations when operations on real or complex numbers. So, in systems supporting exact exceptions of the IEEE754 standard, it is necessary to have a device that implements a mechanism for canceling the results of all operations performed after the operation that caused the exception. Since the duration of most instructions of material arithmetic is longer than the duration of integer operations, while executing the integer and material instructions, it is possible that the integer instruction will be completed before the end of the material instruction and it is very difficult to cancel the result of the first.

Поэтому для правильной работы микропроцессора в режиме разрешения исключительных ситуаций, таких как «переполнение», «потеря значимости», «потеря точности», используют такой режим его работы, при котором на время выполнения текущей арифметической операции выполнение других команд параллельно текущей не разрешается. Такой режим работы значительно снижает скорость вещественных вычислений. Для того чтобы сгладить падение производительности, необходимо использовать устройство предсказания исключительных ситуаций, которое встраивается в исполнительный арифметический подблок и обеспечивает заблаговременный расчет признака возможной исключительной ситуации. Данный предсказанный признак, будет использован микропроцессором для принятия решения о последующей выдаче арифметических команд на исполнительные подблоки.Therefore, for proper operation of the microprocessor in the mode of resolving exceptional situations, such as “overflow”, “loss of significance”, “loss of accuracy”, it is used such a mode of operation in which for the duration of the current arithmetic operation, the execution of other commands in parallel with the current one is not allowed. This mode of operation significantly reduces the speed of material calculations. In order to smooth out the drop in productivity, it is necessary to use an exception prediction device, which is built into the arithmetic executive subunit and provides early calculation of a sign of a possible exceptional situation. This predicted feature will be used by the microprocessor to decide on the subsequent issuance of arithmetic commands to executive subunits.

Эффективность применения устройства предсказания исключительных ситуаций зависит от точности предсказания и стадии выполнения инструкции, на которой может быть осуществлено предсказание. Эффективность будет тем выше, чем больше длительность арифметической инструкции, при условии, что возможно осуществить предсказание на ранних стадиях.The effectiveness of an exception prediction device depends on the accuracy of the prediction and the stage of execution of the instruction at which the prediction can be made. Efficiency will be the higher, the longer the duration of the arithmetic instruction, provided that it is possible to carry out prediction in the early stages.

Так как вычислительные секции современных микропроцессоров строятся в основном с применением вещественных модулей «умножения с накоплением», то обеспечение последних устройством предсказания исключительных ситуаций даст возможность получить увеличение быстродействия.Since the computational sections of modern microprocessors are built mainly using real “multiply with accumulation” modules, providing the latter with an exception prediction device will make it possible to obtain an increase in speed.

Предсказание исключительной ситуации «потеря точности» является более сложным, чем предсказание ситуаций «переполнение» и «потеря значимости» и сопряжено со сложностью предсказания наличия отбрасываемых при округлении, значащих битов промежуточного результата. Обычно такой признак теряемых при округлении битов вычисляют после процесса окончательной нормализации промежуточного результата.The prediction of the exception “loss of accuracy” is more complicated than the prediction of situations “overflow” and “loss of significance” and is associated with the complexity of predicting the presence of significant bits of the intermediate result discarded during rounding. Usually, such a sign of bits lost during rounding is calculated after the process of final normalization of the intermediate result.

Известен исполнительный подблок вещественной арифметики, выполняющий операции «умножение», «сложение», «умножение с накоплением», «деление», «квадратный корень» и имеющий устройство предсказания исключительных ситуаций переполнения и потери значимости (патент US 6,631,392, кл. G06F 7/38, опубл. 7.10.2003).The executive subunit of material arithmetic is known that performs the operations of “multiplication”, “addition”, “multiplication with accumulation”, “division”, “square root” and having a device for predicting exceptional situations of overflow and loss of significance (US patent 6,631,392, class G06F 7 / 38, published October 7, 2003).

В качестве недостатка данного подблока необходимо отметить то, что устройство предсказания исключительных ситуаций обслуживает сразу несколько арифметических подблоков вещественной арифметики (сумматор, умножитель, подблок квадратного корня/деления) и эта особенность делает затруднительным процесс определения принадлежности предсказанного признака конкретной команде.As a drawback of this subunit, it should be noted that the exception prediction device serves several arithmetic subunits of real arithmetic (adder, multiplier, square root / division subunit) at once and this feature makes the process of determining whether the predicted attribute belongs to a specific command difficult.

Наиболее близким по технической сути и достигаемому результату является устройство, выполняющее вещественную операцию «умножение с накоплением» и содержащее ускоренную схему вычисления бита-признака потери точности. Схема вычисления бита-признака потери точности состоит из предсказателя значения промежуточной суммы, счетчика старших нулей предсказанной суммы, сумматора промежуточного значения, подсхемы нормализации промежуточного значения, подсхем дизъюнкции, включенных после каждой стадии подсхемы нормализации, которые определяют наличие отбрасываемых значащих при округлении битов (патент US 5,771,183, кл. G06F 7/00, опубл. 23.07.1998 г.).The closest in technical essence and the achieved result is a device that performs the material operation "multiplication with accumulation" and contains an accelerated scheme for calculating the bit-sign of loss of accuracy. The scheme for calculating the bit-sign of accuracy loss consists of a predictor of the intermediate sum value, a counter of leading zeros of the predicted sum, an intermediate value adder, an intermediate value normalization subcircuit, a disjunction subcircuit included after each stage of the normalization subcircuit, which determine the presence of discarded bits that are significant when rounding off (US patent 5,771,183, class G06F 7/00, publ. 07.23.1998).

Недостатком данного прототипа является структурная особенность, которая замедляет процесс выполнения потока независимых команд «умножения с накоплением» (при включенных IEEE754 исключениях) и которая заключается в том, что расчет бита-признака потери точности осуществляется после основного суммирования мантисс (с распространением переноса) и одновременно с процессом нормализации результата суммирования. Такая организация дает возможность несколько ускорить расчет бита-признака потери точности и завершить его одновременно с окончанием процесса нормализации, но не обеспечивает возможность досрочного расчета и, следовательно, предсказания бита-признака потери точности. Это ограничение не дает сформировать достаточное условие флага исключительной ситуации потери точности на ранних этапах работы конвейера модуля, и сигнализировать об этом ядру микропроцессора, не дожидаясь окончания расчета.The disadvantage of this prototype is a structural feature that slows down the process of executing a stream of independent “multiply with accumulation” commands (with exceptions turned on by IEEE754) and that the bit-sign of accuracy loss is calculated after the main summation of the mantissa (with spread propagation) and at the same time with the process of normalizing the summation result. Such an organization makes it possible to somewhat speed up the calculation of the bit-sign of loss of accuracy and complete it simultaneously with the end of the normalization process, but does not provide the possibility of early calculation and, therefore, prediction of the bit-sign of loss of accuracy. This restriction does not allow to form a sufficient condition for the flag of an exceptional situation of loss of accuracy in the early stages of the module conveyor, and to signal the microprocessor core about it, without waiting for the calculation to complete.

Технический результат от использования данного изобретения заключается в обеспечении ускорения процесса выполнения потока независимых команд «умножения с накоплением» при разрешенной исключительной ситуации «потеря точности».The technical result from the use of this invention is to accelerate the process of executing a stream of independent commands "multiply with accumulation" with the permitted exception "loss of accuracy".

Указанный технический результат достигается тем, что устройство предсказания исключительной ситуации «потеря точности» блока операции «умножение с накоплением», включающее подблок предсказания суммы мантисс, счетчик старших нулей суммы мантисс, согласно изобретению снабжено входными регистрами мантисс чисел В и С, входными регистрами экспонент чисел А, В и С, счетчиком младших нулей мантиссы слагаемого, подблоком вычисления сдвига выравнивания и предсказания сдвига предварительной нормализации, компаратором ранней потери точности, счетчиком младших нулей суммы мантисс, компаратором поздней потери точности, при этом счетчик младших нулей мантиссы слагаемого связан с входным регистром мантиссы числа С для осуществления подсчета числа младших нулей мантиссы слагаемого С и компаратором ранней потери точности для сравнения со сдвигом выравнивания, выходящим из подблока вычисления сдвига выравнивания и предсказания сдвига предварительной нормализации, связанного с входным регистром экспоненты числа А, входным регистром экспоненты числа В и входным регистром экспоненты числа С для получения признака наличия значащих битов выравненной мантиссы слагаемого за пределами разрядности внутреннего представления данных, а компаратор поздней потери точности связан со счетчиком старших нулей суммы мантисс и счетчиком младших нулей суммы мантисс, которые связаны с подблоком предсказания суммы мантисс для получения признака наличия значащих битов мантиссы результата, в отбрасываемой при округлении части.The specified technical result is achieved by the fact that the device for predicting the exception “loss of accuracy” of the operation block “multiplication with accumulation”, including a subblock for predicting the sum of mantissas, a counter of leading zeros of the sum of mantissas, according to the invention, is equipped with input mantissas registers of numbers B and C, input registers of exponential numbers A, B and C, the counter of the least zeros of the term mantissa, the subblock of the calculation of the alignment shift and the prediction of the preliminary normalization shift, the comparator of the early loss of accuracy, the counter of the least zeros of the sum of the mantissa, the comparator of the late loss of accuracy, the counter of the least zeros of the mantissa of the term is connected to the input register of the mantissa of the number C to calculate the number of the least zeros of the mantissa of the term C, and the comparator of the early loss of accuracy for comparison with the alignment shift coming from the shift calculation subunit alignment and prediction of the shift of preliminary normalization associated with the input register of the exponent of number A, the input register of the exponent of number B, and the input expo register cents of the number C to obtain the sign of the presence of significant bits of the aligned mantissa of the term beyond the bit depth of the internal representation of the data, and the comparator of the late loss of accuracy is associated with the counter of the highest zeros of the sum of the mantissas and the counter of the lowest zeros of the sum of the mantissas, which are associated with the prediction subunit of the mantissa sum to obtain the sign of the presence of significant the mantissa bits of the result, in the part discarded during rounding.

Изобретение реализовано на примере блока операции «умножение с накоплением» одинарной точности, как наиболее простом и поясняется чертежами, где на фиг.1 представлена структурная схема блока вычисления операции «умножение с накоплением» одинарной точности без промежуточного округления со встроенной схемой предсказания потери точности. На фиг.2 представлена детализированная структурная схема подблока предсказания суммы мантисс. На фиг.3 представлена детализированная структурная схема счетчиков младших и старших нулей, а также компаратора поздней потери точности. На фиг.4 и фиг.5 представлены иллюстрации, поясняющие алгоритм работы схем предсказания ранней и поздней потери точности. В случае применения изобретения в блоке «умножение с накоплением» другой точности, константы сравнения компараторов, разрядности счетчиков нулей будут зависеть от разрядности мантисс входных чисел.The invention is implemented as an example of a single-precision multiplication with accumulation operation unit, as the simplest one and is illustrated by the drawings, where Fig. 1 shows a block diagram of a single-precision multiplication with accumulation operation calculation unit without intermediate rounding with a built-in accuracy loss prediction scheme. Figure 2 presents a detailed structural diagram of a subblock for predicting the sum of the mantissa. Figure 3 presents a detailed structural diagram of the counters of low and high zeros, as well as a comparator of late loss of accuracy. Figures 4 and 5 are illustrations illustrating an algorithm for operating early and late accuracy loss prediction schemes. In the case of applying the invention in the block “multiplication with accumulation” of a different accuracy, the constants for comparing the comparators, the bits of the counters of zeros will depend on the bits of the mantis of the input numbers.

В состав блока вычисления операции «умножение с накоплением» одинарной точности без промежуточного округления со встроенной схемой предсказания потери точности входит:The unit of calculation of the operation “Multiplication with Accumulation” of single precision without intermediate rounding with a built-in prediction scheme for accuracy loss includes:

входной регистр знака числа А 1, входной регистр знака числа В 2, входной регистр знака числа С 3, входной регистр мантиссы числа А 4, входной регистр мантиссы числа В 5, входной регистр мантиссы числа С 6, входной регистр экспоненты числа А 7, входной регистр экспоненты числа В 8, входной регистр экспоненты числа С 9, подблок умножения мантисс 10, подблок выравнивания мантиссы слагаемого 11, счетчик младших нулей мантиссы слагаемого 12, подблок вычисления экспоненты 13, подблок вычисления сдвига выравнивания и предсказания сдвига предварительной нормализации 14, компаратор ранней потери точности 15, компрессор Зв2 16, подблок предварительной нормализации 17, подблок предсказания суммы мантисс 18, счетчик младших нулей суммы мантисс 19, счетчик старших нулей суммы мантисс 20, компаратор поздней потери точности 21, подблок основной нормализации 22, детектор ошибки предсказания 23, подблок корректора экспоненты результата 24, детектор переполнения/потери значимости 25, детектор знака результата сложения мантисс 26, мультиплексор суммы мантисс 27, мультиплексор сдвига нормализации 28, мультиплексор общей потери точности 29, подблок пост-коррекции экспоненты результата 30, подблок коррекции переполнения/потери значимости 31, сумматор округления 32, формирователь знака операции 33, подблок пост-нормализации 34, выходной регистр знака результата 35, выходной регистр мантиссы результата 36, выходной регистр флага потери точности 37, выходной регистр экспоненты результата 38, выходной регистр вектора исключительных ситуаций 39.the input register of the sign of the number A 1, the input register of the sign of the number B 2, the input register of the sign of the number C 3, the input register of the mantissa of the number 4, the input register of the mantissa of the number 5, the input register of the mantissa of the number 6, the input register of the exponent of the number A 7, the input register register of the exponent of number B 8, the input register of the exponent of number C 9, the subunit of multiplication of the mantissa of the term 11, the subunit of the alignment of the mantissa of the term 11, the counter of the lowest zeros of the mantissa of the term 12, the subunit of calculating the exponent 13, the subunit of calculating the alignment shift and the prediction of the preliminary shift malizatsii 14, early accuracy loss comparator 15, compressor Sv2 16, preliminary normalization subunit 17, mantissum total prediction subunit 18, mantissas sum low zeros counter 19, high mantisses highest zeros counter 20, late accuracy loss comparator 21, main normalization subunit 22, detector prediction errors 23, subunit of the corrector of the exponent of the result 24, overflow / loss of significance detector 25, sign detector of the addition result of mantiss 26, sum mantiss multiplexer 27, normalization shift multiplexer 28, multiplexer total loss of accuracy 29, sub-block of post-correction of the exponent of result 30, sub-block of correction of overflow / loss of significance 31, adder of rounding 32, shaper of operation 33, sub-block of normalization 34, output register of result sign 35, output register of mantissa of result 36, output register flag loss accuracy 37, the output register of the exponent of the result 38, the output register of the vector of exceptional situations 39.

В свою очередь, подблок предсказания суммы мантисс 18 состоит из:In turn, the prediction sub-block of the sum of the mantissa 18 consists of:

подблока побитового исключающего «ИЛИ» 40, подблока побитового «ИЛИ» 41, подблока побитового исключающего «ИЛИ» 42, подблока сдвига влево 43, подблока 44 маскирования битов [73:48], подблока 45 маскирования битов [48:0], элемента объединения шин данных 46.a subunit of a bitwise exclusive “OR” 40, a subunit of a bitwise exclusive “OR” 41, a subunit of a bitwise exclusive “OR” 42, a subunit of left shift 43, a subunit 44 of masking bits [73:48], a subunit of 45 masking bits [48: 0], a combining element data buses 46.

Совокупность счетчика младших нулей суммы мантисс 19, счетчика старших нулей суммы мантисс 20 и компаратора поздней потери точности 21 состоит из:The combination of the counter of the lowest zeros of the sum of the mantissas 19, the counter of the leading zeros of the sum of the mantissas 20 and the comparator of the late loss of accuracy 21 consists of:

счетчика 1 старших нулей битов [48:23] 47, счетчика 2 старших нулей битов [22:0] 48, счетчика младших нулей битов [48:0] 49, мультиплексора старших нулей 50, подблока маскирования 51, формирователя константы сравнения 52, компрессора 3в2 53, сумматора компаратора поздней потери точности 54, мультиплексора коррекции 55.counter 1 of the leading zeros of bits [48:23] 47, counter 2 of the leading zeros of bits [22: 0] 48, counter of the leading zero zeros of bits [48: 0] 49, multiplexer of the leading zeros of 50, masking subunit 51, comparator of comparison constant 52, compressor 3v2 53, adder comparator late loss of accuracy 54, correction multiplexer 55.

Описанное выше устройство работает следующим образом.The device described above operates as follows.

На вход блока поступают три операнда закодированных в формате IEEE754, каждое из чисел представлено полем экспоненты размером 8 бит, мантиссы - 24 бита и знака - 1 бит.Three operands encoded in IEEE754 format are received at the input of the block, each of the numbers is represented by an 8-bit exponent field, 24 bits by the mantissa and 1 bit by the sign.

В первом такте работы схемы проводятся следующие действия:In the first cycle of the circuit, the following actions are performed:

в подблоке умножения мантисс 10 происходит умножение мантисс операндов А и В получаемых с входных регистров мантиссы числа А 4 и мантиссы числа В 5. Одновременно с этим происходит вычисление промежуточного значения экспоненты результата в подблоке вычисления экспоненты 13, а также значения сдвига выравнивания и предсказание сдвига предварительной нормализации в подблоке вычисления сдвига выравнивания, предсказания сдвига предварительной нормализации 14 на основе данных, поступаемых с входных регистров экспоненты числа А 7, экспоненты числа В 8, экспоненты числа С 9. Одновременно с этим, счетчик младших нулей мантиссы слагаемого 12, на основе данных, поступаемых с входного регистра мантиссы С 6, осуществляет подсчет числа младших нулей мантиссы слагаемого С. Величина младших нулей мантиссы слагаемого С сравнивается со сдвигом выравнивания в компараторе ранней потери точности 15, для получения флага наличия значащих битов выравненной мантиссы слагаемого за пределами разрядной сетки (74 бита) внутреннего представления результата. Далее, как только становятся готовы младшие биты значения сдвига выравнивания 56 (ЗНАЧ_СДВ_ВЫР_С), формируемые в подблоке вычисления сдвига выравнивания, предсказания сдвига предварительной нормализации 14, происходит выравнивание мантиссы слагаемого С в подблоке выравнивания мантиссы слагаемого 11.in the multiplication block of mantissa 10, the mantissa of the operands A and B are obtained from the input mantissa registers of the number A 4 and the mantissa of the number B 5. At the same time, the intermediate value of the exponent of the result is calculated in the subunit of calculating the exponent 13, as well as the alignment shift value and the preliminary shift prediction normalization in the subunit of the calculation of the alignment shift, prediction of the shift of the preliminary normalization 14 based on the data received from the input registers of the exponent of the number A 7, the exponent la 8, exponents of the number C 9. At the same time, the counter of the lowest zeros of the mantissa of the term 12, based on the data received from the input register of the mantissa C 6, calculates the number of the lowest zeros of the mantissa of the term C. The value of the lower zeros of the mantissa of the term C is compared with the shift alignment in the comparator of an early loss of accuracy of 15, to obtain a flag for the presence of significant bits of the aligned mantissa of the term outside the bit grid (74 bits) of the internal representation of the result. Further, as soon as the least significant bits of the alignment shift value 56 (VALUE_DV_VYR_C), which are generated in the subunit of calculating the alignment shift, predicting the preliminary normalization shift 14, are ready, the mantissa of the term C is aligned in the subunit of the alignment of the mantissa of term 11.

Алгоритм работы схемы предсказания ранней потери точности проиллюстрирован на фиг.4. 67 - мантисса слагаемого С на входе схемы выравнивания. 68 - число младших нулей мантиссы, 69 - нулевые биты, дополняющие разрядность мантиссы до значения 74 бита. 70 - результат умножения мантисс операндов А и В в избыточной форме с сохранением переноса. 71 - значение сдвига выравнивания СДВ_ВЫР. Флаг ранней потери точности равен единице если:The operation algorithm of the early accuracy loss prediction scheme is illustrated in FIG. 67 - the mantissa of the term C at the input of the equalization circuit. 68 - the number of least significant zeros of the mantissa, 69 - zero bits that complement the bit depth of the mantissa to a value of 74 bits. 70 is the result of multiplication of the mantissa of operands A and B in an excess form while maintaining the transfer. 71 is the alignment shift value SDV_VYR. The flag of early accuracy loss is equal to one if:

ЗНАЧ_МЛ_НУЛ+(2*m+2)<СДВ_ВЫР, илиVALUE_ML_NULL + (2 * m + 2) <SDL_REV, or

ЗНАЧ_МЛ_НУЛ+(2*m+2)<экспА + экспВ - экспС - bias+m+3, илиVALUE_ML_NULL + (2 * m + 2) <expA + expB - expC - bias + m + 3, or

Figure 00000001
,
Figure 00000001
,

где экспА, экспВ, экспС - экспоненты обрабатываемых чисел в формате ieee754, m - разрядность мантиссы входных чисел, bias - значение смещения экспоненты.where expA, expB, expC are the exponents of the processed numbers in the ieee754 format, m is the bit depth of the input mantissa, and bias is the exponent bias value.

Все действия второго такта работы дублируются, разделяясь на две ветви:All actions of the second clock cycle are duplicated, divided into two branches:

одна ветвь работает при условии, что больше результат умножения мантисс, чем мантисса слагаемого, вторая ветвь - при условии, что больше выравненная мантисса слагаемого. Это сделано, для того чтобы при вычитании была возможность выбрать модуль операции, а не выполнять преобразование отрицательного значения.one branch works under the condition that the result of multiplication of the mantissa is greater than the term mantissa, the second branch - provided that there is more aligned mantissa of the term. This is done so that when subtracting it is possible to select the module of the operation, and not perform the conversion of a negative value.

Каждая из ветвей схемы включает следующие действия над результатами первого такта:Each of the branches of the circuit includes the following actions on the results of the first measure:

осуществляется сложение результата умножения мантисс, представленного в избыточной форме с сохранением переноса, и выравненной мантиссы слагаемого в компрессоре 3в2 16. В подблоке предварительной нормализации 17 осуществляется предварительная нормализация промежуточного значения сложения мантисс на максимальную величину сдвига влево, равного 25 битам. Значение сдвига предварительной нормализации формируется в первом такте работы модуля, в подблоке вычисления сдвига выравнивания, предсказания сдвига предварительной нормализации 14. Одновременно с процессом предварительной нормализации в подблоке предсказания суммы мантисс 18 осуществляется предсказание значения суммы, на основе выходных значений 59 из 60 компрессора 3в2 16, величины 56 сдвига выравнивания мантиссы слагаемого С, значения 58 выравненной мантиссы слагаемого С из первого такта.the result of multiplying the mantissa, presented in an excess form with preservation of the transfer, and the aligned mantissa of the term in the compressor 3v2 are added. 16. In the subunit of the preliminary normalization 17, the intermediate value of the addition of the mantissa is preliminarily normalized by the maximum left shift value of 25 bits. The value of the preliminary normalization shift is generated in the first cycle of the module, in the subunit of the calculation of the alignment shift, the prediction of the preliminary normalization shift 14. Simultaneously with the preliminary normalization process, the sum value is predicted in the mantiss 18 sum prediction block, based on the output values 59 of 60 of the compressor 3v2 16, values 56 of the alignment shift of the mantissa of the term C, values 58 of the aligned mantissa of the term C from the first measure.

Подробная структурная схема подблока предсказания суммы мантисс 18 приведена на фиг.2. Она представляет собой упрощенную схему двоичного сумматора, в котором значение полусуммы, формируемое в подблоке 40, складывается по модулю два с упрощенным значением переноса, который формируется в подблоке 41 и поступает в текущую позицию. Упрощенный сигнал переноса учитывает только биты в предыдущей позиции. А именно, при суммировании двоичных чисел An и Bn, значение предсказанной суммыA detailed block diagram of the prediction subunit of the sum of mantiss 18 is shown in FIG. It is a simplified binary adder scheme in which the half-sum value generated in subunit 40 is added modulo two with a simplified transfer value that is generated in subunit 41 and arrives at the current position. The simplified carry signal only takes into account the bits in the previous position. Namely, when summing the binary numbers A n and B n , the value of the predicted sum

Figure 00000002
Figure 00000002

Подблок предсказания суммы мантисс 18 логически делится на две составляющие: на старшую часть (биты [73:48]) и остальную часть (биты [48:0]). В качестве значения старшей части берется значение битов [73:48] от выравненной мантиссы слагаемого С 58. Для предсказания значения битов [48:0] суммы используется формула (2).The prediction sub-block of the sum of mantiss 18 is logically divided into two components: the leading part (bits [73:48]) and the rest (bits [48: 0]). The value of bits [73:48] from the aligned mantissa of the term C 58 is taken as the value of the elder part. To predict the value of bits [48: 0] of the sum, formula (2) is used.

Предсказанные значения старшей части (биты [73:48]) и остальной части (биты [48:0]) проходят через подблоки маскирования 44 и 45, в которых, на основании признака 57 нахождения сдвига выравнивания 56 в диапазоне значений от 0 до 25 включительно, происходит формирование корректного значения предсказанной суммы, части которой затем объединяются элементом объединения шин данных 46.The predicted values of the upper part (bits [73:48]) and the rest (bits [48: 0]) pass through masking subunits 44 and 45, in which, based on characteristic 57, the alignment shift 56 is in the range of values from 0 to 25 inclusive , the formation of the correct value of the predicted amount occurs, the parts of which are then combined by the data bus combining element 46.

Сформированное таким способом неточное значение суммы имеет величину младших нулей, равных точному значению у суммы, которая была бы получена при помощи полного двоичного сумматора, а число старших нулей меньше на один или равно точному значению. В таблице 1 приведены возможные варианты значений старших нулей в промежуточной сумме разрядностью 74 бита.The inaccurate value of the sum formed in this way has the value of least zeros equal to the exact value of the sum that would be obtained using the full binary adder, and the number of leading zeros is one less or equal to the exact value. Table 1 shows the possible values of the leading zeros in the intermediate sum with a resolution of 74 bits.

Таблица 1Table 1 Возможные варианты значений старших нулей в промежуточной суммеPossible values of leading zeros in the subtotal Значение сдвига выравнивания мантиссы С, ЗНАЧ_СДВ_ВЫР_СMantissa alignment shift value C, VALUE_DV_VYR_C >0, <25> 0, <25 >25> 25 Значение старших нулей интервала битов [73:48], ЗНАЧ_СТ_НУЛ0The value of the leading zeros of the bit interval [73:48], VALUE_ST_NULL0 ЗНАЧ_СДВ_ВЫР_СSIGN_VALUE_VALUE_S >=25> = 25 Значение старших нулей интервала битов [48:23], ЗНАЧ_СТ_НУЛ1The value of the leading zeros of the bit interval [48:23], VALUE_ST_NULL1 00 подсчетcount Значение старших нулей интервала битов [22:0], ЗНАЧ СТ НУЛ2The value of the leading zeros of the bit interval [22: 0], VALUE ST NULL2 00 подсчет, если ЗНАЧ_СТ_НУЛ1=25counting if VALUE_ST_NULL1 = 25

Счетчик младших нулей суммы мантисс 19 осуществляет подсчет младших нулей предсказанной суммы. Счетчик старших нулей суммы мантисс 20 осуществляет подсчет старших нулей предсказанной суммы. Затем значения младших и старших нулей сравниваются с константой в компараторе поздней потери точности 21 для получения флага наличия значащих битов мантиссы результата, в отбрасываемой при округлении части.The counter of the least zeros of the sum mantiss 19 calculates the least zeros of the predicted amount. The counter of leading zeros of the sum mantiss 20 calculates the leading zeros of the predicted amount. Then the values of low and high zeros are compared with a constant in the comparator of the late loss of accuracy of 21 to obtain a flag for the presence of significant bits of the result mantissa in the part discarded during rounding.

Совокупность счетчика старших нулей суммы мантисс 20, счетчика младших нулей суммы мантисс 19 и компаратора поздней потери точности 21 функционирует следующим образом:The combination of the counter of leading zeros of the sum of the mantissas 20, the counter of the leading zeros of the sum of the mantissas 19 and the comparator of the late loss of accuracy 21 operates as follows:

поле битов внутреннего значения суммы делится на три части (таблица 1), в которых независимо производится подсчет старших нулей. В качестве значения старших нулей поля битов [73:48] (ЗНАЧ_СТ_НУЛ0) берется значение сдвига выравнивания мантиссы слагаемого С 56 (ЗНАЧ_СДВ_ВЫР_С), если оно не превышает значения 25. Если ЗНАЧ_СДВ_ВЫР_С>25, то число нулей в поле битов [73:48] составляет 25 или 26. Значение старших нулей поля битов [48:23] (ЗНАЧ_СТ_НУЛ1) вычисляется в подблоке счетчика 1 старших нулей битов [48:23] 47 и учитывается только если ЗНАЧ_СДВ_ВЫР_С>25, иначе оно равно 0. Значение старших нулей поля битов [22:0] (ЗНАЧ_СТ_НУЛ2) вычисляется в подблоке счетчика 2 старших нулей битов [22:0] 48 и учитывается только если число старших нулей всего поля промежуточной суммы больше или равно значению 51, т.е. ЗНАЧ_СТ_НУЛ0+ЗНАЧ_СТ_НУЛ1=51, причем в этом случае не происходит поздней потери точности, и нет необходимости использовать ЗНАЧ_СТ_НУЛ2 для вычисления флага поздней потери точности, оно используется только для нормализации результата. Значение младших нулей поля битов [48:0] вычисляется в подблоке счетчика младших нулей битов [48:0] 49.the bit field of the internal value of the sum is divided into three parts (table 1), in which the leading zeros are independently calculated. As the value of the leading zeros of the bit field [73:48] (VALUE_ST_NULL0), the alignment shift value of the mantissa of the term C 56 (VALUE_DV_VYR_C) shall be taken, if it does not exceed the value 25. If VALUE_DV_VYR_C> 25, then the number of zeros in the field of bits [73:48] is 25 or 26. The value of the leading zeros of the bit field [48:23] (VALUE_ST_NULL1) is calculated in the subblock of counter 1 of the highest zero zeros of the bits [48:23] 47 and is taken into account only if VALUE_DV_VYR_C> 25, otherwise it is 0. The value of the leading zeros of the bit field [22: 0] (VALUE_ST_NULL2) is calculated in the sub-block of the counter 2 high-order zeros of bits [22: 0] 48 and then ko if the number of zeros in all senior intermediate sum field is greater than or equal to 51, i.e., VALUE_ST_NULL0 + VALUE_ST_NULL1 = 51, and in this case there is no late loss of accuracy, and there is no need to use VALUE_ST_NULL2 to calculate the flag of late loss of accuracy, it is used only to normalize the result. The value of the least significant zeros of the bit field [48: 0] is calculated in the subunit of the counter of the lowest zero zeros of the bits [48: 0] 49.

Алгоритм работы схемы предсказания поздней потери точности проиллюстрирован на фиг.5. 72 - мантисса результата операции «умножение с накоплением», представленная в избыточном виде с сохранением переноса. 74 - предсказанное значение суммы, имеющее число младших нулей 77, совпадающее со значением числа младших нулей полной суммы 73, число старших нулей 75, равное значению числа старших нулей полной сумы 73 или меньшее на один. Флаг поздней потери точности если:The operation algorithm of the late accuracy loss prediction scheme is illustrated in FIG. 72 - the mantissa of the result of the operation "multiplication with accumulation", presented in excess with the transfer being preserved. 74 - the predicted value of the sum, having the number of least significant zeros 77, coinciding with the value of the number of least significant zeros of the total sum 73, the number of highest zeros 75, equal to the value of the number of highest zeros of the total sum 73 or less by one. Late precision loss flag if:

Figure 00000003
, где m - разрядность мантиссы входных чисел,
Figure 00000003
where m is the bit depth of the input mantissa,

78 - корректированное значение сдвига нормализации.78 is the adjusted normalization shift value.

Таким образом, компаратор поздней потери точности 21, сравнивает сумму старших и младших нулей с константой. Если признак 57 нахождения сдвига выравнивания 56 в диапазоне значений от 0 до 25 включительно выставлен в "1", то в качестве числа старших нулей берется значение сдвига выравнивания 56 (ЗНАЧ_СТ_НУЛ0), а константа сравнения равна десятичному значению 49. Если признак 57 нахождения сдвига выравнивания 56 в диапазоне значений от 0 до 25 включительно выставлен в "0", то в качестве числа старших нулей берется значение ЗНАЧ_СТ_НУЛ1, а константа сравнения равна десятичному значению 24. Значение старших нулей поля битов [22:0] (ЗНАЧ_СТ_НУЛ2) не подается на компаратор, так как в случае, когда его необходимо учитывать, не происходит поздней потери точности. ЗНАЧ_СТ_НУЛ2, обрабатываясь в подблоке маскирования 51, через выход 66, подается на подблок основной нормализации 22.Thus, the late accuracy loss comparator 21 compares the sum of the leading and lower zeros with a constant. If flag 57 for finding alignment shift 56 in the range of values from 0 to 25 inclusive is set to "1", then the value of alignment shift 56 (VALUE_ST_NULL0) is taken as the number of leading zeros, and the comparison constant is the decimal value 49. If flag 57 for finding alignment shift 56 in the range of values from 0 to 25 inclusively set to "0", then the value VALUE_ST_NULL1 is taken as the number of leading zeros, and the comparison constant is the decimal value 24. The value of the leading zeros of the bit field [22: 0] (VALUE_ST_NULL2) is not sent to the comparator , since in the case when it must be taken into account, there is no late loss of accuracy. VALUE_ST_NULL2, processed in the masking subunit 51, through the output 66, is fed to the main normalization subunit 22.

Одновременно с предсказанием поздней потери точности в подблоке основной нормализации 22 осуществляется окончательная нормализация мантиссы результата и коррекция значения основного сдвига на основании сигнала коррекции, поступаемого с подблока детектора ошибки предсказания 23.Simultaneously with the prediction of the late loss of accuracy in the subblock of the main normalization 22, the final normalization of the result mantissa and the correction of the value of the main shift are carried out based on the correction signal received from the subblock of the prediction error detector 23.

Параллельно с работой ветвей нормализации и предсказания суммы на основе данных, поступаемых с входных регистров знака числа А 1, знака числа В 2, знака числа С 3, значения произведения мантисс, а также значения 58 выравненной мантиссы слагаемого С вычисляется знак результата сложения мантисс в подблоке детектора знака результата сложения мантисс 26. На основании значения знака 63, выбираются значение нормализованной мантиссы с выхода одной из ветвей в мультиплексоре суммы мантисс 27, значение количества старших нулей для коррекции экспоненты - в мультиплексоре сдвига нормализации 28. Значение бита общей потери точности выбирается в мультиплексоре общей потери точности 29, где дополняется ранним признаком переполнения, формируемым в детекторе переполнения/потери значимости 25. Значение общего флага потери точности поступает на выходной регистр флага потери точности 37. Промежуточная корректировка экспоненты на основании значения старших нулей проводится в подблоке схемы коррекции экспоненты результата 24.In parallel with the operation of the normalization and prediction branches of the sum, based on the data received from the input registers of the sign of the number A 1, the sign of the number B 2, the sign of the number C 3, the product value of the mantissa, as well as the value 58 of the aligned mantissa of the term C, the sign of the result of the addition of the mantissa in the subunit is calculated of the sign of the result of adding the mantissa 26. Based on the value of the sign 63, the value of the normalized mantissa is selected from the output of one of the branches in the multiplexer of the sum of the mantissa 27, the value of the number of leading zeros for the correction of exponents - in the normalization shift multiplexer 28. The value of the total accuracy loss bit is selected in the total accuracy loss multiplexer 29, where it is supplemented with an early overflow sign generated in the overflow / loss of significance detector 25. The value of the general accuracy loss flag is sent to the output register of the accuracy loss flag 37. Intermediate Correction of the exponent based on the value of leading zeros is carried out in a sub-block of the exponential correction scheme of result 24.

В третьем такте работы схемы проводятся следующие действия:In the third step of the circuit, the following actions are carried out:

осуществляется сложение и округление значения мантиссы, представленной в избыточной форме в сумматоре округления 32. Затем проводится окончательная нормализация округленной мантиссы вследствие возможного переполнения в подблоке пост-нормализации 34. Переполнение мантиссы результата может происходить из-за округления. На основании возможного сигнала переполнения проводится окончательная корректировка экспоненты в подблоке пост-коррекции экспоненты результата 30, из которого значение экпоненты поступает на выходной регистр экспоненты результата 38. В подблоке коррекции переполнения/потери значимости 31 формируется вектор исключительных ситуаций, поступающий на выходной регистр вектора исключительных ситуаций 39. В подблоке формирователя знака операции 33 осуществляется формирование знака операции в целом, который поступает на выходной регистр знака результата 35. Мантисса результата операции поступает на выходной регистр мантиссы результата 36.addition and rounding of the mantissa value that is presented in excess in the rounding adder 32 is performed. Then the rounded mantissa is finally normalized due to possible overflow in the post-normalization subunit 34. Overflow of the result mantissa can occur due to rounding. Based on the possible overflow signal, the final exponent is adjusted in the post-correction subunit of the exponent of result 30, from which the exponent value is sent to the output register of the exponent of result 38. An exception vector is generated in the overflow / loss of significance correction subunit 31, which goes to the output register of the exception vector 39. In the subunit of the shaper of the sign of operation 33, the formation of the sign of the operation as a whole is carried out, which is fed to the output register of the sign result 35. The mantissa of the result of the operation goes to the output register of the mantissa of the result 36.

Claims (1)

Устройство предсказания исключительной ситуации «потеря точности» блока операции «умножение с накоплением», включающее подблок предсказания суммы мантисс, счетчик старших нулей суммы мантисс, отличающееся тем, что оно снабжено входными регистрами мантисс чисел В и С, входными регистрами экспонент чисел А, В и С, счетчиком младших нулей мантиссы слагаемого, подблоком вычисления сдвига выравнивания и предсказания сдвига предварительной нормализации, компаратором ранней потери точности, счетчиком младших нулей суммы мантисс, компаратором поздней потери точности, при этом счетчик младших нулей мантиссы слагаемого связан с входным регистром мантиссы числа С для осуществления подсчета числа младших нулей мантиссы слагаемого С и компаратором ранней потери точности для сравнения со сдвигом выравнивания, выходящим из подблока вычисления сдвига выравнивания и предсказания сдвига предварительной нормализации, связанного с входным регистром экспоненты числа А, входным регистром экспоненты числа В и входным регистром экспоненты числа С для получения признака наличия значащих битов выравненной мантиссы слагаемого за пределами разрядности внутреннего представления данных, а компаратор поздней потери точности связан со счетчиком старших нулей суммы мантисс и счетчиком младших нулей суммы мантисс, которые связаны с подблоком предсказания суммы мантисс для получения признака наличия значащих битов мантиссы результата, в отбрасываемой при округлении части. The device for predicting the exception “loss of accuracy” of the operation block “Multiplication with Accumulation”, including a subblock for predicting the sum of mantissas, a counter of leading zeros of the sum of mantissas, characterized in that it is equipped with input mantissas registers of numbers B and C, input registers of exponents of numbers A, B and C, counter of the least zeros of the term mantissa, a subblock for calculating the alignment shift and prediction of the preliminary normalization shift, an early accuracy loss comparator, the counter of the least zeros of the mantissa sum, comparato ohms of late accuracy loss, while the counter of the lowest zeros of the term mantissa is associated with the input register of the mantissa of the number C to calculate the number of the lowest zeros of the mantissa of the term C and the early accuracy loss comparator for comparison with the alignment shift coming out of the subunit of calculating the alignment shift and predicting the preliminary normalization shift associated with the input register of the exponent of number A, the input register of the exponent of number B and the input register of the exponent of number C to obtain the sign of the presence of of bits of the aligned mantissa of the term beyond the bit depth of the internal representation of the data, and the late accuracy loss comparator is associated with the counter of the leading zeros of the sum of the mantissas and the counter of the lowest zeros of the sum of the mantissas, which are associated with the prediction subunit of the mantissa sum to obtain the sign of the presence of significant bits of the mantissa of the result in the discarded rounding parts.
RU2012130917/08A 2012-07-20 2012-07-20 Device to predict exceptional situation "accuracy loss" of "multiplication with accumulation" operation unit RU2498392C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2012130917/08A RU2498392C1 (en) 2012-07-20 2012-07-20 Device to predict exceptional situation "accuracy loss" of "multiplication with accumulation" operation unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2012130917/08A RU2498392C1 (en) 2012-07-20 2012-07-20 Device to predict exceptional situation "accuracy loss" of "multiplication with accumulation" operation unit

Publications (1)

Publication Number Publication Date
RU2498392C1 true RU2498392C1 (en) 2013-11-10

Family

ID=49683326

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2012130917/08A RU2498392C1 (en) 2012-07-20 2012-07-20 Device to predict exceptional situation "accuracy loss" of "multiplication with accumulation" operation unit

Country Status (1)

Country Link
RU (1) RU2498392C1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SU1367012A1 (en) * 1985-12-30 1988-01-15 Институт Проблем Моделирования В Энергетике Ан Усср Operational device
US5771183A (en) * 1996-06-28 1998-06-23 Intel Corporation Apparatus and method for computation of sticky bit in a multi-stage shifter used for floating point arithmetic
US6631392B1 (en) * 1999-07-30 2003-10-07 Mips Technologies, Inc. Method and apparatus for predicting floating-point exceptions
US6963894B2 (en) * 2002-04-08 2005-11-08 Intel Corporation Methods and apparatus for predicting an underflow condition associated with a floating-point multiply-add operation
RU2292580C2 (en) * 2004-12-14 2007-01-27 Государственное образовательное учреждение высшего профессионального образования Курский государственный технический университет Arithmetic computing device
US7392274B2 (en) * 2001-03-14 2008-06-24 Micron Technology, Inc. Multi-function floating point arithmetic pipeline
RU2427897C2 (en) * 2008-06-30 2011-08-27 Интел Корпорейшн Efficient parallel processing of exception with floating point in processor

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SU1367012A1 (en) * 1985-12-30 1988-01-15 Институт Проблем Моделирования В Энергетике Ан Усср Operational device
US5771183A (en) * 1996-06-28 1998-06-23 Intel Corporation Apparatus and method for computation of sticky bit in a multi-stage shifter used for floating point arithmetic
US6631392B1 (en) * 1999-07-30 2003-10-07 Mips Technologies, Inc. Method and apparatus for predicting floating-point exceptions
US7392274B2 (en) * 2001-03-14 2008-06-24 Micron Technology, Inc. Multi-function floating point arithmetic pipeline
US6963894B2 (en) * 2002-04-08 2005-11-08 Intel Corporation Methods and apparatus for predicting an underflow condition associated with a floating-point multiply-add operation
RU2292580C2 (en) * 2004-12-14 2007-01-27 Государственное образовательное учреждение высшего профессионального образования Курский государственный технический университет Arithmetic computing device
RU2427897C2 (en) * 2008-06-30 2011-08-27 Интел Корпорейшн Efficient parallel processing of exception with floating point in processor

Similar Documents

Publication Publication Date Title
Carlough et al. The IBM zEnterprise-196 decimal floating-point accelerator
US5880984A (en) Method and apparatus for performing high-precision multiply-add calculations using independent multiply and add instruments
US8965945B2 (en) Apparatus and method for performing floating point addition
US8402078B2 (en) Method, system and computer program product for determining required precision in fixed-point divide operations
CN104899004B (en) A kind of data processing equipment and method for floating-point operation number to be multiplied
US10303438B2 (en) Fused-multiply-add floating-point operations on 128 bit wide operands
US10379860B2 (en) Inference based condition code generation
US20110231460A1 (en) Apparatus and method for floating-point fused multiply add
US8751555B2 (en) Rounding unit for decimal floating-point division
US8239441B2 (en) Leading zero estimation modification for unfused rounding catastrophic cancellation
US20210019116A1 (en) Floating point unit for exponential function implementation
CN108694037B (en) Apparatus and method for estimating shift amount when floating point subtraction is performed
WO2017070710A1 (en) Apparatus for calculating and retaining a bound on error during floating point operations and methods thereof
Quinnell et al. Bridge floating-point fused multiply-add design
US20070038693A1 (en) Method and Processor for Performing a Floating-Point Instruction Within a Processor
GB2511314A (en) Fast fused-multiply-add pipeline
RU2498392C1 (en) Device to predict exceptional situation &#34;accuracy loss&#34; of &#34;multiplication with accumulation&#34; operation unit
Tsen et al. A combined decimal and binary floating-point multiplier
US8713084B2 (en) Method, system and computer program product for verifying floating point divide operation results
US20090216825A1 (en) Method, system and computer program product for detecting errors in fixed point division operation results
CN112214196A (en) Floating point exception handling method and device
US11023230B2 (en) Apparatus for calculating and retaining a bound on error during floating-point operations and methods thereof
JP3495173B2 (en) Arithmetic processing method and arithmetic processing device
US20120191955A1 (en) Method and system for floating point acceleration on fixed point digital signal processors
US20220357925A1 (en) Arithmetic processing device and arithmetic method

Legal Events

Date Code Title Description
MM4A The patent is invalid due to non-payment of fees

Effective date: 20170721

NF4A Reinstatement of patent

Effective date: 20190621