RU2410746C1 - Method and device for subtracting binary codes - Google Patents
Method and device for subtracting binary codes Download PDFInfo
- Publication number
- RU2410746C1 RU2410746C1 RU2010104306/08A RU2010104306A RU2410746C1 RU 2410746 C1 RU2410746 C1 RU 2410746C1 RU 2010104306/08 A RU2010104306/08 A RU 2010104306/08A RU 2010104306 A RU2010104306 A RU 2010104306A RU 2410746 C1 RU2410746 C1 RU 2410746C1
- Authority
- RU
- Russia
- Prior art keywords
- input
- output
- trigger
- potential
- loan
- Prior art date
Links
Images
Abstract
Description
Изобретение относится к области вычислительной техники и может быть использовано в процессорных устройствах ЭВМ и в устройствах цифровой автоматики. Известны способы и устройства вычитания двоичных кодов, содержащие триггерные регистры, логические элементы И, ИЛИ, НЕ и входы управления работой устройства. Варианты способов и устройств вычитания рассмотрены в книге Карцева М.А., «Арифметика цифровых машин», изд. Наука, 1969 г., стр.288-297, рис 3-1а, стр 294. Устройство, приведенное на рис.3-1а, стр.294, является ближайшим прототипом предлагаемого устройства. В указанном источнике операция вычитания выполняется на основе оборудования, предназначенного для выполнения операции сложения двоичных кодов, сделана оценка вариантов алгебраического вычитания в прямых, дополнительных и обратных кодах. При этом существенных преимуществ в сокращении времени вычитания не приводится. Основные элементарные операции (ЭО), выполняемые в известных устройствах при вычитании, следующие: прием вычитаемого, обращение (инвертирование) кода вычитаемого, формирование переноса и суммы, занесение результата суммирования в регистр уменьшаемого и прибавление единицы к коду младшего разряда устройства. Указанный перечень выполняемых ЭО определяет быстродействие операции вычитания. Это следует считать недостатком известных способов и устройств выполнения вычитания. Предлагаемый способ и устройство снижают этот недостаток.The invention relates to the field of computer technology and can be used in computer processing devices and digital automation devices. Known methods and devices for subtracting binary codes containing trigger registers, logical elements AND, OR, NOT and inputs for controlling the operation of the device. Variants of methods and devices for subtraction are considered in the book of Kartsev MA, “Arithmetic of digital machines”, ed. Science, 1969, pp. 288-297, Figure 3-1a, page 294. The device shown in Figure 3-1a, page 294, is the closest prototype of the proposed device. In the indicated source, the subtraction operation is performed on the basis of equipment designed to perform the operation of adding binary codes, an assessment is made of the options for algebraic subtraction in direct, additional and inverse codes. At the same time, there are no significant advantages in reducing the time of subtraction. The basic elementary operations (EO) performed in known devices during subtraction are as follows: receiving the deductible, reversing (inverting) the code of the deductible, generating the transfer and amount, entering the result of summing into the register of the deductible, and adding the unit to the low-order code of the device. The specified list of performed EA determines the speed of the subtraction operation. This should be considered a disadvantage of the known methods and devices for performing subtraction. The proposed method and device reduce this disadvantage.
Целью предлагаемого способа и устройства является повышение быстродействия выполнения операции вычитания за счет совмещения во времени выполнения ЭО приема вычитаемого и формирования потенциала заема, а также исключения затрат времени на выполнение первого обращения вычитаемого. Для этого предложен способ вычитания двоичных кодов, отличающийся тем, что операцию выполняют с кодом чисел, имеющих равные значения знаков уменьшаемого и вычитаемого, при этом уменьшаемое хранят в прямом коде в первом триггерном регистре А, по первому временному такту выполняют прием вычитаемого, поступающего по информационным входам в прямом коде, путем выполнения первой операции логического умножения потенциалов информационного входа и первого входа управления приемом кода вычитаемого во второй триггерный регистр В, если результат упомянутой операции i-того разряда равен единице, то первый триггер Ai устанавливают в нуль; выполняют вторую операцию логического умножения потенциалов первой операции логического умножения и инверсного значения выхода первого триггера Ai, если результат второй операции логического умножения равен единице, то этот потенциал подают на первый вход третьего элемента И и через первый элемент НЕ - на первый вход четвертого элемента И, на вторые входы упомянутых элементов И подают исполнительный импульс второго входа управления парафазным приемом вычитаемого во второй триггерный регистр В, при этом второй триггер Bi устанавливают в единицу, кроме того, потенциал первой операции логического умножения подключают к входу четвертого элемента ИЛИ, потенциал второй операции логического умножения подключают к первому входу первого элемента ИЛИ, к второму входу которого подключают потенциал заема из i-1-го разряда; потенциал инверсного значения первого триггера Ai подключают к первому входу второго элемента ИЛИ, второй вход которого подключают к выходу пятого элемента И, потенциал выхода которого является результатом третьей операции логического умножения потенциалов единичного выхода первого триггера Ai, подключенного к второму входу пятого элемента И через третий элемент ИЛИ и двенадцатый элемент И, и потенциала первой операции логического умножения, результат четвертой операции логического умножения потенциалов с выходов первого и второго элементов ИЛИ является входом потенциала заема в i+1-тый разряд; по истечении максимальной временной задержки сигнала заема единицы в старших разрядах, по второму временному такту поддерживают потенциал заема, выработанный в i-том разряде по первому временному такту, за счет передачи потенциала единичного выхода второго триггера Bi через тринадцатый элемент И, к второму входу которого подключают третий вход управления формированием потенциала заема по второму временному такту, выход тринадцатого элемента И соединяют с третьим входом первого элемента ИЛИ; одновременно с сохранением выработанных потенциалов заемов, подают на четвертый вход управления формированием результата вычитания в триггерах первого регистра А исполнительный импульс, который инвертирует код первого триггера Ai, если из i-1-го разряда поступил потенциал заема или потенциал единичного выхода второго триггера Bi равен единице; если упомянутые потенциалы в i-том разряде присутствуют одновременно, то инверсное значение результата пятой операции логического умножения потенциалов заема i-1-го разряда и единичного выхода второго триггера Bi запрещают инвертирование первого триггера Ai; также по второму временному такту при наличии потенциала заема из самого старшего разряда, устанавливают в единицу триггер хранения потенциала упомянутого заема и формируют знак кода первого регистра А путем сложения по модулю два кода триггера знака упомянутого регистра с потенциалом заема из самого старшего разряда, кроме того, при нулевых значениях всех триггеров регистра А устанавливают в нуль триггер знака кода первого регистра А; по третьему временному такту формируют потенциал циклического заема единицы, если триггер хранения потенциала заема из самого старшего разряда установлен предыдущим временным тактом в единицу, упомянутый потенциал с единичного выхода третьего триггера через четырнадцатый элемент И, на второй вход которого через пятнадцатый элемент ИЛИ подключают входы третьего и четвертого временных тактов, соединяют с входами первого элемента ИЛИ и третьего элемента НЕ самого младшего разряда, выход третьего элемента НЕ запрещает работу седьмого элемента И, проходит во второй разряд, если первый триггер первого разряда хранит код нуля, и запрещает работу седьмого элемента И второго разряда, по четвертому временному такту выполняют инвертирование триггеров регистра А и добавление единицы к первому разряду устройства, для этого на пятый вход управления инвертированием кода регистра А подают исполнительный импульс, который подключают к первому входу седьмых элементов И, второй вход которых соединяют с выходами третьих элементов НЕ каждого разряда, вход этого элемента НЕ подключают к входу потенциала заема кода из младшего разряда или к входу потенциала циклического заема в первом разряде, выход седьмого элемента И через пятый и четвертый элементы ИЛИ соединяют со счетным входом первого триггера Ai, при отсутствии потенциала заема из младшего разряда, исполнительный импульс инвертирования поступит на счетный вход первого триггера Ai и выполнит инвертирование кода, хранящегося в этом триггере, если в младший разряд поступил потенциал циклического заема и первый триггер первого разряда хранит код нуля, то упомянутый триггер не будет проинвертирован; если группа триггеров A1, A2, A3 и т.д. хранит коды нулей, то эти триггеры не будут инвертироваться, также не будет инвертироваться первый триггер, хранящий код единицы после окончания группы триггеров с нулевыми значениями кодов, на этом операцию вычитания заканчивают, результат вычитания хранят в первом регистре А в прямом коде.The aim of the proposed method and device is to increase the speed of the subtraction operation by combining in the time of execution of the EA the receipt of the deductible and the formation of the potential of the loan, as well as eliminating the time spent on the first appeal of the deductible. For this, a method for subtracting binary codes is proposed, characterized in that the operation is performed with a code of numbers having equal sign values of the decremented and subtracted, while the decremented is stored in the direct code in the first trigger register A, the first subtract is received by the subtracted, received by information the inputs in the direct code, by performing the first operation of logical multiplication of the potentials of the information input and the first input of the reception control of the code subtracted into the second trigger register B, if the result said operation of the i-th discharge is equal to one, then the first trigger Ai is set to zero; perform the second operation of logical multiplication of the potentials of the first operation of logical multiplication and the inverse value of the output of the first trigger Ai, if the result of the second operation of logical multiplication is equal to one, then this potential is fed to the first input of the third element And and through the first element NOT to the first input of the fourth element And, to the second inputs of the mentioned elements And serves the Executive pulse of the second input control paraphase reception deducted in the second trigger register B, while the second trigger Bi is set to unit, in addition, the potential of the first logical multiplication operation is connected to the input of the fourth OR element, the potential of the second logical multiplication operation is connected to the first input of the first OR element, to the second input of which the loan potential from the i-1st category is connected; the potential of the inverse value of the first trigger Ai is connected to the first input of the second OR element, the second input of which is connected to the output of the fifth element And, the output potential of which is the result of the third logical multiplication of the potentials of the unit output of the first trigger Ai connected to the second input of the fifth element And through the third element OR and the twelfth element AND, and the potential of the first logical multiplication operation, the result of the fourth logical multiplication operation of potentials from the outputs of the first and second electronic of items OR is the input of the loan potential in the i + 1-st category; after the maximum time delay of the loan signal of the unit in the senior bits, the second time cycle maintains the loan potential developed in the i-th category according to the first time cycle, by transmitting the potential of the single output of the second trigger Bi through the thirteenth element And, to the second input of which the third input of the formation of the potential of the loan by the second time step, the output of the thirteenth element And is connected to the third input of the first element OR; simultaneously with preservation of the developed potentials of loans, an executive pulse is fed to the fourth control input for generating the result of subtraction in the triggers of the first register A, which inverts the code of the first trigger Ai, if the loan potential or the single output potential of the second trigger Bi is equal to unity ; if the above potentials are present in the i-th category at the same time, then the inverse value of the result of the fifth operation of logical multiplication of the loan potentials of the i-1st category and the unit output of the second trigger Bi forbid the inversion of the first trigger Ai; also, according to the second time step, if there is a loan potential from the most senior level, a storage trigger for the potential of the loan is set to one and the first register code A is formed by modulo addition of two sign trigger codes of the register register with the loan potential from the highest level, in addition at zero values of all the triggers of register A, set the code sign trigger of the first register A to zero; according to the third time step, the potential of the unit loan is formed if the trigger for storing the loan potential from the highest level is set to the unit by the previous time step, the mentioned potential from the unit output of the third trigger through the fourteenth AND element, to the second input of which through the fifteenth OR element the inputs of the third and the fourth time clock, connected to the inputs of the first element OR and the third element NOT the least significant bit, the output of the third element DOES NOT prohibit the seventh e And the element goes to the second digit, if the first trigger of the first digit stores the zero code, and prohibits the seventh element of the second digit, the triggers of the register A are added and the unit is added to the first bit of the device according to the fourth time step, for this, the invert control has the fifth input code of register A, an actuating pulse is supplied, which is connected to the first input of the seventh AND elements, the second input of which is connected to the outputs of the third elements NOT of each category, the input of this element is NOT connected to the input of the loan potential of the code from the lower order or to the input of the potential of the cyclic loan in the first category, the output of the seventh element And through the fifth and fourth elements OR are connected to the counting input of the first trigger Ai, in the absence of the loan potential from the low order, the inverting executive pulse will go to the counting the input of the first trigger Ai and inverts the code stored in this trigger, if the potential of the cyclic loan is received in the lower digit and the first trigger of the first category stores the zero code, then rigger will not be inverted; if the trigger group is A1, A2, A3, etc. stores codes of zeros, then these triggers will not be inverted, nor will the first trigger that stores the unit code after the end of the group of triggers with zero code values be inverted, the subtraction operation is completed, the subtraction result is stored in the first register A in the direct code.
Также предложено устройство вычитания двоичных кодов, содержащее первый n-разрядный триггерный регистр уменьшаемого А, второй n-разрядный триггерный регистр вычитаемого В, выполненное на элементах И, ИЛИ, НЕ и RS-триггерах, содержащее в каждом двоичном разряде тринадцать элементов И, шесть элементов ИЛИ, шесть элементов НЕ, два RS-триггера, информационный вход, пять входов управления, отличающееся тем, что информационный вход i-того разряда соединен с первым входом первого элемента И, второй вход первого элемента И связан с первым входом управления приемом кода вычитаемого во второй триггерный регистр В, выход первого элемента И соединен с первыми входами второго и пятого элементов И и четвертого элемента ИЛИ, второй вход второго элемента И соединен с выходом четвертого элемента НЕ и первым входом второго элемента ИЛИ, выход второго элемента И соединен с первым входом первого элемента ИЛИ, с первым входом третьего элемента И и входом первого элемента НЕ, выход которого соединен с первым входом четвертого элемента И, вторые входы третьего и четвертого элементов И всех разрядов и нулевой вход триггера хранения потенциала заема из самого старшего разряда связаны с вторым входом управления парафазным приемом вычитаемого во второй триггерный регистр В, выходы упомянутых элементов И соединены с единичным и нулевым входами второго триггера Bi, единичный выход которого соединен с первыми входами шестого элемента ИЛИ, десятого и тринадцатого элементов И, второй вход тринадцатого элемента И соединен с третьим входом управления формированием потенциала заема по второму временному такту, вход заема из младшего разряда соединен с вторым входом первого элемента ИЛИ, с входом третьего элемента НЕ и с вторыми входами десятого элемента И и шестого элемента ИЛИ, выход которого соединен с первым входом одиннадцатого элемента И, выход десятого элемента И через второй элемент НЕ связан с вторым входом одиннадцатого элемента И, третий вход которого подключен к четвертому входу управления формированием результата вычитания в триггерах первого регистра А, выход третьего элемента НЕ соединен с первым входом седьмого элемента И, второй вход которого подключен к пятому входу управления инвертированием кода триггеров регистра А, выходы одиннадцатого и седьмого элементов И соединены с входами пятого элемента ИЛИ, выход которого подключен к первым входам четвертого элемента ИЛИ и девятого элемента И, выход четвертого элемента ИЛИ соединен с первым входом восьмого элемента И, выходы восьмого и девятого элементов И через пятый и шестой элементы НЕ подключены к нулевому и единичному входам первого RS-триггера, выход восьмого элемента И соединен с первым входом третьего элемента ИЛИ, второй вход которого подключен к единичному выходу первого RS-триггера, выход третьего элемента ИЛИ соединен с первым входом двенадцатого элемента И, второй вход которого подключен к выходу шестого элемента НЕ, выход двенадцатого элемента И соединен с вторыми входами восьмого и пятого элементов И и входом четвертого элемента НЕ, выход четвертого элемента НЕ подключен к первому входу девятого элемента И, выходы первого и второго элементов ИЛИ соединены с входами шестого элемента И, выход которого является потенциалом заема единицы из старших разрядов и подключен к второму входу первого элемента ИЛИ, третьего элемента НЕ, к вторым входам шестого элемента ИЛИ и десятого элемента И i+1-го разряда, устройство также содержит третий и четвертый RS-триггеры хранения потенциалов заема из самого старшего разряда и знака кода первого регистра А соответственно, при этом входы пятнадцатого элемента И соединены с четвертым входом управления и выходом потенциала заема из самого старшего разряда, выход пятнадцатого элемента И через двадцатый элемент ИЛИ, семнадцатый И, двадцать шестой элемент НЕ соединен с нулевым входом четвертого RS-триггера; через элементы восемнадцатый И, двадцать седьмой НЕ выход пятнадцатого элемента И связан с единичным входом четвертого RS-триггера, выход семнадцатого И соединен с двадцать первым ИЛИ, второй его вход подключен к единичному выходу четвертого RS-триггера, выход которого соединен с первым входом девятнадцатого элемента И, второй его вход подключен к выходу двадцать седьмого НЕ, выход девятнадцатого элемента И соединен с входами двадцать восьмого элемента НЕ и семнадцатого элемента И, выход упомянутого элемента НЕ соединен с входом восемнадцатого элемента И, перечисленные элементы и связи обеспечивают работу четвертого триггера в режиме счета импульсов, кроме того, выход пятнадцатого элемента И связан с единичным входом третьего RS-триггера; входы двадцатого элемента И соединены с выходами четвертых элементов НЕ всех разрядов устройства, сигнал с выхода этого элемента является признаком наличия нулевых значений первых триггеров всех разрядов и соединен с первым входом шестнадцатого элемента И, второй вход которого соединен с четвертым входом управления формированием результата вычитания в триггерах регистра А, выход шестнадцатого элемента И через элементы двадцатый ИЛИ, семнадцатый И, двадцать шестой НЕ соединен с нулевым входом четвертого RS-триггера, при этом входы третьего и четвертого временных тактов через двадцать второй элемент ИЛИ соединены с входом четырнадцатого элемента И, второй его вход соединен с единичным выходом третьего RS-триггера, выход четырнадцатого элемента И является потенциалом циклического заема и соединен с входами первого элемента ИЛИ и третьего элемента НЕ самого младшего разряда.Also proposed is a device for subtracting binary codes containing the first n-bit trigger register of decrementable A, the second n-bit trigger register of subtractable B, executed on the elements AND, OR, NOT and RS-triggers, containing thirteen elements AND, six elements in each bit OR, six elements NOT, two RS-flip-flops, information input, five control inputs, characterized in that the information input of the i-th category is connected to the first input of the first element And, the second input of the first element And is connected to the first input of the control receiving the code subtracted into the second trigger register B, the output of the first AND element is connected to the first inputs of the second and fifth AND elements and the fourth OR element, the second input of the second AND element is connected to the output of the fourth NOT element and the first input of the second OR element, the output of the second AND element connected to the first input of the first OR element, with the first input of the third AND element and the input of the first element NOT, the output of which is connected to the first input of the fourth AND element, the second inputs of the third and fourth elements AND of all digits and the zero input of the loan potential storage trigger from the highest level is connected to the second input of the paraphase reception deducted into the second trigger register B, the outputs of the mentioned elements AND are connected to the single and zero inputs of the second trigger Bi, whose single output is connected to the first inputs of the sixth OR element, of the tenth and thirteenth elements AND, the second input of the thirteenth element And is connected to the third input of the loan potential formation control according to the second time step, the loan input is from the lower order connected to the second input of the first element OR, with the input of the third element NOT and with the second inputs of the tenth element And the sixth element OR, the output of which is connected to the first input of the eleventh element AND, the output of the tenth element AND through the second element is NOT connected to the second input of the eleventh element AND , the third input of which is connected to the fourth input of the formation of the subtraction result in the triggers of the first register A, the output of the third element is NOT connected to the first input of the seventh element And, the second input of which is connected to to the input of the inversion control code of the triggers of register A, the outputs of the eleventh and seventh elements AND are connected to the inputs of the fifth OR element, the output of which is connected to the first inputs of the fourth OR element and the ninth element, the output of the fourth OR element is connected to the first input of the eighth AND element, the outputs of the eighth and the ninth element AND through the fifth and sixth elements are NOT connected to the zero and single inputs of the first RS-trigger, the output of the eighth AND element is connected to the first input of the third OR element, the second input of which connected to the single output of the first RS-trigger, the output of the third OR element is connected to the first input of the twelfth element AND, the second input of which is connected to the output of the sixth element NOT, the output of the twelfth element AND is connected to the second inputs of the eighth and fifth elements AND and the input of the fourth element NOT, the output of the fourth element is NOT connected to the first input of the ninth AND element, the outputs of the first and second OR elements are connected to the inputs of the sixth AND element, the output of which is the loan potential of a unit from the senior ranks and connect In addition to the second input of the first OR element, the third element NOT, to the second inputs of the sixth OR element and the tenth element AND i + 1 of the 1st category, the device also contains the third and fourth RS-triggers for storing loan potentials from the oldest bit and the first register code sign And accordingly, while the inputs of the fifteenth element And are connected to the fourth control input and the loan potential output from the highest level, the output of the fifteenth element And through the twentieth element OR, the seventeenth And, the twenty-sixth element is NOT connected to the left input of the fourth RS-flip-flop; through the elements of the eighteenth AND, the twenty-seventh NOT output of the fifteenth AND element is connected to the single input of the fourth RS-trigger, the output of the seventeenth And is connected to the twenty-first OR, its second input is connected to the single output of the fourth RS-trigger, the output of which is connected to the first input of the nineteenth element And, its second input is connected to the output of the twenty-seventh NOT, the output of the nineteenth element AND is connected to the inputs of the twenty-eighth element of NOT and the seventeenth element AND, the output of the mentioned element is NOT connected to the input of eight atogo gate AND, listed elements and connections provide a fourth flip-flop operation in the pulse counting mode, moreover, the output of the fifteenth gate AND is connected to a single input of the third RS-trigger; the inputs of the twentieth element AND are connected to the outputs of the fourth elements NOT of all bits of the device, the signal from the output of this element is a sign of the presence of zero values of the first triggers of all bits and is connected to the first input of the sixteenth element And, the second input of which is connected to the fourth input of the control for generating the subtraction result in the triggers register A, the output of the sixteenth element And through the elements the twentieth OR, the seventeenth AND, the twenty-sixth is NOT connected to the zero input of the fourth RS-trigger, while the inputs t its and the fourth time clocks are connected through the twenty-second OR element to the input of the fourteenth AND element, its second input is connected to the single output of the third RS-trigger, the output of the fourteenth AND element is the potential of a cyclic loan and connected to the inputs of the first OR element and the third element NOT of the youngest discharge.
Рассмотрим основные отличительные признаки предлагаемых способа и устройства и покажем, что они обеспечивают.Consider the main distinguishing features of the proposed method and device and show what they provide.
1. Предложенный способ за счет совмещения во времени приема вычитаемого и формирования потенциала заема позволяет выполнить операцию вычитания минимум за два временных такта. В известных устройствах это время равно четырем тактам.1. The proposed method due to the combination in time of receiving the deductible and the formation of the potential of the loan allows you to perform the subtraction operation for at least two time steps. In known devices, this time is equal to four measures.
2. Исключается первое обращение кода вычитаемого.2. The first accession of the deductible code is excluded.
3. В ходе выполнения первого временного такта осуществляется вычитание кода единиц, хранящихся в триггерах регистра А и поступающих по информационным входам одноименных разрядов, что позволяет выполнить операцию вычитания равных кодов за один временной такт. Также за один временной такт выполняется операция вычитания при значении кодов регистра А, равных 11111, 01111, при любых кодах вычитаемого В, меньшего кода А по модулю.3. During the execution of the first time cycle, the code of units stored in the triggers of register A and received at the information inputs of the same category is subtracted, which allows the operation of subtracting equal codes for one time cycle. Also, for one time cycle, a subtraction operation is performed with the value of register codes A equal to 11111, 01111, for any codes of subtracted B, smaller code A modulo.
4. Вторая ЭО логического умножения выполняется за счет соединения выхода первого элемента И с входом четвертого элемента НЕ. Соединение выхода второго элемента И i-того разряда с первым входом первого элемента ИЛИ позволяет начать формирование потенциала заема (ПЗ) во время первого временного такта.4. The second logical multiplication EO is performed by connecting the output of the first AND element to the input of the fourth element NOT. The connection of the output of the second element AND of the i-th category with the first input of the first element OR allows you to begin the formation of the potential of the loan (PZ) during the first time cycle.
На фиг.1 приведена функциональная схема двух разрядов предлагаемого устройства. Каждый разряд содержит элементы И 1-13, элементы ИЛИ 14-19, элементы НЕ 20-25, RS-триггеры (Tr) 26, 27, информационный вход (ИВ) 28, первый - пятый входы управления (ВУ) 29-33, выход потенциала заема из младшего в старший разряд 34, информационные связи определения нулевого значения триггеров первого и второго разрядов регистра А 35, 36…, выход потенциала циклического заема (ПЦЗ), хранящийся в Тr 215, передаваемый в первый разряд 37. На фиг.2. приведена функциональная схема формирования и хранения знака кода первого регистра А Тr 214, триггер хранения потенциала заема из самого старшего разряда устройства Тr 215, элементы И 201-207, элементы ИЛИ 208-210, элементы НЕ 211-213, вход третьего временного такта (ВТ3) 216, вход четвертого временного такта (ВТ4) 217.Figure 1 shows a functional diagram of two bits of the proposed device. Each category contains elements AND 1-13, elements OR 14-19, elements NOT 20-25, RS-flip-flops (Tr) 26, 27, information input (II) 28, the first - fifth control inputs (VU) 29-33, the output of the loan potential from the youngest to the
Рассмотрим работу устройства при выполнении операции вычитания. В исходном состоянии (в статике) в триггерах 26 регистра А хранится прямой код разности, полученной от выполнения предыдущей операции вычитания. В триггере 214 может храниться код знака разности. В Тr 27 регистра В хранится результат второй операции логического умножения предыдущей операции вычитания. Знак кода вычитаемого, принятого в регистр В, всегда совпадает с значением знака уменьшаемого. Полагаем, что засылку уменьшаемого в устройство вычитания выполняет устройство управления (УУ) работой вычислительного комплекса по значению знака уменьшаемого. На входах управления ВУ 29-33 и на информационном входе 28 отсутствуют высокие потенциалы. Операция вычитания выполняется за четыре временных такта ВТ1-ВТ4. Это максимальное время выполнения операции. Минимальное время выполнения вычитания равняется одному временному такту.Consider the operation of the device when performing the subtraction operation. In the initial state (in statics), triggers 26 of register A store the direct code of the difference obtained from the previous subtraction operation. In
По ВТ1 во всех разрядах выполняется первая ЭО логического умножения (ЛУ1) потенциалов ВУ 29 и ИВ 28. Для этого на входы ВУ 29 и ИВ 28 поступают высокие потенциалы. На выходе И1 вырабатывается высокий потенциал. Упомянутый потенциал поступает на ИЛИ 17 и устанавливает Тr 26 в нуль, одновременно упомянутый сигнал поступает на вход И5. При наличии высокого потенциала с выхода И 12, на выходе И5 будет выработан потенциал, который через ИЛИ 5 поступит на вход И6. Выполняется вторая операция ЛУ 2 сигналов с выхода И1 и с выхода НЕ 23. Потенциал результата ЛУ 2 через ИЛИ 14 поступает на второй вход И6, потенциал с выхода этого элемента является потенциалом заема единицы в старших разрядах. Упомянутый потенциал вырабатывается согласно следующему соотношению.According to VT1, in all digits, the first EO of logical multiplication (LU1) of the potentials of VU 29 and IV 28 is performed. For this, high potentials arrive at the inputs of VU 29 and IV 28. At the output of I1, high potential is generated. The mentioned potential goes to OR 17 and sets Tr 26 to zero, at the same time, the mentioned signal goes to the input And5. If there is a high potential from the output And 12, at the output And 5 potential will be developed, which through OR 5 will go to the input And 6. The second operation of LU 2 signals is performed from the output of I1 and from the output of NOT 23. The potential of the result of LU 2 through OR 14 is fed to the second input of I6, the potential from the output of this element is the loan potential of the unit in the senior ranks. The mentioned potential is developed according to the following relation.
Здесь приняты обозначения:The notation here is:
ПЗ1 i - потенциал заема, выработанный по ВТ1 в i-том разряде;PZ 1 i - loan potential developed by VT1 in the i-th category;
ПЗ1 i-1 - потенциал заема, выработанный по ВТ1 в i-1-том разряде;PZ 1 i-1 - loan potential developed by VT1 in the i-1-th category;
ЛУ1,2 - потенциалы первой и второй ЭО логического умножения;LU1,2 - potentials of the first and second EO of logical multiplication;
Ai, - прямое и инверсное значения триггера Аi-того разряда.Ai - direct and inverse values of the trigger of the AI discharge.
Выработанный в i-том разряде ПЗ распространяется в сторону старших разрядов по цепи элементов ИЛИ 14, 15, И 6. Потенциал ЛУ 2 также поступает на первый вход И3 и через элемент НЕ 20 - на первый вход И4. На вторые входы И 3, 4 поступит исполнительный импульс по ВУ 30 и осуществит прием сигнала с ИВ 28 парафазным кодом в Тr 27. В случае отсутствия высокого потенциала с выхода И2, Тr 27 будет установлен в нуль, а при наличии упомянутого потенциала - в единицу. По этому же временному такту сигнал, поступивший на ВУ 30, поступает на нулевой вход Тr 215 и устанавливает его в нуль.The PP developed in the i-th discharge extends towards the higher bits along the chain of elements OR 14, 15, AND 6. The potential of LU 2 also goes to the first input I3 and through the element NOT 20 to the first input I4. The second inputs And 3, 4 will receive an executive pulse through VU 30 and will receive a signal with ИВ 28 with a paraphase code in Tr 27. In the absence of a high potential from the output And 2, Tr 27 will be set to zero, and in the presence of the mentioned potential - to one . At the same time clock, the signal received at
По ВТ2, после завершения распространения потенциала заема во всех разрядах устройства, выполняются ЭО формирования разности путем выполнения логического соотношения (2).According to VT2, after the completion of the distribution of the loan potential in all categories of the device, EO of the formation of the difference is carried out by fulfilling the logical relation (2).
Здесь обозначены:Indicated here:
Si - разность i-того разряда;Si is the difference of the i-th discharge;
Ai2, Bi2 - значения триггеров i - того разряда по времени ВТ2;Ai 2 , Bi 2 - values of triggers of i - that discharge in VT2 time;
ПЗ2 i-1 - потенциал заема единицы, выработанный в младшем разряде;PZ 2 i-1 - the loan potential of the unit, developed in the lower category;
ВУ33 - четвертый вход управления формированием результата вычитания;VU33 - the fourth input of the control of the formation of the result of the subtraction;
⊕ - знак сложения по модулю два.⊕ is the addition sign modulo two.
Для этого на ВУ 33 поступает исполнительный импульс, который при наличии высоких потенциалов на первом и втором входах И 11, по цепи элементов И11, ИЛИ 18, 17 поступит на вторые входы И8, 9 и выполнит инвертирование кода Тr 26. При этом при переключении триггера из единицы в нуль высокий потенциал с выхода И 12 будет поступать на первый вход И8 и на вход НЕ 23 неизменным на время длительности исполнительного импульса, поступившего на ВУ33, за счет связи с выхода И8 через ИЛИ 16 с входом И 12. При переключении Тr 26 из нуля в единицу нулевой потенциал с выхода И 12 и высокий потенциал с выхода НЕ 23 не изменят своего значения за счет связи с выхода НЕ 25 с вторым входом И 12 на время длительности исполнительного импульса, поступившего на ВУ 33. Таким образом код Тr 26 будет проинвертирован с одновременной задержкой сигнала с выхода И 12, независимо от момента переключения RS-триггера в пределах длительности исполнительного импульса, выполняющего ЭО сложения по модулю два (или инвертирование) Тr 26. В том случае если в i-том разряде присутствуют одновременно В2i=1 и ПЗ2 i-1=1, то инвертирование Тr 26 запрещается низким потенциалом с выхода НЕ 7. Также по ВТ2 выполняется ЭО запоминания потенциала заема, выработанного в самом старшем разряде устройства, и формирование знака разности. Знак разности формируется путем инвертирования Тr 214 при наличии потенциала ПЗ из самого старшего разряда и исполнительного импульса на ВУ33. При этом сигнал инвертирования вырабатывается на выходе И 203 и через ИЛИ 208 поступает на вход И 204 и прямо на вход И 205, т.е на счетный вход триггера 214. Одновременно сигнал с выхода И 203 поступает на единичный вход Тr 215 и устанавливает его в единицу. Если Тr 215 по ВТ2 в единицу не установлен, что имеет место при |А|>|В|, то операция вычитания на этом заканчивается. В случае |А|<|В| вырабатывается ПЗ из самого старшего разряда, Тr 215 устанавливается в единицу, и требуется продолжить выполнение операции вычитания по ВТ3 и ВТ4.To do this, an executive impulse arrives at
По ВТ3 и ВТ4 выполняются ЭО инвертирования триггеров 26 и прибавление единицы к коду первого разряда, если триггер 215 по ВТ2 установлен в единицу. Для выполнения ЭО добавления единицы к коду регистра А по ВТ3 формируют потенциал циклического заема с выхода И207, входы которого соединены с единичным выходом Тr 215 и с выходом ИЛИ 210.On VT3 and VT4, the inverters of the inverting of the triggers 26 are performed and the unit is added to the code of the first category, if the
Сигнал с выхода И 207 поступает на входы ИЛИ 14 и НЕ 22 первого разряда. Если Тr 26 первого разряда хранит код нуля, то потенциал по цепи элементов ИЛИ 14, И6 поступает в старшие разряды, триггеры которых хранят код нуля.The signal from the output And 207 goes to the inputs OR 14 and NOT 22 of the first category. If Tr 26 of the first digit stores the zero code, then the potential along the chain of elements OR 14, I6 enters the senior bits, the triggers of which store the zero code.
По ВТ4 на ВУ 32 поступает исполнительный импульс инвертирования кода триггеров регистра А. Если на вход НЕ 22 i-того разряда не поступил потенциал циклического заема, сформированный по ВТ3, то исполнительный импульс с ВУ32 пройдет по цепи элементов И7, ИЛИ 18, ИЛИ17, поступит на входы И 8, 9, т.е на счетный вход, и выполнит инвертирование Тr 26. Если на вход НЕ 22 поступил сигнал, ПЦЗ или сформированный на выходе И6 младшего разряда, то через И7, ИЛИ 18, 17 на счетный вход Тr 26 не пройдет исполнительный импульс инвертирования и упомянутый триггер сохранит прежнее состояние.On VT4, the VU 32 receives the executive impulse of inverting the code of the triggers of register A. If the potential of the cyclic loan generated by VT3 does not arrive at the input of the 22nd i-bit, then the executive impulse from VU32 will go through the circuit of elements I7, OR 18, OR17, to the inputs And 8, 9, that is, to the counting input, and will invert Tr 26. If the input HEZ received a signal, PTZ or formed at the output of I6 low order, then through I7, OR 18, 17 to the counting input Tr 26 the inverting Executive pulse will not pass and the mentioned trigger will retain the same th state.
В случае вычитания отрицательного кода В из отрицательного кода А, равных по модулю, требуется установить Тr 214 в нуль при нулевых значениях триггеров регистра А по ВТ2. Для этого выходы НЕ 23 всех разрядов устройства с помощью информационных связей 35, 36… соединяют с входами И 201. По второму временному такту при наличии высокого потенциала на выходах И 201 и на ВУ33, с выхода И 202 через ИЛИ 208, И 204, НЕ 212 на нулевой вход Тr 214 поступит сигнал и установит его в нуль. В таблице 1 приведены примеры выполнения вычитания двоичных кодов.In the case of subtracting the negative code B from the negative code A, which are equal in magnitude, it is required to set
Таким образом, предлагаемый способ и устройство выполняют операцию вычитания целых двоичных чисел и обеспечивают повышение быстродействия по сравнению с известными устройствами.Thus, the proposed method and device perform the operation of subtracting integer binary numbers and provide improved performance compared to known devices.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2010104306/08A RU2410746C1 (en) | 2010-02-08 | 2010-02-08 | Method and device for subtracting binary codes |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2010104306/08A RU2410746C1 (en) | 2010-02-08 | 2010-02-08 | Method and device for subtracting binary codes |
Publications (1)
Publication Number | Publication Date |
---|---|
RU2410746C1 true RU2410746C1 (en) | 2011-01-27 |
Family
ID=46308569
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
RU2010104306/08A RU2410746C1 (en) | 2010-02-08 | 2010-02-08 | Method and device for subtracting binary codes |
Country Status (1)
Country | Link |
---|---|
RU (1) | RU2410746C1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2553221C2 (en) * | 2013-06-13 | 2015-06-10 | Борис Михайлович Власов | Methods of executing computational primitives and device therefor |
-
2010
- 2010-02-08 RU RU2010104306/08A patent/RU2410746C1/en active
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2553221C2 (en) * | 2013-06-13 | 2015-06-10 | Борис Михайлович Власов | Methods of executing computational primitives and device therefor |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
RU2439667C1 (en) | Processor of higher functioning reliability | |
RU2410746C1 (en) | Method and device for subtracting binary codes | |
RU2653263C1 (en) | Arithmetic-logic device for number module multiplication | |
US9032009B2 (en) | Multiplier circuit | |
RU2389064C1 (en) | Method and device for adding and subtracting binary decimal code | |
RU2628175C1 (en) | Arithmetic-logical device for summing numbers to module | |
EP0571693B1 (en) | Fast adder chain | |
RU2308801C1 (en) | Pulse counter | |
RU2595906C1 (en) | Device for calculating functions | |
RU2275676C1 (en) | Combination type adder | |
RU2791441C1 (en) | Modulo accumulator | |
RU2008117667A (en) | METHOD AND DEVICE FOR PERFORMING ADDITION, SUBTRACTION AND LOGIC OPERATIONS | |
RU2633142C1 (en) | Device for calculating function of √x2+y2 | |
RU2381547C2 (en) | Device for adding binary codes | |
RU2540787C1 (en) | Method and apparatus for subtracting units | |
RU2292073C1 (en) | Combinative accumulating adder | |
RU2308073C2 (en) | Method and device for adding | |
SU1539774A1 (en) | Pseudorandom series generator | |
RU2604334C2 (en) | Pulse counting method and device | |
US3116412A (en) | Reflexed binary adder with interspersed signals | |
UA150331U (en) | Look-ahead carry adder | |
SU278221A1 (en) | DEVICE FOR READING TWO PURE | |
SU744568A2 (en) | Parallel accumulator | |
SU1451698A1 (en) | Device for shaping remainder from number by arbitrary modulo | |
RU1783618C (en) | Converter of binary k-digit code to binary code |