Example Code

VI Block - DECIMAL to BINARY CONVERTER [(0to15) to (0000to1111)]

Code and Documents

Attachment

This VI allows you to a DECIMAL to BINARY conversion.
Entering a decimal number from 0 to 15, you will have the conversion on 4 Binary Outputs.

Number as an input (0 to 15).
B0 as the lowest Output value, follows B1, B2 and B3.

Example:

Entering 6 as Input (Numeric), you'll have the corrisponding in Binary, in this case: 0101.

Follows the truth table:

B3   B2   B1   B0        Numeric (0 - 16)

0      0     0      0                     0

0      0     0      1                     1

0      0     1      0                     2

0      0     1      1                     3                    

0      1     0      0                     4

0      1     0      1                     5

0      1     1      0                     6

0      1     1      1                     7

1      0     0      0                     8
1      0     0      1                    9

1      0     1      0                    10

1      0     1      1                    11

1      1     0      0                    12

1      1     0      1                    13

1      1     1      0                    14

1      1     1      1                    15


Mattia Perazzelli

Student at I.T.I. Guglielmo Marconi

Campobasso - Italy

Electronics and Telecommunications

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors