LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

12 bit Decimal to binary converter with 8 bit msb and 4 bit lsb

I want to make a vi  12 bit decimal to binary converter  with 8 bit MSB and 4 bit LSB

 

 

 

Thanks in advance

0 Kudos
Message 1 of 12
(6,307 Views)

There are no 12 bit numbers in modern CPUs. Numbers are 8, 16, 32, 64 or 80 bit usually.

 

That being said, your number is already a subset of another number (most likely 16 bit).

Using the "Split Number" function in the Data Manipulation palette, you can split it to two 8bit numbers.

It is not possible to split a number to 4 bit.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 12
(6,297 Views)

Hi DK,

 

some elementary math may help:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 12
(6,296 Views)

Hehe, good example, Gerd.

Working with "masking" (the AND-operation) will reduce the amount of significant bits to a desired amount. Still, the number itself is of higher resolution.

 

So when using this approach (which is the only possible), you have to keep in mind that computing values with that "12bit" number might require some additional masking functions (e.g. addition, multiplication, ..)

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 12
(6,289 Views)

Will You Please upload The Vi

0 Kudos
Message 5 of 12
(6,282 Views)

Hi DK,

 

this "VI" consists of just 2 basic functions and 2 constants, you should be able to recreate it in a minute.

 

And it's a snippet anyway...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(6,275 Views)

Hi GerdW

 sorry i dont have much experience in labview. I didnt able to fix the constants

 

0 Kudos
Message 7 of 12
(6,266 Views)

Hi DK,

 

you get experience by programming on your own 🙂

 

Create a numeric constant, set it to U16, show the radix, input the values as shown above...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(6,264 Views)

Thanks I am trying ..but i didnt able  to enter the value

 

0 Kudos
Message 9 of 12
(6,254 Views)

Hi Dk,

 

it seems you didn't follow that simple 4 step procedure:

- create a numeric constant

- set the representation to U16

- show the radix (and set to hex as shown above)

- input the values I used above...

 

Come on...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(6,252 Views)