Binary Numbers VI
The goal of this exercise is to build a VI to study different number bases, especially base 2 - the binary number system.
- Start with a simple numerical control and indicator. Wire them up and see how one controls the other. Save this VI as BinaryCounter.
- Change the representation of the control and indicator from the default double precison (DBL) to an integer byte (I8).
- What are the limits of the number?
- Change the Format of the indicator (under Properties) to binary. Explain the binary format.
- Change the representation of the control and indicator to unsigned integer byte (U8).
- Now what are the limits of the number? Explain the binary format.
- Add multiple indicators to your VI and set them to display decimal, hexadecimal, octal, binary, and boolean. For the boolean case, you first need to convert number to boolean array, and to make sure we have only 8 bits, put a convert number to integer byte before that. Create a duplicate boolean indicator with the array reversed. Explain each indicator and its number base format.
- Change the control to unsigned integer word (U16). Leave indicators as U8. Examine and explain the limits now.
- Get LabVIEW to do the counting automatically by putting all your program inside a while loop and save this new VI as BinaryLooper.
- Use the iteration terminal to do the counting.
- Add a time delay to the loop to slow it down.
- Discuss the different wire types and colors used in your VI.
Different data types are indicated with different colors.
- Floating point numbers (decimal numbers) are shown in orange color. The letters DBL on the icon are for double, which refers to floating point numbers with double precision, which expresses the numerical accuracy of the internal representation of the number in the computer. You can think of floating point numbers as decimal numbers. One example is the numeric control.
- Integers are shown in blue color. One example is the numeric constant of value 1000.
- Boolean data are shown in green color. The letters TF on the icon are for True/False, which are the two possible boolean (logical) values of the element. One example is the Stop button.
- Textual data are shown in pink color. One example is the string control.
- Cluster data are shown in brown color. Clusters are multivariables. They contain one or more elements of possibly different data types. One example is a waveform.