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 the average dry and web bulb temperatures

Calculate the average dry and web bulb temperatures and find the relative humidity using the Psychometric chart and submit with your assignment

  Draw on relevant theoretical and management concepts

Draw on relevant theoretical and management concepts covered through the course and describe the problem or issue and critically analyse the issue including considerations of relevant policy and ecological factors

  Does each solution stop all the negative effects

How long has this situation been going on? Why did the problems begin when they did? Am I able to solve the problem at its root cause or am I only able to manage the impact of the problem? Is this a temporary or permanent problem? How has the company..

  Critical awareness of the concept of decision support

CISM02 Critical awareness of the concept of decision support and its effects on all parts of an organisation - critical understanding of modelling and simulation

  Amount of primary settlement

Explain the factors that affect the amount of primary settlement and the rate of primary settlement expected in a layer of soil.

  Determining the components of the force

A steel rod is bent into a semicircular ring of radius 36 in. and is supported in part by cables BD and BE which are attached to the ring at B. Knowing that the tension in cable BD is 55 lb, determine the components of the force exerted by the cab..

  What is your opinion of the quiescent operating point

What is your opinion of the Quiescent Operating Point (Q-Point)? Do you feel this is the mandatory level that is used to optimize a transistor biasing design in a circuit?

  Part iusing the data provided on the webvista site in the

part iusing the data provided on the webvista site in the file marked vdw.txt try to develop a mathematical equation

  Power supplies that provide the dc voltage necessary

Connect the the bridge rectifier circuit shown in Figure 1. Notice that no terminal of the transformer secondary is at ground potential (some simulation software will not run if is not connected to the ground, check yours).

  Draw the voltage phasor diagram for the circuit

1. How much energy is stored by a 100 mH inductor with a current of 1 A? 2. A 15 kHz sinusoidal voltage is applied to a series RL circuit. Determine the frequency of I, VR, and VL.

  Analog design and in particular op amp design

Discuss why analog design and in particular op amp design is a fundamental skill that will be required far into the future.

  Design a mine ventilation network

Draw in a decline from the surface (at -100) with nodes placed at every sub level to allow the break-offs to be established. Two ways are recommended to draw horizontal airways between levels.

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