LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView Assignment

Solved!
Go to solution

I could use a bit of help here, I have an assignment that outlines the following below.

"Craft a front panel and corresponding block diagram to convert decimal numbers into binary format using the remainder method, a foundational approach to understanding binary conversion."

I'm not too sure on how to approach nor solve this problem and would like some assistance.

0 Kudos
Message 1 of 4
(1,145 Views)
Solution
Accepted by topic author Branda

Suppose I asked you to express 5 in binary.  What would you do?  Sit down with pencil and paper, try to go through the steps of arithmetic that you would need to do, and see if you can generalize the pencil-and-paper "algorithm" to handle an arbitrary (within reason!) number.

 

Breaking an abstract problem into simple steps is the key to developing algorithms.  Of course, you do need to know how to understand "number representation" (i.e. what 123 means in decimal, and 1011 means in binary).

 

Once you have the steps, express your algorithm in LabVIEW.  There are Add, Subtract, Multiply, Divide operations you might want to use, there are structures that let you do things repetetively (which you might need), and structures that let you make a "choice" (which you also might need).

 

Try it.  Start with the familiar ("123 in decimal") and then try the unfamiliar (123 in binary).  If you want to learn Programming, you need learn how to think like a programmer (break the problem into simpler problems, pencil and paper are good starting points).

 

Bob Schor

Message 2 of 4
(1,135 Views)

Thank you and that's exactly what I did, I went added and just refreshed my memory on how to convert decimals to binary then tried to implement it in LabVIEW.

 

I am not sure if I did it properly though, this is it:

 

0 Kudos
Message 3 of 4
(1,106 Views)

Sigh.  Suppose we deal with decimal numbers, and I give you the number 12345 (twelve thousand 3 hundred and 45), and I want you to write it as a string, "12345".  Suppose I give you a simpler problem -- tell me what the last character representing the least significant digit was.  You'd look at the number and say "5".  How did you get that?  What did you do with the given number, 12345, to get the "partial answer", 5?  Once you had the 5, what was left?  What interesting thing could you do with this to (maybe) get another number?  Do you see a pattern?  [You didn't understand why I said "Pencil and paper" -- actually write things down, do the arithmetic, don't try to write code!]

 

If you do this "by hand", at some point, you should get the "Aha!" moment when the numbers 5, 4, 3, 2, and 1 appear on your piece of paper written by you in pencil.

 

Why are decimal numbers called "decimal"?  [From Google: decimal -- relating to or denoting a system of numbers and arithmetic based on the number ten, tenth parts, and powers of ten.]

 

Why are binary numbers called "binary"?  Can you translate what I tried to get you to do with decimal numbers with a number expressed in "binary"?

 

Bob Schor

Message 4 of 4
(1,068 Views)