US20090083361A1 - Shift-add based multiplication - Google Patents

Shift-add based multiplication Download PDF

Info

Publication number
US20090083361A1
US20090083361A1 US12/148,509 US14850908A US2009083361A1 US 20090083361 A1 US20090083361 A1 US 20090083361A1 US 14850908 A US14850908 A US 14850908A US 2009083361 A1 US2009083361 A1 US 2009083361A1
Authority
US
United States
Prior art keywords
bit
shift
memory
value
bits
Prior art date
Legal status (The legal status 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 status listed.)
Abandoned
Application number
US12/148,509
Inventor
Charles H. Moore
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
VNS Portfolio LLC
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to US12/148,509 priority Critical patent/US20090083361A1/en
Priority to PCT/US2008/011005 priority patent/WO2009042112A2/en
Assigned to VNS PORTFOLIO LLC reassignment VNS PORTFOLIO LLC ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: TECHNOLOGY PROPERTIES LIMITED
Assigned to TECHNOLOGY PROPERTIES LIMITED LLC reassignment TECHNOLOGY PROPERTIES LIMITED LLC LICENSE (SEE DOCUMENT FOR DETAILS). Assignors: VNS PORTFOLIO LLC
Publication of US20090083361A1 publication Critical patent/US20090083361A1/en
Abandoned legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators

Definitions

  • the present invention relates generally to electrical computers and digital processing systems having processing architectures and performing instruction processing, and more particularly to processes for multiplication that can be implemented in such.
  • op-codes Powerful and efficient operational codes (op-codes) are critical for modern computer processors to perform many tasks. For example, some such tasks are multiplication and producing sequences of pseudorandom numbers.
  • a preferred embodiment of the present invention is a system for multiplication of multi-bit first and second values that each has a least significant bit (LSB) and a most significant bit (MSB).
  • a processor is provided that has first and second memories with bit-positions that can all be zero or one, and where the first memory has a low bit (LB).
  • a logic arranges the first value in the first memory such that its LSB is in the LB, and sets each of the bit-positions remaining in the first memory to zero.
  • a logic arranges the second value in the second memory such that its LSB is in the bit-position of the second memory that is next higher in order than the MSB of the first value in the first memory, and sets each of the bit-positions remaining in the second memory to zero.
  • a logic then performs a +* op-code a quantity of iterations equaling how many bits comprise the MSB through the LSB of the first value, inclusive, thus obtaining a product of the first and second values.
  • TBLS. 1-4 represent the values in the T-register and the S-register in a SEAforthTM 24a device in a set of hypothetical +* (shift-add mechanism) examples.
  • TBLS. 5-10 represent the values in the T-register and the S-register in a SEAforthTM 24a device in a set of hypothetical +* (shift-add mechanism) multiplication examples.
  • FIG. 1 (background art) is a table of the thirty two operational codes (op-codes) in the Venture ForthTM programming language.
  • FIG. 2 (background art) is a block diagram showing the general architecture of each of the cores in a SEAforthTM 24a device.
  • FIGS. 3 a - b are schematic block diagrams depicting how the 18 bit wide registers in the SEAforthTM 24a can be represented, wherein FIG. 3 a shows the actual bit arrangement and FIG. 3 b shows a conceptual bit arrangement.
  • FIGS. 4 a - b are schematic block diagrams depicting register content, wherein FIG. 4 a shows the slots filled with four • (nop) op-codes and FIG. 4 b shows the register filled with the number 236775 (as unsigned binary).
  • FIGS. 5 a - b are block diagrams respectively and stylistically showing the return and the data stack elements in SEAforthTM 24a cores, wherein FIG. 5 a depicts elements in the return stack region and FIG. 5 b depicts elements in the data stack region.
  • FIG. 6 is a flow chart of a shift-add mechanism, as used by the present invention, that shows all of the possible actions associated with a single execution of the +* op-code.
  • FIG. 7 is a table showing bit relationships in accord with FIG. 6 .
  • FIG. 8 is a flow chart of a shift-add based multiplication process in accord with the present invention.
  • a preferred embodiment of the present invention is a shift-add based multiplication process. As illustrated in the various drawings herein, and particularly in the view of FIG. 8 , preferred embodiments of the invention are depicted by the general reference character 200 .
  • the present inventive shift-add based multiplication process 200 ( FIG. 8 ) is an application of a shift-add mechanism by the present inventor. In view of this, that shift-add mechanism is discussed first, below.
  • the shift-add mechanism 100 ( FIG. 6 ) can be used for a variety of tasks including, without limitation, multiplication and pseudorandom number generation.
  • the shift-add mechanism 100 exists as a “+*” op-code.
  • FIG. 1 is a table of the thirty two operational codes (op-codes) in this language, in hex, mnemonic, and binary representations. These op-codes are divided into two main categories, memory instructions and arithmetic logic unit (ALU) instructions, with sixteen op-codes in each division.
  • the memory instructions are shown in the left half of the table in FIG. 1
  • the ALU instructions are shown in the right half of the table in FIG. 1 .
  • FIG. 2 (background art) is a block diagram showing the general architecture of each of the cores in the SEAforthTM 24a device. All of the registers in the SEAforthTM 24a are 18 bits wide, except for the B- and PC-registers, which are not relevant here.
  • FIGS. 3 a - b are schematic block diagrams depicting how the 18 bit wide registers in the SEAforthTM 24a device can be represented, wherein FIG. 3 a shows the actual arrangement of the bits as bits 0 through 17 , and FIG. 3 b shows a conceptual arrangement of the bits as bits ⁇ 2 through 17 .
  • FIG. 3 a it can be seen that bits 13 - 17 inclusive make up slot 0 , bits 8 - 12 inclusive make up slot 1 , bits 3 - 7 inclusive make up slot 2 , and bits 0 - 2 make up slot 3 .
  • FIG. 3 b shows how the designers of the SEAforthTM 24a device have handled this. They allow only certain op-codes to fit into slot 3 by treating the two least significant bits, called bit ⁇ 1 and bit ⁇ 2 here, as being hard wired to ground or zero. Of course, since slot 3 effectively has only three bits rather than five bits of space, the number of op-codes that fit into slot 3 is limited to only eight of the 32 possible op-codes. Specifically, these op codes are:
  • FIGS. 4 a - b are schematic block diagrams depicting an example illustrating this.
  • FIG. 4 a shows the slots filled with four • (nop) op-codes
  • FIG. 4 b shows the register filled with the number 236775 (as unsigned binary).
  • FIG. 1 it can be appreciated that the binary bit values in FIGS. 4 a - b are the very same. This means that it is been left up to the programmer to differentiate whether a register will contain a number or contain four op-codes.
  • FIGS. 5 a - b are block diagrams stylistically showing the return and the data stack elements, respectively, that exist in each core of a SEAforthTM 24a device.
  • FIG. 5 a depicts how the return stack region includes a top register that is referred to as “R” (or as the R-register) and an eight-register circular buffer.
  • FIG. 5 b depicts how the data stack region includes a top register that is referred to as “T” (or as the T-register), a (second) register below T that is referred to as “S” (or as the S-register), and also an eight-register circular buffer.
  • the return stack thus contains nine registers and the data stack contains ten registers. Only the data stack region needs to be considered in the following example.
  • TBLS. 1-4 represent the values in the T-register and the S-register in a set of hypothetical +* examples. For simplicity, only 4-bit field widths are shown. It is important to note in the following that the value in the T-register (T) is changed while the value in the S-register (S) remains unchanged during execution of the +* op-code.
  • T the value in the T-register
  • S the value in the S-register
  • N.b. to avoid confusion between the bits making up values and the locations in memory that may hold such, we herein refer to bits in values and to bit-positions in memory. It then follows that a value has a most significant bit (MSB) and a least significant bit (LSB), and that a location in memory has a high bit (HB) position and a low bit (LB) position.
  • TBL. 1 shows the value one (1) initially placed in the T-register and the value three (3) placed in the S-register. Because the low bit (LB) position of T here is a 1, during execution of the +* op-code:
  • +* op-code executes a conditional add followed by a bit shift of all bits in T in the direction of the low order bits when either a 1 or a 0 fills the high bit (HB) position of T after the shift.
  • FIG. 6 is a block diagram of the inventive shift-add mechanism 100 that shows all of the possible actions associated with a single execution of the +* op-code.
  • the +* op-code has two major sub-processes, a shift sub-process 102 and a conditional add sub-process 104 .
  • the shift-add mechanism 100 is embodied as a +* op-code that starts in a step 106 and where the content of the LB position of T is examined in a step 108 .
  • a step 110 when the LB of T is 0, in a step 110 the content of the HB position of T is examined.
  • the HB position of T is 0, in a step 112 the contents of T are shifted right, in a step 114 the HB position of T is filled with a 0, and in a step 116 T contains its new value.
  • the HB position of T is 1, in a step 118 the contents of T are shifted right, in a step 120 the HB position of T is filled with a 1, and step 116 now follows where T now contains its new value.
  • conditional add sub-process 104 when the LB position of T is 1, in a step 122 the contents of T and S are added and in a step 124 whether this produces a carry is determined. If there was no carry, the shift sub-process 102 is entered at step 110 , as shown. Alternately, if there was a carry (the carry bit is 1), the shift sub-process 102 is entered at step 118 , as shown. Then the +* op-code process (the shift-add mechanism 100 ) continues with the shift sub-process 102 through step 116 , where T will now contain a new value.
  • FIG. 6 reveals that the execution of the +* op-code is not conceptually simple.
  • FIG. 7 is a table showing the relationships between the LB position and the HB position of T prior to an execution, here called old T, an intermediate carry when the values in S and T are added (if this action occurs), and finally the HB and the penultimate bit (HB ⁇ 1 ) of T which is produced after execution, here called new T.
  • the +* op-code always involves a bit shift to the right (in the direction of the low order bits) of all bits in T. This bit shift is not the result of any event before, during, or after the execution of the +* op-code.
  • the bit shift is an always executed event associated with the +* op-code.
  • shift-add mechanism 100 can be used for multiplication.
  • An example is now presented followed by an explanation of the general case of utilizing the +* op-code to execute complete and correct multiplication.
  • TBL. 5 shows the value nine (9) initially placed in the T-register and the value seven (7) placed in the S-register.
  • the value in T is right justified in the 8-bit field width such that the four leading bits are filled with zeros.
  • the value in S is left justified in the 8-bit field width so that the four trailing bits are filled with zeroes.
  • TBL. 6 shows the result of these justifications.
  • the first +* operation has the following effects.
  • the LB position of T is 1 (as shown in TBL. 6), so the values in T and S are added and the result is placed in T (as shown in the left portion of TBL. 7).
  • the value in T is shifted to the right one bit in the same manner described in 1a2b1. (above).
  • the values after this first +* operation are shown in the right portion of TBL. 7.
  • the second +* operation is quite simple, because the LB position of T is 0. All of the bits in T are shifted right in the manner described in 2b1. (above). The values after this second +* operation are shown in TBL. 8.
  • the third +* operation is similar to the second, because the LB position of T is again 0. All of the bits in T are again shifted right in the manner described in 2b1. (above). The values after this third +* operation are shown in TBL. 9.
  • the fourth and final +* operation is similar to the first +* operation.
  • the LB position of T is 1 (as shown in TBL. 9), so the values in T and S are added and the result is placed in T (as shown in the left portion of TBL. 10).
  • the value in T is shifted to the right one bit in the same manner described in 1a2b1. (above).
  • the values after this fourth +* operation are shown in the right portion of TBL. 10.
  • T in TBL. 10 is the decimal value 63, which is what one expects when multiplying the numbers nine and seven.
  • FIG. 8 is a flow chart of the inventive shift-add based multiplication process 200 in accord with the present invention.
  • a step 202 the shift-add based multiplication process 200 starts or is invoked.
  • a step 204 a first value is arranged in a first memory location, i.e., in the right justified manner described in 1. (above) if T is the first memory location.
  • a step 206 a second value is arranged in a second memory location, i.e., in the left justified manner described in 2. (above) for multiplication if S is the second memory location.
  • a step 208 the number of iterations of the +* op-code is determined. Essentially, this number needs to equal the number of significant bits in the first value (in T).
  • a step 210 whether all needed iterations of the +* op-code have been performed is determined. If not, in a step 212 an iteration of the +* op-code is performed and in a step 214 the count still needed is decremented. Alternately, if step 210 determines that all needed iterations of the +* op-code have been performed, in a step 216 the product of the first and second values is now in the first memory (i.e., in T).

