摘要 |
A microprocessor (10) comprises a compiler (4), which, for a source program including an integer division q=int(a/b) (int( ) is a function discarding figures below decimal point in parentheses) for dividing integer a, expressed in N bits, by integer constant b, causes a computer to execute a first process for calculating mb=int(m/b) (where m=2N), and a second process for generating an object code, which stores the mb in a first register (24), calculates qx=int(axmb/m), calculates rx=a-qxxb, set a quotient q to q=qx when rx<b, or q=qx+1 when rx>=b; and a microprocessor having an arithmetic circuit (11), which comprises the first register, a multiplier (14), and an adder-subtractor (16), and which executes the object code generated by the compiler.
|