SU995088A1 - Device for rounding number in binary code - Google Patents

Device for rounding number in binary code Download PDF

Info

Publication number
SU995088A1
SU995088A1 SU813329770A SU3329770A SU995088A1 SU 995088 A1 SU995088 A1 SU 995088A1 SU 813329770 A SU813329770 A SU 813329770A SU 3329770 A SU3329770 A SU 3329770A SU 995088 A1 SU995088 A1 SU 995088A1
Authority
SU
USSR - Soviet Union
Prior art keywords
input
output
rounding
sign
additional
Prior art date
Application number
SU813329770A
Other languages
Russian (ru)
Inventor
Евгений Алексеевич Яворовский
Original Assignee
Yavorovskij Evgenij A
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 Yavorovskij Evgenij A filed Critical Yavorovskij Evgenij A
Priority to SU813329770A priority Critical patent/SU995088A1/en
Application granted granted Critical
Publication of SU995088A1 publication Critical patent/SU995088A1/en

Links

Landscapes

  • Complex Calculations (AREA)

Description

Изобретение относитс  к хшФровой вЬнИслительной технике и может быть использовано в вычислительных машинах и устройствах с noBtaaeHmatK требованийми к точности вычислений, особенно в случае paCbmii с алгебраическими. числами г представлениши в любой из-: вестной двоичной , Извесзтно устройства округлени  числаГ, содержащее регистр результата с подсуммиру1а1вим входом младшего раз р да и дополнительнЕЮ: разр ды/ в котором округление состоит в подеуммировании к результату содёржимои о .стар шего из рт }расываемых ра зр дхов {1 Недостатком известного устройства  вл етс , то, что погрешность округле ни  независимо от знака числа может быть как положительной/ так и отрицательной , если она по абсолютной величине меньше половины веса младшего разр да. В. случае равенства половине веса млгщшегр разр да погрешность экстремальна (максимальна по абсолютной величине) и имеет знак, противоположный знаку числа, если оно представлено пр мым кодс ч, и отрицательный знак, если - дополнительный. Это приводит к тому, что погрешность округлени  носит систематический характер и происходит накопление ошибок округлени . Наиболее близким по технической , сущности к предлагаемс лу  вл етс  устройство дл  округлени  числа, содержащее элек|енты И ИЛИ, регистр результатов с дополните ль ньми разр дам 2. Известное устройство позвол ет уменьшить погрешность суьокы положительных округленных /чисел и устранить ее систематическое. сме цение, но значительно усложн ет устройство. Недостатком известного устройства  вл етс  и то, что погрешность округлени  неоптимальна, так как возможно накопление ойжбки округлени , когда действи  над округленньми числами и знак последних не определены. Оптимальна  погрешность, т.е. строга  статическа  несме)щенность погрешности при выполнении над алгебраическими округленными числами Любых операций в любой последовательности, возможна не при чередовании знака экстремальной погрешности, а при случайном равновесю тном его по влении. Цель изобретени  - расширение области применени  за счет возможности округлени  числа в обратном коде при упрощении и повышении точности. Указанна  цель достигаетс  тем, что в устройстве дл  округлени  числа в двоичном коде,содержащем регист результата с дополнительными разр да ми, элементьа И и ИЛИ, причем входы первого элемента ИЛИ подключены к вы ходам всех дополнительных разр дов эегистра результата, исключа  старший дополнительный разр д соответственно , выход первого элемента ИЛИ под ключен к первому входу первого элемен та И, второй вход которого подклкгчен к Выходу старшего дополнительного ра р да регистра результата, выход первого элемента И подключен к первому входу второго элемента ИЛИ, выход которого подключен к счетному входу триггера младшего разр да регистра результата, входы второго элемента И подключены к выходу знакового разр да регистра результата и к управл ютему входу пр мого и обратного кодов устройства соответственно, выход второго элемента И подключен к первому дополнительному входу первого элемента ИЛИ, второй дополнительный вход которого подключен к выходу младшего разр да регистра результата, входы третьего элемента. И подключены к входам первого элемента ИЛИ соответствен но, а выход третьего элемента И подключен к второму входу второго элемента ИЛИ. На чертеже представлена структурно функциональна  схема устройства. Устройство содержит регистр 1- результатов , элемент И 2, счетный вход 3 триггера младшего разр да 4 регистра результата, элемент ИЛИ 5, старший дополнительный разр д б, группы допол нительных разр дов 7, знаковый разр д 8, элементы И 9, ИЛИ 10, И 11, управ .лающий вход 12. Устройство работает следуюищм образом . Округление положительных и отрицат тельных чисел, представленных в пр мом или дополнительном двоичном коде, состоит в прибавлении поправки к сохран емым разр дам числа, значени  ко торых записаны в регистре 1 результата .. Поправка формируетс  на элементе И 2, выход которого соединен со счетньом входом 3 триггера младшего разр да 4 регистра 1 результата. Один вход элемента И 2 подключен к вьосоду старшего дополнительного разр да 6. Выходы остальных дополнительных разр дов 7 соединены с входами элемента ИЛИ 5, дополнительный вход которого подключен к выходу триггера младшего разр да 4 регистра 1 результата. Другой вход элемента И 2 подключен к входу элемента ИЛИ 5. Экстремальна  погрешность округлени  имеет место при знав старшем дополнительчени х ном разр де б и О во всех остальных дополнительных разр дах 7. Поскольку содержимое последних и младшего разр дов регистра результата, которое независимо от знака числа, может с равной веро тностью принимать оба значени , подаетс  на входы элемента ИЛИ 5, на его выходе будет значение О в половине случаев возникновени  экстремальной погрешности округлени . Это значение поступает на вход элемента И 2 и запрещает прохождение через другой вход и выход элемента И 2 сигнала , поступаю1цего из старшего дополнительного разр да 6 на вход 3 дл  подсуммировани  с содержимым регистра 1 результата, только в половине случаев экстремальной погрешности. Последним обеспечиваетс  равноверо тность знака экстремальной погрешности и независимость его от знака числа, а в целом - несмещенность погрешности. Во всех ос-тальных случа х прохождение сигнала через элемент И 2 не запрещено,так как на выходе элемента ИЛИ 5 будет значение .Учет знака числа необходим при округлении чисел, представленных в обратной двоичном коде, так как экстремальна  погрешность округлени .отрицательных чисел: воэникает при иных значени , а именно - О в стараием и во всех остальных дополнительных разр дах. Дл  округлени  чисел в обратном коде элемент ИЛИ 5 дополнен входом, который соединен с выхо дом знакового разр да 8. Входы эле мента И 9 попарно объединены с входагми элемента ИЛИ 5, а выход соединен. с входом элемента ИЛИ Ю, Выход эле-мента И 2 соединен с другим входом дополнительного элемента ИЛИ 10, выход которого соединен с входом 3, Устройство, использу  элемент И 11, вход которого соединен с выходом зна кового разр да 8, а выход - с соотватствуюцими попарно объединенньми входами элемента ИЛИ 5, и элемент И 9, выполн ет округление числа в пр мом и дополнительном кодах: если на управл ющем входе 12 элемента И 11 значение О - в пр мом, а если зна , то - в обратном. Технико-экономический эффект выражаетс  в построении универсального устройства .дл  округлени  числа в двоичном коде, которое выполн ет округление алгебраических чисел с любой из известных форм представлени  знака - пр мым, дополнительным или обратным кодом - с минимально возможной погрешностью, не превышающей половины веса младшего разр да. При этом обеспечиваетс  строга  несмещенность погрешности, т.е. ноль математического ожидани  ее независимо от знака округл емых чисел. По сравнению с прототипом предлагаемое устройство упрощено.The invention relates to computer technology and can be used in computing machines and devices with noBtaaeHmatK computational accuracy requirements, especially in the case of paCbmii with algebraic ones. numbers of a representation in any known: known binary, izvesztno number-rounding device, containing the result register with the subdivision 1 and 1 input of the least significant number and additional: bits / in which the rounding consists in summing to the result of the content of Sponsor {1 The disadvantage of the known device is that the error is rounded off regardless of the sign of the number can be both positive and negative, if it is in absolute value less than half the weight of the least significant bit. B. If the case is equal to half the weight of the discharge bit, the error is extreme (maximum in absolute value) and has a sign opposite to the sign of the number if it is represented by a direct code and negative sign if it is additional. This leads to the fact that the error of rounding is systematic and the accumulation of rounding errors occurs. The closest in technical terms to the invention is a device for rounding a number, containing the elements AND OR, a register of results with additions of digits 2. The known device allows reducing the suioki of positive rounded numbers / numbers and eliminating it systematically. a mixture, but significantly complicates the device. A disadvantage of the known device is that the rounding error is not optimal, since accumulation of rounding is possible when actions on round numbers and the sign of the latter are not determined. The optimal error, i.e. Strictly static inconsistency of error when performing any operations on algebraic rounded numbers in any sequence, is possible not with the alternation of the sign of extreme error, but with a random equilibrium of its appearance. The purpose of the invention is the expansion of the field of application due to the possibility of rounding a number in the reverse code while simplifying and increasing accuracy. This goal is achieved by the fact that in the device for rounding a number in binary code containing a register of the result with additional bits, the AND and OR elements, and the inputs of the first OR element are connected to the outputs of all the additional bits of the result egor, excluding the highest additional bit accordingly, the output of the first element OR is connected to the first input of the first element I, the second input of which is connected to the Output of the higher secondary row of the result register, the output of the first element I connected to the first the input of the second element OR, the output of which is connected to the counting input of the low-order trigger trigger of the result register, the inputs of the second element AND is connected to the output of the sign bit of the result register and to the control input of the forward and reverse device codes, respectively, the output of the second element AND is connected to the first an additional input of the first element OR, the second additional input of which is connected to the output of the lower digit of the result register, the inputs of the third element. And they are connected to the inputs of the first element OR, respectively, and the output of the third element AND is connected to the second input of the second element OR. The drawing shows a structurally functional diagram of the device. The device contains a register of 1-results, an element AND 2, a counting input 3 trigger low-order 4 registers of the result, an element OR 5, a higher additional bit, a group of additional bits 7, a sign bit 8, elements AND 9, OR 10 , And 11, control input 12. The device operates as follows. The rounding of positive and negative numbers represented in the forward or supplemental binary code consists in adding an amendment to the stored bits of the numbers whose values are recorded in the result register 1. The correction is formed on the AND 2 element whose output is connected to the same input 3 triggers for low-order 4 registers of 1 result. One input of the AND 2 element is connected to the high-order extra bit 6 output. The outputs of the remaining additional bits 7 are connected to the inputs of the OR 5 element, the additional input of which is connected to the output of the low-order trigger 4 of the 1 register of the result. The other input of the element AND 2 is connected to the input of the element OR 5. Extreme rounding error occurs when you know the highest subdivision B and O in all the other additional bits 7. Because the contents of the last and lower bits of the result register, which, regardless of the sign the numbers, with equal probability, can take both values, is fed to the inputs of the element OR 5, its output will be the value O in half the cases of the occurrence of extreme rounding error. This value is fed to the input of the AND 2 element and prohibits the passage through the other input and output of the AND 2 element of the signal coming from the highest additional bit 6 to the input 3 to be summed with the contents of the result register 1, only in half of cases of extreme error. The latter ensures the equilibrium of the sign of the extreme error and its independence from the sign of the number, and, in general, the unbiasedness of the error. In all other cases, the signal passing through the AND 2 element is not prohibited, since the output of the OR 5 element will be the value. Sign of the number sign is necessary when rounding numbers represented in the reverse binary code, since the extreme rounding error of negative numbers: with other values, namely - O in the effort and in all other additional categories. To round numbers in the reverse code, the OR 5 element is supplemented with an input that is connected to the output of the sign bit 8. The inputs of the AND 9 element are pairwise combined with the inputs of the OR 5 element, and the output is connected. with the input of the element OR H, the output of the element AND 2 is connected to another input of the additional element OR 10, the output of which is connected to input 3, the device using element 11 and the input of which is connected to the output of sign bit 8, and the output from by matching the pairwise combined inputs of the element OR 5, and the element AND 9, rounds the number in the forward and additional codes: if the control input 12 of the element 11 and 11 is O, it is in the forward, and if it is, then in the opposite. The technical and economic effect is expressed in constructing a universal device for rounding numbers in binary code that rounds off algebraic numbers from any of the known forms of representation of a sign — direct, additional, or reverse code — with the minimum possible error not exceeding half the weight of the least significant bit. Yes. In this case, a strict unbiasedness of the error, i.e. zero is the mathematical expectation of it regardless of the sign of the rounded numbers. Compared with the prototype of the proposed device is simplified.

Claims (2)

1.Карцев М.А. Арифметика цифровых машин. М., Наука,1969,с.327-328.1.Kartsev M.A. Arithmetic of digital machines. M., Science, 1969, p.327-328. 2.TiBTOpcKoe свидетельство СССР2.TiBTOpcKoe certificate of the USSR 771667, кл. G 06 F 7/38, 1978 (прототип ) . 771667, class G 06 F 7/38, 1978 (prototype). ffff ////
SU813329770A 1981-08-25 1981-08-25 Device for rounding number in binary code SU995088A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
SU813329770A SU995088A1 (en) 1981-08-25 1981-08-25 Device for rounding number in binary code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
SU813329770A SU995088A1 (en) 1981-08-25 1981-08-25 Device for rounding number in binary code

Publications (1)

Publication Number Publication Date
SU995088A1 true SU995088A1 (en) 1983-02-07

Family

ID=20973736

Family Applications (1)

Application Number Title Priority Date Filing Date
SU813329770A SU995088A1 (en) 1981-08-25 1981-08-25 Device for rounding number in binary code

Country Status (1)

Country Link
SU (1) SU995088A1 (en)

Similar Documents

Publication Publication Date Title
SU995088A1 (en) Device for rounding number in binary code
GB1179274A (en) An Improvement relating to the Justification of Operands in an Arithmetic Unit.
SU794634A1 (en) Device for multiplying series code by fractional factor
SU773621A1 (en) Device for multiplying multidigit numbers
SU798799A1 (en) Decimal-to-inverse code converter
SU593211A1 (en) Digital computer
US3551664A (en) Bearing angle computer
SU1097999A1 (en) Device for dividing n-digit numbers
SU771667A1 (en) Device for approximating number
SU549808A1 (en) Dividing device
SU783787A1 (en) Converter of binary code into binary-decimal code of degrees and minutes
SU805303A1 (en) Digital device for taking antilogarithms
Gander et al. Computing with Multiple Precision
SU1265763A1 (en) Dividing device
SU437069A1 (en) Binary to binary converter
SU553614A1 (en) Multiplying-dividing device
SU811274A1 (en) Device for solving systems of linear algebraic equations
SU758152A1 (en) Device for dividing decimal numbers
SU1273918A1 (en) Adding-subtracting device
SU650072A1 (en) Arithmetic device
SU824203A1 (en) Device for adding n-digit decimal numbers
SU451078A1 (en) DEVICE FOR COMPOSITION-CALCULATION OF BINARY NUMBERS
SU620972A1 (en) Arrangement for shifting to the left by p digits reed-muller (n, k) codes
SU752355A1 (en) Probabilistic device for dividing numbers
SU424147A1 (en) DEVICE FOR DIVIDING BINARY NUMBERS