LabVIEW VI's - Binary Operations
I'These VI's involve manipulating binary values.
Binary Conversion
In this VI the user selects various bits by clicking on the lights on the far left of the front panel. The program then outputs a decimal value and displays it on the gauge. In the block diagram each LED represents a boolean true or false. If activated the VI converts it to a 1 using the boolean to (0,1) function. The result is then fed into an expression block which represents the binary conversion. Bit 0 is multiplied by 1, bit 2 by 2, bit 3 by 8, and so on. The results are then added and wired to a numerical display and tank to represent the decimal output.
Binary Addition
This VI takes two decimal values and adds them. The inputs and outputs are then converted into binary bits and represented by the lights. The conversion to binary is done by dividing the decimal numbers by 1023, then cheching to see if the result is greater than 0.5, 0.25, 0.125,, etc. If the quotient is greater than 0.5, the light indicator representing 512 turns on and 0.5 is subtracted from the quotient. The result is then checked to see if it is greater than 0.25. Should it return false the result is passed on. This process continues based on how many bits desired. The VI can convert up to 10 bits.
Binary Multiplicatoin
I'This VI takes two user entered decimal integers and multiplies them. The two inputs and output are converted into binary. The rows of lights correspond to binary bits, which light up represent the binary number. This VI uses the same algorithm as the binary addition VI above.