How much money has the customer deposited

Assignment Help Other Engineering
Reference no: EM131101097

E15: Fundamentals of Digital Systems - Fall 2010 - HOMEWORK 7

1) Each of the following state machines can be implemented with a single D flip-flop and some additional gates. Determine the state transition function for these state machines, and draw a circuit diagram. Be sure to include clock and reset lines.

a. There is a single input X. When X=0, the next state N is equal to the current state S; when X=1, the next state is equal to the complement of the current state.

b. There are two inputs A and B. When A=0 and B=0, the next state is equal to the current state; when A=0 and B=1, the next state is 0; when A=1 and B=0, the next state is 1; and when A=1 and B=1, the next state is equal to the complement of the current state.

2) Implement the state machines above in Verilog by instantiating the following D flip-flop module:

1501_Figure.png

a. Create a module flippy(clk, rst, X, S) implementing the first state machine. Let S, the current state, be the output of your module.

b. Create a module floppy(clk, rst, A, B, S) implementing the second state machine.

3) Create a state machine that has 5 bits of input (W, D3, D2, D1, D0), and 4 bits of state (S3, S2, S1, S0). The transition to the next state Ni from the current state Si is determined by the truth table below:

W

N3

N2

N1

N0

1

D3

D2

D1

D0

0

S2

S1

S0

D0

a. Draw a gate diagram implementing the state machine. Be sure to include clock and reset lines.

b. Create a Verilog module shifty(clk, rst, W, D, S) implementing the state machine by instantiating the dff module above four times. Let S, the 4-bit current state,)be the output of your module.

4) An accumulator is a special type of state machine that adds up a series of numbers, one at each clock cycle. We will create a 4-bit accumulator which has 4 bits of input (X3, X2, X1, X0) and 5 bits of output (R3, R2, R1, R0, F). The R outputs are the 4 bits of the running total, and the F output is set to 1 if the running total cannot be properly represented in a 4G-bit number (i.e. if overflow occurred while summing up the inputs).

a. A 4-bit adder has three inputs: two 4-bit addends A and B, as well as a 1-bit carry input Cin. The adder has a 4-bit output S indicating the sum of A and B as well as a 1-bit carry output Cout.

Show that a 4-bit accumulator can be implemented with a 4-bit adder, five D flip-flops, and one additional OR gate. Draw a diagram. For clarity, you can leave out the clock and reset lines.

b. Create a Verilog module accum4(clk, rst, X, R, F) implementing a 4-bit accumulator. Your module should instantiate the dff module above five times, and instantiate the 4-bit adder module add4 once:

2176_Figure1.png

5) Create a state machine to recognize the sequence 1001. Your state machine should have a single bit of input X and a single bit of output Y, which is 1 for the input sequence 1001, and 0 otherwise. Note that the sequence 1001001 should cause the output to be 1 twice: once for the second 1 in the input and once for the third 1 in the input.

a. Draw a state diagram for a Moore state machine recognizing the sequence 1001.

b. Draw a state diagram for a Mealy state machine recognizing the sequence 1001.

c. How many bits of state are required for the Moore state machine? How many for the Mealy? Which design would use fewer flip-flops?

d. Create a Verilog module seq1001_moore(clk, rst, X, Y) which uses behavioral Verilog (not)using the dff module - like we saw in class on Friday) to implement your Moore state machine.

e. Create a Verilog module seq1001_mealy(clk, rst, X, Y) which uses behavioral Verilog to implement your Mealy state machine.

6) Bob the digital circuit designer has been assigned to implement a digital circuit for a Coke machine. A Coke costs 0.15. (Wow, cheap Coke!) The machine accepts only nickels and dimes.

The circuit has three inputs: N, D, and R. The N input is set to 1 if a nickel was inserted, D if a dime was inserted, and R if the change return button was pressed. At most one of the inputs can be set to 1 at once (it's impossible to insert a nickel and a dime at the same time, and the change return button is simply ignored in the unlikely event that a coin was dropped in the same clock cycle). The clock input flips every 10 µs. When an input is set to 1, it turns on 5 µs before the positive edge of the clock, and stays on for 20 µs.

The circuit has two outputs: C and L. When C goes from 0 to 1, the coins in the collector are returned to the customer, and when L goes from 0 to 1, the latch to dispense a Coke is released, and the coins in the collector are stored inside the machine.

Here is the circuit that Bob designed:

2130_Figure2.png

What's supposed to happen is this: when a customer puts in coins, the machine waits until at least 0.15 is deposited, and then dispenses a soda. If the customer hits the change return button before $0.15 is deposited, their money is returned. However, the machine isn't working correctly!

Help Bob find out what's wrong with the machine:

a. Write a Boolean function for N0 in terms of the current state and inputs. Do the same for N1.

b. Explain, in plain English, the conditions under which S0 will become 1 (i.e. N0 is 1). Do the same for S1.

c. It is given that at)most one of N, D, and R can be 1. Explain why exactly one of N, D, R, and X is 1 at any time.

d. Create a truth table for N1 and N0 by considering each possible state of S1 and S0, and each possible "input" (N, D, R, or X). Since there are 4 possible states to be in (00, 01, 10, 11) and four possible inputs, your truth table should have 16 rows. The first four rows look like this:

S1

S0

input

N1

N0

0

0

N

0

1

0

0

D

1

0

0

0

R

0

0

0

0

X

0

0

e. Assume the machine starts in state 00. How much money has the customer deposited when it is in state 01? How much when it is in 10?

f. Create a state diagram for the machine. Start with state 00. Each state should have 4 edges (arrows) emerging from it, labeled N, D, R, or X. Leave plenty of room to add notation for the outputs (see next item).

g. Is the state machine a Moore state machine or a Mealy state machine? If Moore, label each state in your state diagram with the outputs C and L. If Mealy, label each edge in your diagram with the outputs C and L.

h. Can the machine ever enter state 11 through normal operation? Why or why not?

i. Explain, using your state diagram, that inserting a nickel followed by a dime results in the correct dispensing of a soda.

j. Explain two ways that a soda can be purchased for only 0.10.

k. Explain how a clever customer can get two sodas for the price of one.

l. Does Bob's choice of Moore vs. Mealy seem incorrect to you? Explain why or why not.

Reference no: EM131101097

Questions Cloud

On what scale is the speed of each car measured : On what scale is the speed of each car measured?
Pure residual dividend policy : If the company follows a pure residual dividend policy, how large a dividend will each shareholder receive this year? If the company maintains a constant dividend payout ratio each year, how large a dividend will each shareholder receive this year?
What a great definition of cryptography : Timothy, what a great definition, cryptography is the science of decoding information with a key and like Timothy stated, these keys are both "public (lock) and private (unlock)."
Amazon company using ratio analysis : Analyze the strengths and weaknesses of the Amazon company using ratio analysis, and present your findings in a paper of 1,500-2,000 words.
How much money has the customer deposited : E15: Fundamentals of Digital Systems - Fall 2010 - HOMEWORK 7. Assume the machine starts in state 00. How much money has the customer deposited when it is in state 01? How much when it is in 10
The podcast available through the link above : Listen to the podcast available through the link above. How did this podcast enhance or differ from what was covered in your reading and class discussions? What is one lesson that you can take from it? Answer in 1-2 paragraphs (5-7 sentences each)..
What are the values that x may assume : What are the values that X may assume?
What is the value of the stock : A stock will pay dividends of $1.0, $4.0, and $8.0 over the next three years, and then increase dividends at a rate of 7.0% afterwards. Its required rate of return is 19.0%. What is the value of the stock? Round to the penny.
What is the value of the stock : A stock just paid a dividend of $3.0, and dividends will increase by 2.0% every year. Its required rate of return is 18.0%. What is the value of the stock?

Reviews

Write a Review

Other Engineering Questions & Answers

  Calculate required output by a single excavator

Calculate required output by a single excavator appropriate to this production and select an appropriate machine - calculate cycle times for trucks.

  Find the largest possible positive-going steps at the output

A class AB output stage, resembling that in Fig. 12.11 but utilizing a single supply of +10 V and biased at VI = 6 V, is capacitively coupled to a 100-_ load. For transistors for which / VBE /= 0.7 V at 1 mA and for a bias voltage VBB =1.4 V, what..

  Discuss the nature of wave impedance at a distance of 1 metr

The field coil of a 'deactivation pad' operating at 60 kHz. The pad is used in retail stores to demagnetise the tags attached to merchandise to prevent theft.

  Question 1 a water tower has been cleaned with a chlorine

question 1 a water tower has been cleaned with a chlorine solution and the chlorine vapors in the tower exceed the

  Which of the following is equal to the angular velocity

Which one of the following expresses an impedance of 50 OHMS with no resistance component in rectangular coordinates - The bandwidth of a series-tuned circuit is that range of frequencies between where the voltage is of the maximum voltage.

  Obama administration levies punitive tariffs on inporting

Obama Administration levies punitive tariffs on inporting tires and solar panel from China in the name of saving American jobs. Does tariff save jobs? Please specify your points of view. Student 1

  Determine the rate of energy destruction

If the temperatures of the inner and outer surfaces of the bottom of the pan are 104°C and 105°C, respectively, determine the rate of energy destruction within the bottom of the pan during this process, in W. Take T0 = 25°C.

  Which car was going faster

Each driver claimed that he was going at the speed limit of 30 mi/h and that he tried to slow down but couldn't avoid the crash because the other driver was going a lot faster. Knowing that the weights of cars A and B were 3600 lb and 2800 lb, res..

  The insane home crowds and peerless support

Portland is not just a great city. It is a city that has every kind of aspects such as parks, bars, sports, weather, etc. Sports are all over the place in Portland. Basketball for example is the famous and more popular sport in the city. The baske..

  Describe architecture pattern

Describe your chosen architecture pattern. Explain why you selected the architecture of this case study. Explain how your chosen pattern could be applied to this case study.

  Statistics for the behavioral and social sciences

What would be the null and what would be the alternative hypothesis?

  Required to use agilent function generator

Use Multisim and construct the circuit shown in Figure 1 below.  Measure VB, IE and VC. Check your input signal with the oscilloscope to make sure you have correct amplitude, frequency value and frequency type.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd