Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method for computing remainder of mode number division of integer

A modulo and remainder technology, applied in the field of remainder of modulo division, which can solve problems such as inapplicability and large amount of calculation.

Inactive Publication Date: 2010-06-02
武汉飞思科技有限公司
View PDF1 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] 2) Patent 99109437.9 proposes a non-iterative method for calculating the remainder of modulus division, which solves the problem of large amount of calculation caused by iteration, and the algorithm does not depend on the number of digits of the divisor of modulus operation
This shows that this calculation method cannot be applied to the case where the dividend and the divisor are any value

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for computing remainder of mode number division of integer
  • Method for computing remainder of mode number division of integer
  • Method for computing remainder of mode number division of integer

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0026] The present invention will be described in further detail below in conjunction with the accompanying drawings.

[0027] figure 1 A flowchart for calculating the remainder of modulo division of integers, such as figure 1 As shown, the calculation steps are as follows:

[0028] (1) Obtain the dividend M and the divisor D through the input device connected with the computing device or through the storage device connected with the computing device, and judge the size relationship between M and D: if M

[0029] Then remainder R=M, end calculation, otherwise go to (2);

[0030] (2) Divisor M is converted into binary bit M=M 0 ×2 0 +M 1 ×2 1 +...+M n-1 ×2 n-1 , get the coefficient M of each weight i (i=0~n-1) and binary digit n;

[0031] (3) Determine the number of input parameters of the first stage of pipeline processing according to the dividend M: if 2 j 2j , where j is the set {1, 2, 4, ..., 2 m}, m is a natural number,

[0032] Then the number of input pa...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention provides a method of counting remainder of module division of integer, relating to a method of counting module, characterized in that the counting step includes following: 1. judging size relation of M and D; 2. changing the dividend M to bit; 3. determining numbers of pipeline treatment the first level input parameter according to the dividend M; 4. checking the remainder table stored in the counting device according to the results of coefficients Mi(i=n-1) of each weight, obtaining ri(i=0,1...n-1); 5. ensuring the input parameter of the pipeline treatment the first level; 6. ensuring pipeline level numbers and amount of sub-treating program of each level; 7. ensuring the input parameter of sub-treating flow; 8. starting the counting process of sub-treating process;9. judging whether all the sub-treating processes being completed or not, if no, changing to the step 7, otherwise, the finally counting result is value of the remainder. The method of counting remainder of module division of integer adopts a pipeline treatment mode, convenient for hardware implementation, overcoming the deficiency of large counting amount of the traditional iterative method, andhaving no limit to the divisor and the dividend.

Description

technical field [0001] The invention relates to a method for calculating modulus, in particular to a method for calculating the remainder of integer division by modulus. Background technique [0002] The modulus value n of an integer m, usually denoted m mod n. Finding the modulus of an integer has great practical significance, because it is necessary to find the modulus of an integer in many cases, such as in some load balancing methods, packet switching and transmission, digital message encoding / decoding, computer graphics, division Moderate operation. [0003] There are two problems in the existing modulus algorithm: [0004] 1) The traditional algorithm is implemented through iteration, which requires a large amount of calculation. If the divisor D=2N-1 (N is a natural number) is an n-digit integer, the dividend M is less than or equal to (D-1) 2 Any positive integer of , that is, M is a 2n-bit integer when it is the largest, and the traditional iterative method requ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F7/72G06F7/535
Inventor 黄建徐晶丁国荣许炜范兵汪进陈丽萍张伟伟
Owner 武汉飞思科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products