Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do it in LABVIEW program. Please include block diagram and do not draw on paper. DUE IN 20 minutes. Ill give a thumbs up

image text in transcribed

Please do it in LABVIEW program. Please include block diagram and do not draw on paper. DUE IN 20 minutes. Ill give a thumbs up thank you!

2. a. Create a subvi that rolls a dice by creating a random integer from 1 to 6. Create an icon and wire the "roll" indicator to the connector pane then save the subvi. b. Now use the subvi inside a vi that counts how many times in a row you roll the same thing as the first roll. It does not matter what the first rollis, but the next ones need to match it to be counted and you stop rolling when the roll differs from the first roll. For example, if you roll 5,5,6 then your vi would tell you that 2 were the same. Your vi should display the first roll and the last roll in this case 5 and 6) as well as the count of the number of rolls that were the same. When turning in this problem, include the block diagram of your "dice" subvi, and the block diagram and front panel of your "same counter" vi. You will be using this vi as a subvi for part 2 of the exam on Monday, so if you do not get it working please work on it over the weekend and make sure you save it somewhere you can access on Monday. First Roll 5 Last Roll 6 # of Same Rolls 2 HINTS: To do this, you will need a while loop with a shift register. Initialize the shift register with a roll from your dice subvi (the first roll). Then stop the while loop if the next roll (from a second instance of your dice subvi) is different from the previous one. You should use your dice subvi from part a. twice, once to initialize your shift register and once inside your while loop. In other words, the "number in your head" is the previous roll and when your current rollis different from your previous roll you can stop rolling the dice. After you stop, the number of iterations can be used to show how many times you rolled the dice. Don't forget "i" starts at zero and that you have already rolled the dice once when the loop starts, plus you don't want to count the roll that is different. To test the vi, you should see that most of the times you run it you get "1" same roll because you have just a 1 in 6 chance of the second roll being the same as the first roll. Every once in a while you should get 2 (about once out of 6 but not exactly). It should be unusual to roll 3 in a row (once out of 36 tries on average). 2. a. Create a subvi that rolls a dice by creating a random integer from 1 to 6. Create an icon and wire the "roll" indicator to the connector pane then save the subvi. b. Now use the subvi inside a vi that counts how many times in a row you roll the same thing as the first roll. It does not matter what the first rollis, but the next ones need to match it to be counted and you stop rolling when the roll differs from the first roll. For example, if you roll 5,5,6 then your vi would tell you that 2 were the same. Your vi should display the first roll and the last roll in this case 5 and 6) as well as the count of the number of rolls that were the same. When turning in this problem, include the block diagram of your "dice" subvi, and the block diagram and front panel of your "same counter" vi. You will be using this vi as a subvi for part 2 of the exam on Monday, so if you do not get it working please work on it over the weekend and make sure you save it somewhere you can access on Monday. First Roll 5 Last Roll 6 # of Same Rolls 2 HINTS: To do this, you will need a while loop with a shift register. Initialize the shift register with a roll from your dice subvi (the first roll). Then stop the while loop if the next roll (from a second instance of your dice subvi) is different from the previous one. You should use your dice subvi from part a. twice, once to initialize your shift register and once inside your while loop. In other words, the "number in your head" is the previous roll and when your current rollis different from your previous roll you can stop rolling the dice. After you stop, the number of iterations can be used to show how many times you rolled the dice. Don't forget "i" starts at zero and that you have already rolled the dice once when the loop starts, plus you don't want to count the roll that is different. To test the vi, you should see that most of the times you run it you get "1" same roll because you have just a 1 in 6 chance of the second roll being the same as the first roll. Every once in a while you should get 2 (about once out of 6 but not exactly). It should be unusual to roll 3 in a row (once out of 36 tries on average)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

3. Job rotation is used for all levels and types of employees.

Answered: 1 week ago