module vend(onei,halfi,collectLED,half_out,dispense,reset,clk);
parameter idle=0,half=1,one=2,oneAhalf=3,two=4,twoAhalf=5,three=6;
(*chip_pin="M21"*)input onei;
(*chip_pin="N21"*)input halfi;
(*chip_pin="AB28"*)input reset;
(*chip_pin="AC28"*)input variety;
(*chip_pin="Y2"*)input clk;
(*chip_pin="AA17,AB16,AA16,AB17,AB15,AA15,AC17,AD18,AC18,AB18,AH19,AG19,AF18,AH18"*)output reg[13:0] collectLED;
(*chip_pin="G15"*)output half_out;
(*chip_pin="H15"*)output dispense;
reg collect,half_out,dispense;
reg[2:0] D;
reg[2:0] N;
always@(posedge clk) begin
if(!reset)
D<=idle;
else
D<=N;
end
always@(*) begin
//begin dispense=0;collect=0;half_out=0;D=idle;end
case(variety)
0:case(D)
idle:if(halfi=&
EDA课程设计
于 2022-05-20 17:30:03 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)