Abstract

A system for multiplication of multi-bit first and second values. A processor is provided that has first and second memories with bit-positions that can all be zero or one and where the first memory has a low bit (LB). The first value is arranged in the first memory so its LSB is in the first memory LB, and the remaining bit-positions in the first memory are set to zero. The second value is arranged in the second memory such that its LSB is in the bit-position of the second memory that is next higher in order than the MSB of the first value in the first memory, and the remaining bit-positions in the second memory are set to zero. A +* operation is then performed a quantity of times equaling the number of significant bits in the first value, inclusive, thus obtaining the product of the first and second values.

Description

  • This application claims the benefit of U.S. Provisional Application No. 60/974,820 entitled “Shift-Add Mechanism,” filed Sep. 24, 2007 by at least one common inventor, which is incorporated herein by reference in its entirety.
  • BACKGROUND OF THE INVENTION
  • 1. Technical Field
  • The present invention relates generally to electrical computers and digital processing systems having processing architectures and performing instruction processing, and more particularly to processes for multiplication that can be implemented in such.
  • 2. Background Art
  • Powerful and efficient operational codes (op-codes) are critical for modern computer processors to perform many tasks. For example, some such tasks are multiplication and producing sequences of pseudorandom numbers.
  • BRIEF SUMMARY OF THE INVENTION
  • Accordingly, it is an object of the present invention to provide a shift-add based multiplication process that is useful for various operations in a processor.
  • Briefly, a preferred embodiment of the present invention is a system for multiplication of multi-bit first and second values that each has a least significant bit (LSB) and a most significant bit (MSB). A processor is provided that has first and second memories with bit-positions that can all be zero or one, and where the first memory has a low bit (LB). A logic arranges the first value in the first memory such that its LSB is in the LB, and sets each of the bit-positions remaining in the first memory to zero. A logic arranges the second value in the second memory such that its LSB is in the bit-position of the second memory that is next higher in order than the MSB of the first value in the first memory, and sets each of the bit-positions remaining in the second memory to zero. A logic then performs a +* op-code a quantity of iterations equaling how many bits comprise the MSB through the LSB of the first value, inclusive, thus obtaining a product of the first and second values.
  • These and other objects and advantages of the present invention will become clear to those skilled in the art in view of the description of the best presently known mode of carrying out the invention and the industrial applicability of the preferred embodiment as described herein and as illustrated in the figures of the drawings.
  • BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING(S)
  • The purposes and advantages of the present invention will be apparent from the following detailed description in conjunction with the appended tables and figures of drawings in which:
  • TBLS. 1-4 represent the values in the T-register and the S-register in a SEAforth 24a device in a set of hypothetical +* (shift-add mechanism) examples.
  • TBLS. 5-10 represent the values in the T-register and the S-register in a SEAforth 24a device in a set of hypothetical +* (shift-add mechanism) multiplication examples.
  • FIG. 1 (background art) is a table of the thirty two operational codes (op-codes) in the Venture Forth™ programming language.
  • FIG. 2 (background art) is a block diagram showing the general architecture of each of the cores in a SEAforth 24a device.
  • FIGS. 3 a-b (background art) are schematic block diagrams depicting how the 18 bit wide registers in the SEAforth™ 24a can be represented, wherein FIG. 3 a shows the actual bit arrangement and FIG. 3 b shows a conceptual bit arrangement.
  • FIGS. 4 a-b (background art) are schematic block diagrams depicting register content, wherein FIG. 4 a shows the slots filled with four • (nop) op-codes and FIG. 4 b shows the register filled with the number 236775 (as unsigned binary).
  • FIGS. 5 a-b (background art) are block diagrams respectively and stylistically showing the return and the data stack elements in SEAforth™ 24a cores, wherein FIG. 5 a depicts elements in the return stack region and FIG. 5 b depicts elements in the data stack region.
  • FIG. 6 is a flow chart of a shift-add mechanism, as used by the present invention, that shows all of the possible actions associated with a single execution of the +* op-code.
  • FIG. 7 is a table showing bit relationships in accord with FIG. 6.
  • FIG. 8 is a flow chart of a shift-add based multiplication process in accord with the present invention.
  • In the various figures of the drawings, like references are used to denote like or similar elements or steps.
  • DETAILED DESCRIPTION OF THE INVENTION
  • A preferred embodiment of the present invention is a shift-add based multiplication process. As illustrated in the various drawings herein, and particularly in the view of FIG. 8, preferred embodiments of the invention are depicted by the general reference character 200.
  • The present inventive shift-add based multiplication process 200 (FIG. 8) is an application of a shift-add mechanism by the present inventor. In view of this, that shift-add mechanism is discussed first, below.
  • The +* Op-Code On The SEAforth 24a Device
  • The shift-add mechanism 100 (FIG. 6) can be used for a variety of tasks including, without limitation, multiplication and pseudorandom number generation. In the Venture Forth™ programming language, the shift-add mechanism 100 exists as a “+*” op-code. Before presenting more detailed examples, it is useful to consider a simple example in the context of a SEAforth 24a device by IntellaSys™ Corporation of Cupertino, Calif., a member of The TPL Group™ of companies.
  • As general background, the SEAforth™ 24a has 24 stack based microprocessor cores that all use the Venture Forth™ programming language. FIG. 1 (background art) is a table of the thirty two operational codes (op-codes) in this language, in hex, mnemonic, and binary representations. These op-codes are divided into two main categories, memory instructions and arithmetic logic unit (ALU) instructions, with sixteen op-codes in each division. The memory instructions are shown in the left half of the table in FIG. 1, and the ALU instructions are shown in the right half of the table in FIG. 1. It can be appreciated that one clear distinction between the divisions of op-codes is that the memory instructions contain a zero (0) in the left-most bit whereas the ALU instructions contain a one (1) in the left-most bit. Furthermore, this is the case regardless of whether the op-codes are viewed in their hex or binary representations. The +* op-code of present interest is shown upper-most in the right-hand column.
  • FIG. 2 (background art) is a block diagram showing the general architecture of each of the cores in the SEAforth 24a device. All of the registers in the SEAforth™ 24a are 18 bits wide, except for the B- and PC-registers, which are not relevant here.
  • There are two distinct approaches that can be taken when a programmer is selecting the bits that will make up the 18 bit wide register space in a SEAforth™ 24a (with limited exceptions for some op-codes that use the A-register). The first of these is to divide this space into four equal slots that can be called: slot 0, slot 1, slot 2, and slot 3. The bit lengths of these slots are not all equal, however, because division of 18 by 4 results in a remainder. The first three slots, slot 0, slot 1, and slot 2; therefore can each hold 5 bits while slot 3 holds only three bits.
  • FIGS. 3 a-b (background art) are schematic block diagrams depicting how the 18 bit wide registers in the SEAforth 24a device can be represented, wherein FIG. 3 a shows the actual arrangement of the bits as bits 0 through 17, and FIG. 3 b shows a conceptual arrangement of the bits as bits −2 through 17. In FIG. 3 a it can be seen that bits 13-17 inclusive make up slot 0, bits 8-12 inclusive make up slot 1, bits 3-7 inclusive make up slot 2, and bits 0-2 make up slot 3. The designers of the SEAforth™ 24a device often point out the fact that the 18-bit wide registers can each contain three and three/five instructions, and this prompts the question whether slot 3 is significant, since none of the op-codes in FIG. 1 would appear to fit in slot 3. FIG. 3 b shows how the designers of the SEAforth™ 24a device have handled this. They allow only certain op-codes to fit into slot 3 by treating the two least significant bits, called bit −1 and bit −2 here, as being hard wired to ground or zero. Of course, since slot 3 effectively has only three bits rather than five bits of space, the number of op-codes that fit into slot 3 is limited to only eight of the 32 possible op-codes. Specifically, these op codes are:
  • $00 00000b ;(return)
    $04 00100b unext
    $08 01000b @p+
    $0C 01100b !p+
    $10 10000b +*
    $14 10100b +
    $18 11000b dup
    $1C 11100b •(nop).
  • The second approach that a programmer can use when selecting the bits that will make up the 18-bit wide register space in the SEAforth™ 24a is to simply not divide the 18-bit wide register into slots, and to instead consider the register as containing a single 18-bit binary value. This may appear at first to be a completely different approach than the slot-based approach, but both representations are actually equivalent. FIGS. 4 a-b (background art) are schematic block diagrams depicting an example illustrating this. FIG. 4 a shows the slots filled with four • (nop) op-codes, and FIG. 4 b shows the register filled with the number 236775 (as unsigned binary). With reference to FIG. 1, it can be appreciated that the binary bit values in FIGS. 4 a-b are the very same. This means that it is been left up to the programmer to differentiate whether a register will contain a number or contain four op-codes.
  • FIGS. 5 a-b (background art) are block diagrams stylistically showing the return and the data stack elements, respectively, that exist in each core of a SEAforth™ 24a device. FIG. 5 a depicts how the return stack region includes a top register that is referred to as “R” (or as the R-register) and an eight-register circular buffer. FIG. 5 b depicts how the data stack region includes a top register that is referred to as “T” (or as the T-register), a (second) register below T that is referred to as “S” (or as the S-register), and also an eight-register circular buffer. In total, the return stack thus contains nine registers and the data stack contains ten registers. Only the data stack region needs to be considered in the following example.
  • TBLS. 1-4 represent the values in the T-register and the S-register in a set of hypothetical +* examples. For simplicity, only 4-bit field widths are shown. It is important to note in the following that the value in the T-register (T) is changed while the value in the S-register (S) remains unchanged during execution of the +* op-code. [N.b., to avoid confusion between the bits making up values and the locations in memory that may hold such, we herein refer to bits in values and to bit-positions in memory. It then follows that a value has a most significant bit (MSB) and a least significant bit (LSB), and that a location in memory has a high bit (HB) position and a low bit (LB) position.]
  • TBL. 1 shows the value one (1) initially placed in the T-register and the value three (3) placed in the S-register. Because the low bit (LB) position of T here is a 1, during execution of the +* op-code:
      • (1) S and T are added together and the result is put in T (TBL. 2 shows the result of this); and
      • (2) the contents of T are shifted to the right and a 0 is placed in bit 4 (TBL. 3 shows the result of this).
  • The reason for bit 4 being filled with a 0 is saved for later discussion.
  • The contents of T an S in TBL. 3 are now used for a second example. Because the LB position of T is now a 0, during another execution of the +* op-code:
      • (1) the contents of T are simply shifted to the right and a 0 is placed in bit 4 (TBL. 4 shows the result of this).
  • Again, the reason for bit 4 being filled with a 0 is saved for later discussion. Additionally, it should be noted that the shift to the right of all of the bits in T is not associated in any way with the fact that a 1 or 0 filled the LB position of T prior to the execution of the +* op-code. Instead, and more importantly, the shift of all the bits to the right in T is associated with the +* op-code itself.
  • These two examples demonstrate nearly all of the actions associated with the +* op-code. What was not fully described was why 0 is used to fill bit 4. The following covers this.
  • The General Case of The +* Op-Code
  • A general explanation of the +* op-code is that it executes a conditional add followed by a bit shift of all bits in T in the direction of the low order bits when either a 1 or a 0 fills the high bit (HB) position of T after the shift.
  • FIG. 6 is a block diagram of the inventive shift-add mechanism 100 that shows all of the possible actions associated with a single execution of the +* op-code. The +* op-code has two major sub-processes, a shift sub-process 102 and a conditional add sub-process 104. The shift-add mechanism 100 is embodied as a +* op-code that starts in a step 106 and where the content of the LB position of T is examined in a step 108.
  • Turning first to the shift sub-process 102, when the LB of T is 0, in a step 110 the content of the HB position of T is examined. When the HB position of T is 0, in a step 112 the contents of T are shifted right, in a step 114 the HB position of T is filled with a 0, and in a step 116 T contains its new value. Alternately, when the HB position of T is 1, in a step 118 the contents of T are shifted right, in a step 120 the HB position of T is filled with a 1, and step 116 now follows where T now contains its new value.
  • Turning now to the conditional add sub-process 104, when the LB position of T is 1, in a step 122 the contents of T and S are added and in a step 124 whether this produces a carry is determined. If there was no carry, the shift sub-process 102 is entered at step 110, as shown. Alternately, if there was a carry (the carry bit is 1), the shift sub-process 102 is entered at step 118, as shown. Then the +* op-code process (the shift-add mechanism 100) continues with the shift sub-process 102 through step 116, where T will now contain a new value.
  • While the actions associated with the +* op-code are easy to define, FIG. 6 reveals that the execution of the +* op-code is not conceptually simple. FIG. 7 is a table showing the relationships between the LB position and the HB position of T prior to an execution, here called old T, an intermediate carry when the values in S and T are added (if this action occurs), and finally the HB and the penultimate bit (HB −1) of T which is produced after execution, here called new T.
  • A +* Pseudo-Code Algorithm
  • The most general case of a +* op-code is now described using a pseudo-code algorithm. For this description it is assumed that the +* op-code is executed on an n-bit machine wherein an nt-bit width number t is initially placed in T and an ns-bit width number s is initially placed in S. Furthermore, it is assumed that only one additional bit is available to represent a carry, even if the +* op-code produces a carry that is theoretically more than one bit can represent. There is no restriction on the lengths of nt and ns, only that their individual bit lengths should be less than or equal to the bit width of n. The pseudo-code is as follows:
      • 1. If the LB position of T is a 1:
        • 1a. Add the value t in T to the value s in S where the sum of t+s, call this t′, replaces the present t in T and S is left unchanged.
          • 1a1. If the HB position of T is a 1:
            • 1a1a. If the addition of t and s resulted in a carry:
            •  1a1a1. Shift all bits in T to the right one bit. Bit 0 of t′ after the shift contains the contents of bit 1 before the shift. Bit 1 of t′ after the shift contains the contents of bit 2 before the shift. In the same way, the rest of t′ is filled where bit m, m<n, being filled after the shift contains the contents of bit m+1 before the shift. This process leaves bit n devoid while effectively destroying bit 0 of t′ before the shift. Bit n of t′ after the shift will be filled with a 1.
            • 1a1b. If the addition of t and s did not result in a carry:
            •  1a1b1. Shift all bits in T to the right one bit. Bit 0 of t′ after the shift contains the contents of bit 1 before the shift. Bit 1 of t′ after the shift contains the contents of bit 2 before the shift. In the same way, the rest of t′ is filled where bit m, m<n, being filled after the shift contains the contents of bit m+1 before the shift. This process leaves bit n devoid while effectively destroying bit 0 of t′ before the shift. Bit n of t′ after the shift will be filled with a 1.
          • 1a2. If the HB position of T is a 0:
            • 1a2a. If the addition of t and s resulted in a carry:
            •  1a2a1. Shift all bits in T to the right one bit. Bit 0 of t′ after the shift contains the contents of bit 1 before the shift. Bit 1 of t′ after the shift contains the contents of bit 2 before the shift. In the same way, the rest of t′ is filled where bit m, m<n, being filled after the shift contains the contents of bit m+1 before the shift. This process leaves bit n devoid while effectively destroying bit 0 of t′ before the shift. Bit n of t′ after the shift will be filled with a 1.
            • 1a2b. If the addition of t and s did not result in a carry:
            •  1a2b1. Shift all bits in t to the right one bit. Bit 0 of t′ after the shift contains the contents of bit 1 before the shift. Bit 1 of t′ after the shift contains the contents of bit 2 before the shift. In the same way, the rest of t′ is filled where bit m, m<n, being filled after the shift contains the contents of bit m+1 before the shift. This process leaves bit n devoid while effectively destroying bit 0 of t′ before the shift. Bit n of t′ after the shift will be filled with a 0.
      • 2. If the LB position of T is a 0:
        • 2a. If the HB position of T is a 1:
          • 2a1. Shift all bits in T to the right one bit. Bit 0 of t′ after the shift contains the contents of bit 1 before the shift. Bit 1 of t′ after the shift contains the contents of bit 2 before the shift. In the same way, the rest of t′ is filled where bit m, m<n, being filled after the shift contains the contents of bit m+1 before the shift. This process leaves bit n devoid while effectively destroying bit 0 of t′ before the shift. Bit n of t′ after the shift will be filled with a 1.
        • 2b. If the HB position of T is a 0:
          • 2b1. Shift all bits in T to the right one bit. Bit 0 of t′ after the shift contains the contents of bit 1 before the shift. Bit 1 of t′ after the shift contains the contents of bit 2 before the shift. In the same way, the rest of t′ is filled where bit m, m<n, being filled after the shift contains the contents of bit m+1 before the shift. This process leaves bit n devoid while effectively destroying bit 0 of t′ before the shift. Bit n of t′ after the shift will be filled with a 0.
  • It is important to note in the preceding that the +* op-code always involves a bit shift to the right (in the direction of the low order bits) of all bits in T. This bit shift is not the result of any event before, during, or after the execution of the +* op-code. The bit shift is an always executed event associated with the +* op-code.
  • Multiplication Utilizing the +* Op-Code
  • It has been implied herein that the shift-add mechanism 100 can be used for multiplication. An example is now presented followed by an explanation of the general case of utilizing the +* op-code to execute complete and correct multiplication.
  • Let us suppose that a person would like to multiply the numbers nine (9) and seven (7) and that the letter T is used to represent an 8-bit memory location where the nine is initially placed, and S is used to represent an 8-bit memory location where the seven is initially placed. [Nb., for simplicity we are not using the 18-bit register width of the SEAforth™ 24a device here, although the underlying concept is extendable to that or any bit width.]
  • TBLS. 5-10 represent the values in the T-register and the S-register in a set of hypothetical +* multiplication examples. TBL. 5 shows the value nine (9) initially placed in the T-register and the value seven (7) placed in the S-register. Next, the value in T is right justified in the 8-bit field width such that the four leading bits are filled with zeros. Conversely, the value in S is left justified in the 8-bit field width so that the four trailing bits are filled with zeroes. TBL. 6 shows the result of these justifications.
  • Correct multiplication here requires the execution of four +* op-codes in series. The first +* operation has the following effects. The LB position of T is 1 (as shown in TBL. 6), so the values in T and S are added and the result is placed in T (as shown in the left portion of TBL. 7). Next, the value in T is shifted to the right one bit in the same manner described in 1a2b1. (above). The values after this first +* operation are shown in the right portion of TBL. 7.
  • The second +* operation is quite simple, because the LB position of T is 0. All of the bits in T are shifted right in the manner described in 2b1. (above). The values after this second +* operation are shown in TBL. 8.
  • The third +* operation is similar to the second, because the LB position of T is again 0. All of the bits in T are again shifted right in the manner described in 2b1. (above). The values after this third +* operation are shown in TBL. 9.
  • The fourth and final +* operation is similar to the first +* operation. The LB position of T is 1 (as shown in TBL. 9), so the values in T and S are added and the result is placed in T (as shown in the left portion of TBL. 10). Next, the value in T is shifted to the right one bit in the same manner described in 1a2b1. (above). The values after this fourth +* operation are shown in the right portion of TBL. 10.
  • The resultant T in TBL. 10 is the decimal value 63, which is what one expects when multiplying the numbers nine and seven.
  • A +* Pseudo-Code Algorithm for Multiplication
  • The multiplication of a positive value with a positive value will result in a correct product when the sum of the significant bits in T and S prior to the execution of this pseudo-code is less than or equal to 16 bits. And the multiplication of a positive value with a negative value will result in a correct product when the sum of the significant bits in T and S prior to the execution of the pseudo-code is less than or equal to 17 bits. Note that S should contain the two's complement of the desired negative value in S prior to the execution of this pseudo code.
      • 1. If the desired multiplication is of a positive value with a positive value.
        • 1a. Right justify t in the n bit field width of T.
          • 1a1. Fill all leading bits in T after the MSB of t with zeros. The number of leading bits to fill should be exactly n-nt.
        • 1b. Justify s in the n bit field width of S so that the LSB of s is located one bit higher than the MSB of t in T.
          • 1b1. Fill all leading and trailing bits in S with zeros. The number of bits to fill should be exactly n-ns.
        • 1c. Perform the multiplication.
          • 1c1. Complete a for-loop indexing from 1 to nt.
            • 1c1a. Execute the +* pseudo-code as described for the general case above.
      • 2. If the desired multiplication is of a positive value with a negative value.
        • 2a. Right justify t in the n bit field width of T.
          • 2a1. Fill all leading bits in T after the MSB of t with zeros. The number of leading bits to fill should be exactly n-nt.
        • 2b. Perform the two's complement of the value s in S.
          • 2b1. Bit shift the value s in S towards the HB of S by the number of significant bits nt.
        • 2c. Perform the multiplication.
          • 2c1. Complete a for-loop indexing from 1 to nt.
            • 2c1a. Execute the +* pseudo-code as described for the general case above.
      • 3. If the desired multiplication is of a negative value with a negative value.
        • 3a. Perform the two's complement of the value t in T.
        • 3b. Perform the two's complement of the value s in S.
        • 3b. Execute 1a-1c.
  • Of course, the multiplication of a negative value with a positive value is the same as 2. (above) for multiplication, as long as the negative value is in T and the positive value in S. FIG. 8 is a flow chart of the inventive shift-add based multiplication process 200 in accord with the present invention. In a step 202 the shift-add based multiplication process 200 starts or is invoked. In a step 204 a first value is arranged in a first memory location, i.e., in the right justified manner described in 1. (above) if T is the first memory location. In a step 206 a second value is arranged in a second memory location, i.e., in the left justified manner described in 2. (above) for multiplication if S is the second memory location. [Those skilled in the programming arts will readily appreciate that alternate programmatic control mechanisms than the following count-compare-work-decrement approach can be used.] In a step 208 the number of iterations of the +* op-code is determined. Essentially, this number needs to equal the number of significant bits in the first value (in T). In a step 210 whether all needed iterations of the +* op-code have been performed is determined. If not, in a step 212 an iteration of the +* op-code is performed and in a step 214 the count still needed is decremented. Alternately, if step 210 determines that all needed iterations of the +* op-code have been performed, in a step 216 the product of the first and second values is now in the first memory (i.e., in T).
  • While various embodiments have been described above, it should be understood that they have been presented by way of example only, and that the breadth and scope of the invention should not be limited by any of the above described exemplary embodiments, but should instead be defined only in accordance with the following claims and their equivalents.

