华东交通大学
elsif newcustom_hh<\ then newcustom_hh<=newcustom_hh+1; newcustom_hl<=\
elsif (newcustom_ll<=\ newcustom_hl<=\ waitcustom_ll<=waitcustom_ll+1; If waitcustom_ll<\ then
waitcustom_ll<=waitcustom_ll+1;newcustom_ll<=\ newcustom_lh<=\ newcustom_hh<=\
elsif waitcustom_lh<\ then
waitcustom_lh<=waitcustom_lh+1; waitcustom_ll<=\ elsif waitcustom_hl<\ then
waitcustom_hl<=waitcustom_hl+1; waitcustom_lh<=\ elsif waitcustom_hh<\ then
waitcustom_hh<=waitcustom_hh+1; waitcustom_hl<=\
elsif(waitcustom_ll<=\ waitcustom_hl<=\ newcustom_ll<=\
第 14 页 共 22 页
华东交通大学
newcustom_hl<=\ waitcustom_ll<=\ waitcustom_hl<=\ end if; end if; end if; end process p1;
p2:process(rst,clk,waiter) begin
if rst='0' then curcustom_ll<=\ curcustom_hl<=\ Elsif clk'event and clk='1' then if waiter<='0' then
curcustom_ll<=\ curcustom_hl<=\ elsif waiter<='1' then ——柜台可以为客人服务; if curcustom_ll<\ then
curcustom_ll<=curcustom_ll+1; elsif curcustom_lh<\
curcustom_lh<=curcustom_lh+1; curcustom_ll<=\ elsif curcustom_hl<\
第 15 页 共 22 页
华东交通大学
curcustom_hl<=curcustom_hl+1; curcustom_lh<=\
elsif curcustom_hh<\——顾客的编号都小 于9999,开始加1; curcustom_hh<=curcustom_hh+1; curcustom_hl<=\
Elsif (curcustom_ll<=\ andcurcustom_hl<=\ curcustom_ll<=\ curcustom_hl<=\ end if;——当前顾客的编号都大于9999;全都至为0000; end if; end if; end process p2; p3:process(rst,tmpclk) begin
if rst='0' then cnt4<=0; ——当复位rst=0时,cnt4=0; elsif tmpclk'event and tmpclk='1' then ——时钟上升沿; if cnt4<8 then
cnt4<=cnt4+1; ——cnt4<8,cnt4的值为cnt4加1,一直加到7; Else cnt4<=0; end if; end if;
第 16 页 共 22 页
华东交通大学
end process p3; free_counter:block
signal q:std_logic_vector(24 downto 0); begin
p4:process(clk,rst) begin
if rst='0' then q<=(OTHERS=>'0'); elsif clk'event and clk='1' then q<=q+1; end if; end process p4; selout<=sel;
sel<=\ ——倒数第一个数码管cnt4=0; \ ——倒数第二个数码管cnt4=1; \ ——倒数第三个数码管cnt4=2; \ ——倒数第四个数码管cnt4=3; \ ——第四个数码管cnt4=4; \ ——第三个数码管cnt4=5; \ ——第二个数码管cnt4=6 \ ——第一个数码管cnt4=7; \end block free_counter; P5:process(rst,clk)
第 17 页 共 22 页
华东交通大学
begin
If rst='0' then cnt10<=\ elsif clk'event and clk='1' then if cnt10<3 then cnt10<=cnt10+1; Else cnt10<=\ end if; end if; end process p5;
tmpclk<=cnt10(1); ——tmpclk是clk的二分频; P6:process(rst,clk,waiter) begin
if rst='0' then ——复位为零,其他均设为零 ; length_ll<=\ length_hl<=\ Elsif clk'event and clk='1' then ——上升沿到时,队长开始计算; if waiter<='0' then length_ll<=\ length_hl<=\ elsif waiter<='1' then ——柜台已经服务完上一任顾客,有空位时,四
位分别相减;
length_ll<=newcustom_ll-curcustom_ll; length_lh<=newcustom_lh-curcustom_lh; length_hl<=newcustom_hl-curcustom_hl; length_hh<=newcustom_hh-curcustom_hh;
第 18 页 共 22 页
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新幼儿教育排队电路的EDA课程设计报告 (4)全文阅读和word下载服务。
相关推荐: