L12 - Controller Design

L12 - Controller Design - Controller Design ECE 152A Summer...

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 – Summer 2009 August 17, 2009 ECE 152A - Digital Design Principles 2 Coke ® Machine s This example illustrates the design a controller for a Coke ® machine b 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 August 17, 2009 ECE 152A - Digital Design Principles 3 Coke ® Machine s There are three inputs to the controller b clk b dime s when = 1, indicates that a dime has been inserted b nickel s when = 1, indicates that a nickel has been inserted b Assume that dime and nickel will never be 1 at the same time August 17, 2009 ECE 152A - Digital Design Principles 4 Coke ® Machine s The controller has 2 outputs b dispense s which when = 1, dispenses the Coke ® b change s which when = 1, returns a nickel in change s Design the controller as a Mealy machine b Implement the design in Verilog
Background image of page 2
3 August 17, 2009 ECE 152A - Digital Design Principles 5 Coke ® Machine s State diagram b Input = Dime Nickel b Output = Coke ® Change b Dime = Nickel = 1 → invalid input s Three Nickels s Dime Dime s Nickel Dime 0 10¢ 00/00 01/00 00/00 10/10 01/00 00/00 10/00 10/11 01/10 August 17, 2009 ECE 152A - Digital Design Principles 6 PLD Implementation s 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 August 17, 2009 ECE 152A - Digital Design Principles 7 PLD Implementation s Registers and Wires Wire (bypasses flip flop) Reg (data loaded on clock) Tri-state control Reg/Wire select August 17, 2009 ECE 152A - Digital Design Principles 8 Continuous Assignment of Output s Recall Mealy and Moore implementations of 101 sequence detector output b Moore Machine s b Mealy Machine s b Both outputs are “wires” s Output assigned to “continuously” s Output changes when any input changes b What if output assigned to procedurally?
Background image of page 4
5 August 17, 2009 ECE 152A - Digital Design Principles 9 Coke ® Machine s Verilog code b Procedural vs. Continuous Assignment Wire inputs Reg outputs Outputs assigned to procedurally (and synchronously) August 17, 2009 ECE 152A - Digital Design Principles 10 Coke ® Machine s Timing diagram verifying correct operation of the controller b The timing diagram verifies the following input sequences s 2 dimes → Coke ® and change s 1 nickel, 1 dime → Coke ® s 3 nickels → Coke ® s 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
August 17, 2009 ECE 152A - Digital Design Principles 11 Coke ® Machine s Timing Diagram (Functional Simulation) b 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 August 17, 2009 ECE 152A - Digital Design Principles 12 CD Player Controller s This example illustrates the design a controller for a portable CD player b The CD player has only two control buttons s Play and Stop b When a CD is inserted, the controller automatically goes to a reset state and the laser is
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.

This note was uploaded on 12/18/2009 for the course ECE 152a taught by Professor Johnson during the Spring '07 term at UCSB.

Page1 / 22

L12 - Controller Design - Controller Design ECE 152A Summer...

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