Claims (4)

1. A system for multiplication of multi-bit first and second values each having a least significant bit (LSB) and a most significant bit (MSB), comprising:
(a) a processor having first and second memories with bit-positions that can all be zero or one and wherein said first memory has a low bit (LB);
(b) a logic to arrange the first value in said first memory such that the LSB of the first value is in said LB and to set each of said bit-positions remaining in said first memory to zero;
(c) a logic to arrange the second value in said second memory such that the LSB of the second value is in said bit-position of said second memory which is next higher in order than the MSB of the first value in said first memory and to set each of said bit-positions remaining in said second memory to zero;
(d) a logic to perform a +* op-code for a quantity of iterations equaling how many bits comprise the MSB through the LSB of the first value, inclusive, thereby obtaining a product of the first and second values.
2. The system of claim 1, wherein said processor includes a plurality of registers and said first memory comprises one or more said registers, or said second memory comprises one or more said registers, or both.
3. A method for multiplication of multi-bit first and second values in a processor, wherein the first and second values each have a least significant bit (LSB) and a most significant bit (MSB), and wherein the processor has first and second memories with bit-positions that can all be zero or one and the first memory has a low bit (LB), the method comprising:
(a) arranging the first value in the first memory such that the LSB of the first value is in the LB and such that each of the bit-positions remaining in said first memory is set to zero;
(b) arranging the second value in the second memory such that the LSB of the second value is in the bit-position of the second memory which is next higher in order than the MSB of the first value in the first memory and such that each of the bit-positions remaining in said second memory is set to zero;
(c) performing a +* op-code for a quantity of iterations equaling how many bits comprise the MSB through the LSB of the first value, inclusive, thereby obtaining a product of the first and second values.
4. The method of claim 3, wherein the processor includes a plurality of registers and the first memory includes one or more said registers, or the second memory includes one or more said registers, or both.
US12/148,509 2007-09-24 2008-04-18 Shift-add based multiplication Abandoned US20090083361A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US12/148,509 US20090083361A1 (en) 2007-09-24 2008-04-18 Shift-add based multiplication
PCT/US2008/011005 WO2009042112A2 (en) 2007-09-24 2008-09-23 Shift-add based multiplication

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US97482007P 2007-09-24 2007-09-24
US12/148,509 US20090083361A1 (en) 2007-09-24 2008-04-18 Shift-add based multiplication

