Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can you make change in this introduction? In this lab we know that we need 15 ce

ID: 2083445 • Letter: C

Question

Can you make change in this introduction?

In this lab we know that we need 15 cents in order to get an item, so we assume any value less than 15 cents will not give us anything. In a way, we have an output: Yes to when we have 15 cents (‘1’) and no to when we have anything less (‘0’). We will use a single binary output for our machine. For the input, we have to enter 15 cents. If you have any experience with a vending machine, you would know that pennies are not accepted. After understanding the input, we will explore later why pennies may not be accepted. That leaves only dimes and nickels being used because: 1. there are no single coins that make 15 cents, 2. Coins other than 15 cents will be much too large to use. We will use two types of coins that will create two inputs with 4 combinations (‘00’, ‘01’, ‘10’, ‘11’).

We have two inputs and four combinations; we can assign the binary numbers with monetary value. ‘00’ will be 0 cents, ‘01’ will be 5 cents, ‘10’ will be 10 cents and ‘11’ will be 15 cents. If we were to use pennies, we would probably have a lot more inputs than we bargained for. Since we want the machine to temporarily store the value of the inputs, we will use the inputs as states. For example, the present state of the machine would be ‘00’ (0 cents) when no one is using it. But when the present state is ‘11’, the machine will have an output ‘1’ and will dispense an item.

After that, we have our inputs, outputs, present states and next states; we can determine the behavior of the vending machine by drawing out a state table. Below is a picture of the state table that we came up with. As illustrated in the state table, the next state depends heavily on the input as the input is where someone enters change.

Explanation / Answer

In this lab one need 15 cents in order to get an item, so assume any value less than 15 cents will not give anything. In a way, one will get an output: Yes to when he/she has 15 cents (‘1’) and no to when anything less (‘0’). Single binary output has been used for machine. For the input, to enter 15 cents. If one have any experience with a vending machine, he/she would know that pennies are not accepted. After understanding the input, explore later why pennies may not be accepted. That leaves only dimes and nickels being used because: 1. there are no single coins that make 15 cents, 2. Coins other than 15 cents will be much too large to use. Use two types of coins that will create two inputs with 4 combinations (‘00’, ‘01’, ‘10’, ‘11’).

two inputs and four combinations; one can assign the binary numbers with monetary value. ‘00’ will be 0 cents, ‘01’ will be 5 cents, ‘10’ will be 10 cents and ‘11’ will be 15 cents. To use pennies, one would probably have a lot more inputs than we bargained for. Since we want the machine to temporarily store the value of the inputs, we will use the inputs as states. For example, the present state of the machine would be ‘00’ (0 cents) when no one is using it. But when the present state is ‘11’, the machine will have an output ‘1’ and will dispense an item.

After that, we have our inputs, outputs, present states and next states; we can determine the behavior of the vending machine by drawing out a state table. Below is a picture of the state table that we came up with. As illustrated in the state table, the next state depends heavily on the input as the input is where someone enters change.