10-21-2023 08:25 AM
Write a program to convert binary number to decimal number (Do not use the inbuilt
function in Labview. Use basic mathematical functions and loops).
10-21-2023 08:40 AM
@rajkumar523 wrote:
Write a program to convert binary number to decimal number (Do not use the inbuilt
function in Labview. Use basic mathematical functions and loops).
Alright, we won't do your homework but we can help with defining the steps.
LabVIEW is an acronym. This entire board is about LabVIEW. The topic title "labview" provides us no guidance on what your needs might be.
10-21-2023 08:44 AM
im new to labview , if 7u can help help me
10-21-2023 09:05 AM - edited 10-21-2023 09:11 AM
@rajkumar523 wrote:
im new to labview , if 7u can help help me
Sure I can help. But I do need to know the datatype of the input.
For example; if the input is a string simply use String to byte array compare the byte array to 0d49 to output an array of boolean where "1" = TRUE. Reverse the array and use T/F to 0 1 from the conversion pallet. Autoindex the reversed 0 1 array in a for loop with an U32 Shift Register initialized to 0. AND each element with the value on the Shift Register then wire the AND to an output tunnel set to Last value. Also branch the AND output, Left Shift it and wire that to the Shift Register. Wire the output tunnel to an indicator.
BONUS: Show the radix of the U32 indicator and toggle between decimal and binary to check your work.
There are about a thousand different ways to get the same result, even on a string input. What have you tried?
10-21-2023 10:52 AM - edited 10-21-2023 11:02 AM
To get help, you need to define the problem.
What is a "binary number" (under the hood, everything in a computer is binary one way or another!)
What is a "decimal number"?
For easy testing and verification of the correctness, I would include code to convert a number to binary, then add your code to convert back so you can test if the result is correct and matches the original value..
10-21-2023 11:22 AM
Start with trying to implement the following in LabVIEW, then modify to improve to adapt to your actual input and output.
I intentionally did not label any of the functions or structures and let you figure it out. This should give you plenty of opportunities to learn. Start with a few basic tutorials and ask questions if you get stuck. there are plenty of learning resources listed at the top of the forum.