Publications (1)

Publication Number Publication Date
US20090083361A1 true US20090083361A1 (en) 2009-03-26

Family

ID=40472867

Family Applications (4)

Application Number Title Priority Date Filing Date
US12/148,511 Abandoned US20090083350A1 (en) 2007-09-24 2008-04-18 Shift-add based random number generation
US12/148,509 Abandoned US20090083361A1 (en) 2007-09-24 2008-04-18 Shift-add based multiplication
US12/148,515 Expired - Fee Related US7774399B2 (en) 2007-09-24 2008-04-18 Shift-add based parallel multiplication
US12/148,505 Abandoned US20090083507A1 (en) 2007-09-24 2008-04-18 Shift-add mechanism

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US12/148,511 Abandoned US20090083350A1 (en) 2007-09-24 2008-04-18 Shift-add based random number generation

Family Applications After (2)

Application Number Title Priority Date Filing Date
US12/148,515 Expired - Fee Related US7774399B2 (en) 2007-09-24 2008-04-18 Shift-add based parallel multiplication
US12/148,505 Abandoned US20090083507A1 (en) 2007-09-24 2008-04-18 Shift-add mechanism

Country Status (3)

Country Link
US (4) US20090083350A1 (en)
TW (1) TW200915175A (en)
WO (4) WO2009042107A2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090083360A1 (en) * 2007-09-24 2009-03-26 Gibson Dana Elliot Shift-add based parallel multiplication

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9747105B2 (en) 2009-12-17 2017-08-29 Intel Corporation Method and apparatus for performing a shift and exclusive or operation in a single instruction
CN112291056B (en) * 2019-07-25 2024-02-23 熵码科技股份有限公司 Encryption key generator and transmission system
KR20210043046A (en) * 2019-10-10 2021-04-21 삼성디스플레이 주식회사 Display device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4901264A (en) * 1987-07-31 1990-02-13 Advantest Corporation Pseudo random pattern generating device
US4947364A (en) * 1985-10-23 1990-08-07 Hewlett-Packard Company Method in a computing system for performing a multiplication
US5117385A (en) * 1990-03-16 1992-05-26 International Business Machines Corporation Table lookup multiplier with digital filter
US5187676A (en) * 1991-06-28 1993-02-16 Digital Equipment Corporation High-speed pseudo-random number generator and method for generating same
US5535151A (en) * 1993-11-19 1996-07-09 Sony Corporation Electronic processor for performing multiplication
US6760742B1 (en) * 2000-02-18 2004-07-06 Texas Instruments Incorporated Multi-dimensional galois field multiplier
US20090083507A1 (en) * 2007-09-24 2009-03-26 Moore Charles H Shift-add mechanism

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4086474A (en) * 1976-09-30 1978-04-25 Honeywell Information Systems Inc. Multiplication technique in a data processing system
US5287299A (en) * 1992-05-26 1994-02-15 Monolith Technologies Corporation Method and apparatus for implementing a digital filter employing coefficients expressed as sums of 2 to an integer power
JP3081710B2 (en) * 1992-08-18 2000-08-28 株式会社東芝 Multiplier with overflow detection function
US7219112B2 (en) * 2001-11-20 2007-05-15 Ip-First, Llc Microprocessor with instruction translator for translating an instruction for storing random data bytes
US7194496B2 (en) * 2003-05-02 2007-03-20 Spirent Communications Of Rockville, Inc. System and method for producing functions for generating pseudo-random bit sequences
EP1776757B1 (en) 2004-08-09 2019-04-10 Telecom Italia S.p.A. Random number generation based on logic circuits with feedback
US8019802B2 (en) * 2005-08-24 2011-09-13 Qualcomm Incorporated Cryptographically secure pseudo-random number generator
US8489659B2 (en) * 2007-10-19 2013-07-16 Schneider Electric USA, Inc. Pseudorandom number generation

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4947364A (en) * 1985-10-23 1990-08-07 Hewlett-Packard Company Method in a computing system for performing a multiplication
US4901264A (en) * 1987-07-31 1990-02-13 Advantest Corporation Pseudo random pattern generating device
US5117385A (en) * 1990-03-16 1992-05-26 International Business Machines Corporation Table lookup multiplier with digital filter
US5187676A (en) * 1991-06-28 1993-02-16 Digital Equipment Corporation High-speed pseudo-random number generator and method for generating same
US5535151A (en) * 1993-11-19 1996-07-09 Sony Corporation Electronic processor for performing multiplication
US6760742B1 (en) * 2000-02-18 2004-07-06 Texas Instruments Incorporated Multi-dimensional galois field multiplier
US20090083507A1 (en) * 2007-09-24 2009-03-26 Moore Charles H Shift-add mechanism

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090083360A1 (en) * 2007-09-24 2009-03-26 Gibson Dana Elliot Shift-add based parallel multiplication
US7774399B2 (en) 2007-09-24 2010-08-10 Vns Portfolio Llc Shift-add based parallel multiplication

