Page 192 - 3-2
P. 192
ns = ones;
end
else begin
yellow=1;
green = 0;
fnd_data = 8'b11110111;
mo = 2'b11;
ns = MM2F_1F;
end
end
endcase
always @(posedge clk)
begin
if(door_flag==1) // 층에 멈출 때
begin
if(cnt >= 450000000) cnt <= 450000000;
else if((cnt >= 0) && (cnt < 450000000)) cnt <= cnt+1;
else cnt <= cnt;
end
else begin cnt<=0; end
if((cnt>10) && (cnt < 270000000) == 1) mo2 <= 2'b10; // 열림
else if ((cnt > 270000000) && (cnt < 440000000) == 1) mo2 <= 2'b11; // 닫힘
else mo2 = 2'b00;
if(((cs == ones) &&
((~oneu_idle & oneu_cnt_max & oneu_state)) &&
(cnt==450000000))|| //1 층에서 외부 1 층을 누르면 문이 열림
((cs == twos) &&
((~twod_idle & twod_cnt_max & twod_state)) &&
(cnt==450000000))||
((cs==twos) &&
((~twou_idle & twou_cnt_max & twou_state)) &&
(cnt==450000000))||
((cs==threes) &&
((~threed_idle & threed_cnt_max & threed_state)) &&
(cnt==450000000)))
cnt <= 0;
end
endmodule
- 192 -