L12 - Controller Design ECE 152A Fall 2006 Coke Machine...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Controller Design ECE 152A – Fall 2006 November 21, 2006 ECE 152A - Digital Design Principles 2 Coke ® Machine ± This example illustrates the design a controller for a Coke ® machine ² The machine accepts only nickels and dimes, and a Coke ® costs 15 cents …this is a very old Coke ® machine
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 November 21, 2006 ECE 152A - Digital Design Principles 3 Coke ® Machine ± There are three inputs to the controller ² clk ² dime ± when = 1, indicates that a dime has been inserted ² nickel ± when = 1, indicates that a nickel has been inserted ² Assume that dime and nickel will never be 1 at the same time November 21, 2006 ECE 152A - Digital Design Principles 4 Coke ® Machine ± The controller has 2 outputs ² dispense ± which when = 1, dispenses the Coke ® ² change ± which when = 1, returns a nickel in change ± Design the controller as a Mealy machine ² Implement the design in Verilog
Background image of page 2
3 November 21, 2006 ECE 152A - Digital Design Principles 5 Coke ® Machine ± State diagram ² Input = Dime Nickel ² Output = Coke ® Change ² Dime = Nickel = 1 invalid input ± Three Nickels ± Dime Dime ± Nickel Dime 0 10¢ 00/00 01/00 00/00 10/10 01/00 00/00 10/00 10/11 01/10 November 21, 2006 ECE 152A - Digital Design Principles 6 PLD Implementation ± Logic All variables Complements AND Level OR Level Selectable inversion
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 November 21, 2006 ECE 152A - Digital Design Principles 7 PLD Implementation ± Registers and Wires Wire (bypasses flip flop) Reg (data loaded on clock) Tri-state control Reg/Wire select November 21, 2006 ECE 152A - Digital Design Principles 8 Continuous Assignment of Output ± Recall Mealy and Moore implementations of 101 sequence detector output ² Moore Machine ± assign z = state [1] & state [0] ² Mealy Machine ± assign z = x & state [1] ² Both outputs are “wires” ± Output assigned to “continuously” ± Output changes when any input changes ² What if output assigned to procedurally?
Background image of page 4
5 November 21, 2006 ECE 152A - Digital Design Principles 9 Coke ® Machine ± Verilog code ² Procedural vs. Continuous Assignment Wire inputs Reg outputs Outputs assigned to procedurally (and synchronously) November 21, 2006 ECE 152A - Digital Design Principles 10 Coke ® Machine ± Timing diagram verifying correct operation of the controller ² The timing diagram verifies the following input sequences ± 2 dimes Coke ® and change ± 1 nickel, 1 dime Coke ® ± 3 nickels Coke ® ± 2 nickels, 1 dime Coke ® and change
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 November 21, 2006 ECE 152A - Digital Design Principles 11 Coke ® Machine ± Timing Diagram (Functional Simulation) ² Note “pseudo Mealy Machine” timing 2 Dimes State 0, Output = 11 State 0, Output = 10 Nickel, Dime 3 Nickels 2 Nickels, Dime State 0, Output = 11 November 21, 2006 ECE 152A - Digital Design Principles 12 CD Player Controller ± This example illustrates the design a controller for a portable CD player ² The CD player has only two control buttons ± Play and Stop ² When a CD is inserted, the controller automatically goes to a reset state and the laser is positioned at the beginning of the first track.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

L12 - Controller Design ECE 152A Fall 2006 Coke Machine...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online