Also Published As

Publication number Publication date
WO2009042106A3 (en) 2010-07-01
WO2009042107A3 (en) 2010-07-01
WO2009042106A2 (en) 2009-04-02
WO2009042107A2 (en) 2009-04-02
WO2009042111A2 (en) 2009-04-02
US20090083507A1 (en) 2009-03-26
WO2009042106A9 (en) 2009-07-09
US20090083350A1 (en) 2009-03-26
US7774399B2 (en) 2010-08-10
WO2009042112A2 (en) 2009-04-02
WO2009042111A3 (en) 2009-06-25
WO2009042112A3 (en) 2009-07-02
US20090083360A1 (en) 2009-03-26
TW200915175A (en) 2009-04-01

Similar Documents

Publication Publication Date Title
US6116768A (en) Three input arithmetic logic unit with barrel rotator
US6058473A (en) Memory store from a register pair conditional upon a selected status bit
US6219688B1 (en) Method, apparatus and system for sum of plural absolute differences
US5805913A (en) Arithmetic logic unit with conditional register source selection
US5596763A (en) Three input arithmetic logic unit forming mixed arithmetic and boolean combinations
US6032170A (en) Long instruction word controlling plural independent processor operations
US6098163A (en) Three input arithmetic logic unit with shifter
US5680339A (en) Method for rounding using redundant coded multiply result
US5465224A (en) Three input arithmetic logic unit forming the sum of a first Boolean combination of first, second and third inputs plus a second Boolean combination of first, second and third inputs
US5590350A (en) Three input arithmetic logic unit with mask generator
US5961635A (en) Three input arithmetic logic unit with barrel rotator and mask generator
US5446651A (en) Split multiply operation
US6016538A (en) Method, apparatus and system forming the sum of data in plural equal sections of a single data word
US20040122887A1 (en) Efficient multiplication of small matrices using SIMD registers
US5493524A (en) Three input arithmetic logic unit employing carry propagate logic
US8433883B2 (en) Inclusive “OR” bit matrix compare resolution of vector update conflict masks
US6067613A (en) Rotation register for orthogonal data transformation
US5596519A (en) Iterative division apparatus, system and method employing left most one&#39;s detection and left most one&#39;s detection with exclusive OR
US6026484A (en) Data processing apparatus, system and method for if, then, else operation using write priority
US5712999A (en) Address generator employing selective merge of two independent addresses
US5442581A (en) Iterative division apparatus, system and method forming plural quotient bits per iteration
US20090083361A1 (en) Shift-add based multiplication
WO2002091166A2 (en) Apparatus and method for uniformly performing comparison operations on long word operands
US6173305B1 (en) Division by iteration employing subtraction and conditional source selection of a prior difference or a left shifted remainder
US6907442B2 (en) Development system of microprocessor for application program including integer division or integer remainder operations

Legal Events

Date Code Title Description
AS Assignment

Owner name: VNS PORTFOLIO LLC, CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:TECHNOLOGY PROPERTIES LIMITED;REEL/FRAME:021839/0420

Effective date: 20081114

Owner name: VNS PORTFOLIO LLC,CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:TECHNOLOGY PROPERTIES LIMITED;REEL/FRAME:021839/0420

Effective date: 20081114

AS Assignment

Owner name: TECHNOLOGY PROPERTIES LIMITED LLC, CALIFORNIA

Free format text: LICENSE;ASSIGNOR:VNS PORTFOLIO LLC;REEL/FRAME:022353/0124

Effective date: 20060419

Owner name: TECHNOLOGY PROPERTIES LIMITED LLC,CALIFORNIA

Free format text: LICENSE;ASSIGNOR:VNS PORTFOLIO LLC;REEL/FRAME:022353/0124

Effective date: 20060419

STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO PAY ISSUE FEE