Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 4 out of 5     Rate this Document

When I Convert a Number to a Boolean Array, How Do I Reverse the Order of the Output Array?

Primary Software: LabVIEW Development Systems>>LabVIEW Full Development System
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>LabVIEW Base Package, LabVIEW Development Systems>>LabVIEW Professional Development System

Problem: When I convert a number to a boolean array using the "Number to Boolean Array" function, the least significant bit of the boolean/binary value appears first. For example, the number "14" converts to boolean values of "0, 1, 1, 1" instead of "1, 1, 1, 0" as I would expect. How do I get the most significant bit to display first?

Solution: Use the "Reverse 1D Array" function, found in the Array subpalette, to perform this array reversal. This will then display your boolean values with the most significant bit first. Please view the example program that is attached for an example of this functionality.

Related Links:
KnowledgeBase 1BLC7RU0: One's Complement and Two's Complement of a Binary Number in LabVIEW
KnowledgeBase 2MKB41DV: How Can I Read the Binary Representation of a Floating Point Number in LabVIEW?


Attachments:


Convert Number to Reversed Binary Array.vi


Report Date: 05/30/2003
Last Updated: 10/22/2004
Document ID: 2XTEFETP

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit