Back to MiscEl main page | Write a message to author |

This page is used to calculate some usefull integer stuff.

- Greatest common divisor (GRC), the largest divisor common to a list of numbers
- Least common multiple (LCM), the smallest number that is a multiple of all numbers in a list
- Prime factors, splits a number into prime factors
- Word size, list range and step size for a word N bits wide
- Gray codes, generates a list of gray codes
- Bit size, list what word size a is required for a number, and max. multiplier that can be used without overflow
- Real number to fraction (Mult/Div), finds a integer substitute for a real number
- Real number to fraction with either numerator or denominator is locked to a power of two

Value | A real number |

Digits | Number of binary digits (bits) |

Values | One value for each field |

Gretest common divisor (GRC) | Lists the GRC and the result of dividing each value by GRC |

Least common multiple (LCM) | Lists the LCM and the result of dividing each value into LCM |

Prime factors | List all primefactors for each number |

Word size | List number of steps, precision, range, and some other stuff |

Gray codes | List a gray code table (up to 9 digits), or the formula for calculating the gray codes (10+ digits) |

Bit size | List minimum number of bits required to represent each number |

Real to Mult/Div | Find a fraction to substitute for the real number, will also specify value limits in different word sizes |

Real to Mult/Div with x/2^n | Find a fraction to substitute for the real number, but limits the denominator to powers of 2, will also specify value limits in different word sizes |

Real to Mult/Div with 2^n/x | Find a fraction to substitute for the real number, but limits the numerator to powers of 2, will also specify value limits in different word sizes |

Real to Mult/Div with x/2^wordsize | Find a fraction to substitute for the real number, but limits the denominator to wordsize. This function used the fact that most multiply instructions returnes a result with twice the wordsize, making a division with wordsize free (i.e. just use the lsb) |

Use standard signed bits | Include word sizes of 7,15,31 bits |

Use standard unsigned bits | Include word sizes of 8,16,32 bits |

More bits | Specify other word sizes (multiple specifications of the same wordsize are ignored) |

Add spaces | Show all integer numbers with a space for every 3 digits, to improve readability |

- Remember that divide is the same as multiply with 1/x, i.e. to calculate a divide with 3, specify 1/3 as value
- For multiplying with values below 1, use "Real to Mult/Div with x/2^wordsize"

- MPU Support list where MiscEl can help when working with microprocessors