# Circuit design for change machine

#### Thomas D M Thompson

Joined Oct 13, 2015
7
Hello Everyone,

I have spent hours on this assignment only to come up short on a good result. Essentially we must design a machine that takes .50 cents or one dollar and upon receiving two dollars in total vends a stamp.

Here are the truth tables as well as simplified formulas that I have made:

A1 = A'C + AC'D' + AB'D + A'BD
B1 = BC'D' + B'D + A'BC
X = ABD + AC
Y = ABC

What happens is when I start inputing either C or D it ends up skipping an input, then it works fine afterwords. I tried without do not care terms and it wouldn't function at all. If you need to see my K-Maps or other information I can provide that as well.

#### WBahn

Joined Mar 31, 2012
26,422
How can we possibly evaluate your table when you give no indication what your inputs and outputs are. C and D are not very meaningful input names -- I'm guessing one of them is for 50 cents and the other is for a dollar. Similarly, x and y are not very meaningful output names. I'm guessing one of them is to vent a stamp, but you give no hint what the other one might be, let along which is which.

#### Thomas D M Thompson

Joined Oct 13, 2015
7
My apologies. C is a dollar, and D is 50 cents. X is a stamp is vended and Y is 50 cents in change is returned.

#### WBahn

Joined Mar 31, 2012
26,422
Is this a Mealy or a Moore machine?

#### WBahn

Joined Mar 31, 2012
26,422
What information is represented by each state?

#### Thomas D M Thompson

Joined Oct 13, 2015
7
Mealy Machine. The states are as follows: S0=00, S1=01, S2=10, S3=11. They are D-flip-flop storage units. In the state diagram it is CD/xy for inputs CD and outputs xy

#### WBahn

Joined Mar 31, 2012
26,422
What does each state MEAN?

If the machine is in state S2, what information do you know about the system. Remember, in a state machine, the state captures all of the relevant history about the entire history of the machine, so you need to be able to articulate what that relevant history is?

#### Thomas D M Thompson

Joined Oct 13, 2015
7
S0 is when no form of money has been entered. S1 is when .50 cents is registered with the machine. S2 is when 1.00 is registered with the machine. S3 is when 1.50 is registered with the machine.

#### WBahn

Joined Mar 31, 2012
26,422
I think your equations are correct.

What do you mean by "it skips an input"?

#### Thomas D M Thompson

Joined Oct 13, 2015
7
I found out when I run the clock cycle on the chip and leave an input on it immediately registers the value and outputs it as though a previous input had occurred (such as when D is activated, it sends two 1s through the circuit).

#### WBahn

Joined Mar 31, 2012
26,422
Immediately registers what value where? Sends two 1s through the circuit how?

A schematic would certainly be nice.