To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI demonstrates how to convert between base 10 and base N numbers using unsigned integer arrays.
Description
Here is a brief description of the example:
"ConvertToBase.vi" takes a base 10 value and converts it into an array that represents the number in a differing base. From base^0 to base ^ i in length depending on how large the number is. This is achieved through iterative Quotient & Remainder operations, outputting the remainder into an auto indexed array, with the Quotient being passed through a shift register into the next iteration.
The math is based on the example found here: https://www.mathsisfun.com/base-conversion-method.html
"ConvertFromBaseTo10.vi" reverses the process and produces a base 10 integers from an array of base powers. This applies an iterative summation of the value of each index in the array multiplied by the base ^i value.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
Convert From Base To 10.vi:
Convert to Base.vi:
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
For larger applications I would suggest taking out the property node in "ConvertFromBaseTo10.vi" as it can slow down processes with multiple iterations.