3层电梯VHDL报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一.实验题目
简易二层电梯控制器
模拟真实电梯的运行情况,设计制作一个简易电梯控制器控制二层电梯的运行。
基本要求:
1、电梯设有一层、二层外部呼叫按钮和内部一层、二层指定按钮(BTN)。
2、利用数码管显示电梯所在楼层,用LED显示电梯运行状态如上行、下行、
开门、关门等。
提高要求:
1、点阵显示楼层;
2、用点阵显示楼层的上下滚动移出移入表示电梯的上行或下行运行方向
3、增加为三层电梯控制器
二.设计方案及思路
设计思路:根据题目要求,我在程序中设计了需要用到的8个外部按钮:
f1up,f2up ,f2dn,f3dn,warning,stop1,stop2,stop3,reset,另外还有相应的显示信号,程序利用状态机实现总体的控制,状态中用到了7个状态:
(stopon1,dooropen,doorclose,doorwait,up1,down1,stop),状态的主要转换如下:设定复位后初始状态是stopon1,然后状态跳转到doorclose,在接收到相应的请求信号时,做出判断,若请求信号的楼层大于当前所在的楼层,则程序跳转到up1状态,小于则跳转到down1状态,如果请求信号的楼层与当前楼层相同时,则开门进入dooropen 状态,然后到开门延迟状态doorwait,然后再到doorclose状态,上升和下降的过程中判断电梯是否到达指定的楼层,若到达,则程序进入stop状态,然后到开门->延时->关门,进而做判断。
状态转移图如
下:
各个状态线表示的内容如下: 1初始化
2 初始化后电梯进入工作状态,起始是关门状态
3 没有任何信号输入时,电梯始终工作在关门状态
4 电梯接收到信号,且请求信号大于当前楼层
5 电梯上升后到达指定楼层时停止
11
6
10
9
2
stopon1 dooropen
up1
stop
doorwait
1
doorclose
down1 3
4
5
8
7
6 电梯停止后便开门
7 延时等待乘客搭乘电梯或者走出电梯 8 等待时间结束后电梯关门
9 电梯接收到信号,且请求信号小于当前楼层 10 电梯下降到指定楼层后停止
11 电梯接受的信号与当前楼层相同则开门
控制原理图:
分块设计:程序中主要分了3个模块:分频模块,状态控制,状态显示,其中状态显示分成了信号灯显示部分和点阵显示部分,因为一开始对点阵的显示比较生疏,所以点阵显示模块是后来才在总的程序中加入的。
分频模块的作用是将板子提供的时钟信号分频作为电梯运行状态转换的时钟信号;状态控制模块是最核心的一部分,它要分析输入信号并作出相应的状态转换;状态显示的信号灯模块主要控制对于外部输入做出的反应,而点阵显示部分则主要是利用点阵来显示当前的楼层信号和运行的电梯上升或下降模式。
信号灯显示
外部输入信号
电梯运行控制
信号分析
三.时序仿真图
(1)如图
从图中可以看出,当复位键reset高电平时,所有信号都不显示,当reset低电平,有警报信号时,电梯门打开,并产生警报输出,当警报与复位信号都是低电平时,一楼有上升请求,显示上升信号,电梯开门后一楼外部请求上升信号熄灭,内部要求停在2楼和3楼,电梯显示内部请求信号,图中stoplight=”110”时,表示有2、3层内部停站请求,电梯经过4个电梯时钟信号到达2层,然后开门,2层上升请求信号清零,然后再关门,上升到3层,之后开门,关门,此时,没有然后任何外部信号,就停止在3层。
(2)
如图,电梯在3层,接收到2层外部下降请求信号,电梯显示该信号,并从3楼下降,同时接收到2层上升请求信号,电梯显示该信号,下降到2层时,电梯开门,然后从接受到的1楼停站请求信号,电梯继续下降并在一楼开门,然后电梯上升到2层开门,然后执行上升任务,到达3层开门。
四.源程序分析(见附件)
五.功能说明
如图,clk 接的是开发板的晶振输入信号,作为时
钟信号,reset是复位输入,高电平有效,复位后状态转
换为stopon1,f1up电梯外部1楼上升请求信号,f2up
电梯外部2楼请求上升信号,f2dn电梯外部2楼请
求下降信号,电梯外部3楼请求下降信号,stop1 内部一层停站请求端口,stop2内部二层停站请求端口,stop3 内部三层停站请求端口都是高电平有效,选择相应的端口时会有相应的LED灯点亮,warning:内部紧急状况请求,高电平有效,此时电梯门打开,蜂鸣器鸣叫报警,fuplight外部上升请求显示灯,fdnlight外部下降请求显示灯,stoplight内部请求显示灯,doorlight开关门信号灯,用来显示相应的请求信号,row点阵显示行,col点阵
显示列,用来显示楼层信息与上升下降信息的,warning_out紧急状况报警,接到蜂鸣器
六.元器件清单及资源利用
实验中用到的是MAXII EPM1270T144C5的板子,其中主要用到的是按键开关和点阵,另外还用到了2个拨码开关用来表示复位键和警报键,还用到了蜂鸣器用来显示警报信号。
引脚图如下:
附件:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity dianti is
port(
clk:in std_logic; --时钟信号
reset:in std_logic; --异步复位端口1-复位
f1up :in std_logic; --外部一层上升请求端口1-有请求0-无请求以下类似
f2up :in std_logic; --外部二层上升请求端口
f2dn :in std_logic; --外部二层下降请求端口
f3dn :in std_logic; --外部三层下降请求端口
stop1 :in std_logic; --内部一层停站请求端口
stop2 :in std_logic; --内部二层停站请求端口
stop3 :in std_logic; --内部三层停站请求端口
warning:in std_logic; --内部紧急状况请求端口
fuplight:buffer std_logic_vector(2 downto 1); --外部上升请求显示灯0- 灭灯1-亮灯以下类似
fdnlight:buffer std_logic_vector(3 downto 2); --外部下降请求显示灯
stoplight:buffer std_logic_vector(3 downto 1); --内部请求显示灯
doorlight:out std_logic; --开关门信号灯
layer:out std_logic_vector(1 downto 0); --当前楼层信息
--在开发板上应用的时候
--显示在点阵上,不需要此信号row:out std_logic_vector(7 downto 0); --点阵显示行
col:out std_logic_vector(7 downto 0); --点阵显示列
warning_out:out std_logic --紧急状况报警,接到蜂鸣器
);
end entity dianti;
architecture behave of dianti is --结构体
type state is --定义14个状态
(stopon1,dooropen,doorclose,doorwait,up1,down1,stop);
signal lift_state:state;
signal clearup:std_logic; --上升和停站请求清除信号
signal cleardn:std_logic; --下降和停站请求清除信号
signal up_down:std_logic;
signal run_model:std_logic_vector(2 downto 0); --电梯模式(上升或下降)信号
signal pos:integer range 1 to 3; --电梯位置信号
signal i:integer range 0 to 7;
signal num:integer range 0 to 99999;
signal liftclk:std_logic; --电梯时钟信号
begin
----------------------------------分频模块-----------------------------
--功能:对时钟信号分频,产生电梯运行的时钟信号
------------------------------------------------------------------------
fenpin:process(clk,reset)
variable count:integer range 0 to 1; --在开发板上应用的时候需要将分频倍数改
--大一些1变成24999;
begin
if reset='1' then
liftclk<='0';
else
if clk'event and clk='1' then
if count=1 then
count:=0;
liftclk<='1';
else
count:=count+1;
liftclk<='0';
end if;
end if;
end if;
end process fenpin;
---------------------状态转换-----------------------------------
--功能:电梯的主要控制模块
---------------------------------------------------------------
ctrlift:process(reset,liftclk,warning) --状态机进程
variable cnt:integer range 0 to 4;
begin
if reset='1' then --异步复位,电梯的初始状态为一层开门状态lift_state<=stopon1;
clearup<='0';
cleardn<='0';
else
if liftclk'event and liftclk='1' then
if warning='1' then
run_model<="000";
doorlight<='1'; --有警报时开门
else
doorlight<='0';
case lift_state is --状态转换
when stopon1=> --1楼停止,初始状态
doorlight<='0';
run_model<="000";
pos<=1;
up_down<='1';
lift_state<=doorclose;
when doorclose=> --关门状态
doorlight<='0';
run_model<="000"; --电梯处于关门停止模式
if up_down='1' then
if pos=3 then --电梯在3层
if fuplight="00" and fdnlight="00" and stoplight="000" then --没有任何请求信号,电梯停在当前层
up_down<='0';
lift_state<=doorclose;
elsif fdnlight(3)='1' or stoplight(3)='1' then --3层有请求信号时,电梯开门
up_down<='0';
lift_state<=dooropen;
else --否则其它层有信号时,下降
up_down<='0';
lift_state<=down1;
end if;
elsif pos=2 then --电梯在2层
if fuplight="00" and fdnlight="00" and stoplight="000" then --无信号,电梯停在当前层
up_down<='1';
lift_state<=doorclose;
elsif fuplight(2)='1' or stoplight(2)='1' then --2层有上升或停站请求时时,电梯开门
up_down<='1';
lift_state<=dooropen;
elsif fuplight="00" and stoplight="000" and fdnlight="01" then
--2层有下降请求时,电梯开门
up_down<='0';
lift_state<=dooropen;
elsif stoplight(3)='1' or fdnlight(3)='1' then --3层有停站请求或下降请求,则上升
up_down<='1';
lift_state<=up1;
else
up_down<='0'; --一层有请求信号时,下降
lift_state<=down1;
end if;
elsif pos=1 then --电梯在一层
if fuplight="00" and fdnlight="00" and stoplight="000" then --无信号,电梯停在当前层
up_down<='1';
lift_state<=doorclose;
elsif stoplight(1)='1' or fuplight(1)='1' then --一楼有停站请求或者上升请求时,开门
up_down<='1';
lift_state<=dooropen;
else --其他楼层有请求信号时,到上升状态
up_down<='1';
lift_state<=up1;
end if;
end if;
elsif up_down='0' then --电梯处在下降模式
if pos=3 then --电梯在3层
if fuplight="00" and fdnlight="00" and stoplight="000" then
up_down<='0';
lift_state<=doorclose; --无信号时关门
elsif fdnlight(3)='1' or stoplight(3)='1' then
up_down<='0';
lift_state<=dooropen; --3层有停站请求和下降信号时,开门else
up_down<='0';
lift_state<=down1; --其他情况,下降
end if;
elsif pos=2 then --电梯在2层if fuplight="00" and fdnlight="00" and stoplight="000" then
up_down<='0';
lift_state<=doorclose; --无信号,关门
elsif fdnlight(2)='1' or stoplight(2)='1' then
up_down<='0';
lift_state<=dooropen; --2层有停战和下降请求,开门elsif fdnlight="00" and stoplight="000" and fuplight="10" then up_down<='1';
lift_state<=dooropen; --只有2层上升请求时,开门elsif fuplight(1)='1' or stoplight(1)='1' then --一层有停
--站请求或上升请求,则下降
up_down<='0';
lift_state<=down1;
else
up_down<='1';
lift_state<=up1; --其他情况,上升end if;
elsif pos=1 then --电梯在一层
if fuplight="00" and fdnlight="00" and stoplight="000" then
up_down<='1';
lift_state<=doorclose;
elsif stoplight(1)='1' or fuplight(1)='1' then
up_down<='1';
lift_state<=dooropen;
else
up_down<='1';
lift_state<=up1;
end if;
end if;
end if;
when up1=>
if cnt =0 then
run_model<="001"; --加速上升模式
lift_state<=up1;
cnt:=cnt+1;
elsif cnt=1 or cnt=2 or cnt=3 then
run_model<="010"; --平稳上升模式
lift_state<=up1;
cnt:=cnt+1;
elsif cnt=4 then
run_model<="100"; --减速上升模式
cnt:=0;
pos<=pos+1; --电梯楼层数加一
if pos<3 and (stoplight(pos)='1' or fuplight(pos)='1') then
lift_state<=stop; --电梯在一层或二层,本层有
--停站或上升请求时,则停止elsif pos=3 and (stoplight(pos)='1' or fdnlight(pos)='1') then
lift_state<=stop; --电梯处在三层,并且有三
--层停站或下降请求,则停止
else
lift_state<=doorclose;
end if;
end if;
when down1=>
if cnt = 0 then
run_model<="110"; --加速下降模式
lift_state<=down1;
cnt:=cnt+1;
elsif cnt=1 or cnt=2 or cnt=3 then
run_model<="101"; --电梯处在平稳下降状态;
lift_state<=down1;
cnt:=cnt+1;
elsif cnt=4 then
run_model<="011"; --减速下降模式
cnt:=0;
pos<=pos-1; --电梯楼层数减一
if pos>1 and (stoplight(pos)='1' and fdnlight(pos)='1') then
lift_state<=stop;
elsif pos=1 and (stoplight(pos)='1' or fuplight(pos)='1') then
lift_state<=stop;
else
lift_state<=doorclose;
end if;
end if;
when stop=>
lift_state<=dooropen;
when dooropen=>
doorlight<='1';
run_model<="111"; --电梯处于开门停止模式
if up_down='1' then
if pos<3 and (fuplight(pos)='1' or stoplight(pos)='1') then
clearup<='1'; --电梯在3层以下时,清除当前层上升和停站请求
else
clearup<='1';
cleardn<='1';
end if;
elsif up_down='0' then
if pos>1 and (fdnlight(pos)='1' or stoplight(pos)='1') then
cleardn<='1'; --电梯在1层以上时清除当前层下降和停站请求
else
clearup<='1';
cleardn<='1';
end if;
end if;
lift_state<=doorwait;
when doorwait=>
if cnt=0 then
doorlight<='1';
run_model<="111";
cnt:=cnt+1;
lift_state<=doorwait;
elsif cnt=1 then
doorlight<='1';
clearup<='0';
cleardn<='0';
run_model<="111";
cnt:=cnt+1;
lift_state<=doorwait;
elsif cnt=2 then
doorlight<='1';
run_model<="111";
cnt:=cnt+1;
lift_state<=doorwait;
elsif cnt=3 or cnt=4 then
doorlight<='0';
run_model<="000";
cnt:=0;
lift_state<=doorclose;
end if;
end case;
end if;
end if;
end if;
if pos=1 then
layer<="01";
elsif pos=2 then
layer <="10";
elsif pos =3 then
layer<="11";
end if;
end process ctrlift;
light:process(reset, clk) --信号灯控制进程begin
if reset='1' then --复位,寄存信号清零fuplight<="00";
fdnlight<="00";
stoplight<="000";
else
if clk'event and clk='1' then
if warning='1' then
warning_out<='1';
else
warning_out<='0';
if clearup='1' then --上升和停站请求清零fuplight(pos)<='0';
stoplight(pos)<='0';
else
if f1up ='1' then --记忆各层上升请求
fuplight(1)<='1';
elsif f2up ='1' then
fuplight(2)<='1';
end if;
end if;
if cleardn='1' then --下降和停站请求清零
fdnlight(pos)<='0';
stoplight(pos)<='0';
else
if f2dn ='1' then --记忆各层下降请求
fdnlight(2)<='1';
elsif f3dn ='1' then
fdnlight(3)<='1';
end if;
end if;
if stop1 ='1' then --记忆各层停站请求stoplight(1)<='1';
elsif stop2 ='1' then
stoplight(2)<='1';
elsif stop3 ='1' then
stoplight(3)<='1';
end if;
end if;
end if;
end if;
end process light;
dianzhen:process(clk,reset,pos,run_model)
begin
if reset='1' then
col<="00000000"; row<="00000000";
else
if clk'event and clk='1' then
if i=7 then
i<=0;
else
i<=i+1;
end if;
if num=99999 then num<=0; else num<=num+1; end if;
if (pos=1 and (run_model="000" or run_model="111"or run_model="100" or run_model="011") )then--1
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00011000";row <= "10111111";
when 2 => col <= "00011000";row <= "11011111";
when 3 => col <= "00011000";row <= "11101111";
when 4 => col <= "00011000";row <= "11110111";
when 5 => col <= "00011000";row <= "11111011";
when 6 => col <= "00011000";row <= "11111101";
when 7 => col <= "00011000";row <= "11111110";
end case;
elsif (pos=2 and( run_model="000" or run_model="111" or run_model="100" or run_model="011" )) then--2
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00111100";row <= "10111111";
when 2 => col <= "00100000";row <= "11011111";
when 3 => col <= "00100000";row <= "11101111";
when 4 => col <= "00111100";row <= "11110111";
when 5 => col <= "00000100";row <= "11111011";
when 6 => col <= "00000100";row <= "11111101";
when 7 => col <= "00111100";row <= "11111110";
end case;
elsif (pos=3 and (run_model="000" or run_model="111" or run_model="100" or run_model="011")) then --3
case i is
when 0 =>col <= "00000000";row <= "01111111";
when 1 =>col <= "00111100";row <= "10111111";
when 2 => col <= "00100000";row <= "11011111";
when 3 => col <= "00100000";row <= "11101111";
when 4 => col <= "00111100";row <= "11110111";
when 5 => col <= "00100000";row <= "11111011";
when 6 => col <= "00100000";row <= "11111101";
when 7 => col <= "00111100";row <= "11111110";
end case;
elsif (pos=1 and (run_model="001" or run_model="010" ))then-- 1 up if num<25000 or num=25000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00011000";row <= "10111111";
when 2 => col <= "00011000";row <= "11011111";
when 3 => col <= "00011000";row <= "11101111";
when 4 => col <= "00011000";row <= "11110111";
when 5 => col <= "00011000";row <= "11111011";
when 6 => col <= "00011000";row <= "11111101";
when 7 => col <= "00011000";row <= "11111110";
end case;
elsif num>25000 and num<50000 then
case i is
when 0 => col <= "00011000";row <= "01111111";
when 1 => col <= "00011000";row <= "10111111";
when 2 => col <= "00011000";row <= "11011111";
when 3 => col <= "00011000";row <= "11101111";
when 4 => col <= "00011000";row <= "11110111";
when 5 => col <= "00011000";row <= "11111011";
when 6 => col <= "00000000";row <= "11111101";
when 7 => col <= "00000000";row <= "11111110";
end case;
elsif num>49999 and num<75000 then
case i is
when 0 => col <= "00011000";row <= "01111111";
when 1 => col <= "00011000";row <= "10111111";
when 2 => col <= "00011000";row <= "11011111";
when 3 => col <= "00000000";row <= "11101111";
when 4 => col <= "00000000";row <= "11110111";
when 5 => col <= "00000000";row <= "11111011";
when 6 => col <= "00000000";row <= "11111101";
when 7 => col <= "00000000";row <= "11111110";
end case;
elsif num>74999 and num<100000 then
case i is
when 0 => col <= "00011000";row <= "01111111";
when 1 => col <= "00011000";row <= "10111111";
when 2 => col <= "00000000";row <= "11011111";
when 3 => col <= "00000000";row <= "11101111";
when 4 => col <= "00000000";row <= "11110111";
when 5 => col <= "00000000";row <= "11111011";
when 6 => col <= "00000000";row <= "11111101";
when 7 => col <= "00000000";row <= "11111110";
end case;
end if;
elsif (pos=2 and (run_model="001" or run_model="010" )) then --2 up if num<25000 or num=25000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00111100";row <= "10111111";
when 2 => col <= "00100000";row <= "11011111";
when 3 => col <= "00100000";row <= "11101111";
when 4 => col <= "00111100";row <= "11110111";
when 5 => col <= "00000100";row <= "11111011";
when 6 => col <= "00000100";row <= "11111101";
when 7 => col <= "00111100";row <= "11111110";
end case;
elsif num>25000 and num<50000 then
case i is
when 0 => col <= "00100000";row <= "01111111";
when 1 => col <= "00100000";row <= "10111111";
when 2 => col <= "00111100";row <= "11011111";
when 3 => col <= "00000100";row <= "11101111";
when 4 => col <= "00000100";row <= "11110111";
when 5 => col <= "00111100";row <= "11111011";
when 6 => col <= "00000000";row <= "11111101";
when 7 => col <= "00000000";row <= "11111110";
end case;
elsif num>49999 and num<75000 then
case i is
when 0 => col <= "00111100";row <= "01111111";
when 1 => col <= "00000100";row <= "10111111";
when 2 => col <= "00000100";row <= "11011111";
when 3 => col <= "00111100";row <= "11101111";
when 4 => col <= "00000000";row <= "11110111";
when 5 => col <= "00000000";row <= "11111011";
when 6 => col <= "00000000";row <= "11111101";
when 7 => col <= "00000000";row <= "11111110";
end case;
elsif num>74999 and num<100000 then
case i is
when 0 => col <= "00000100";row <= "01111111";
when 1 => col <= "00111100";row <= "10111111";
when 2 => col <= "00000000";row <= "11011111";
when 3 => col <= "00000000";row <= "11101111";
when 4 => col <= "00000000";row <= "11110111";
when 5 => col <= "00000000";row <= "11111011";
when 6 => col <= "00000000";row <= "11111101";
when 7 => col <= "00000000";row <= "11111110";
end case;
end if;
elsif (pos=2 and ( run_model="101" or run_model="110" )) then --2 down if num<25000 or num=25000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00111100";row <= "10111111";
when 2 => col <= "00100000";row <= "11011111";
when 3 => col <= "00100000";row <= "11101111";
when 4 => col <= "00111100";row <= "11110111";
when 5 => col <= "00000100";row <= "11111011";
when 6 => col <= "00000100";row <= "11111101";
when 7 => col <= "00111100";row <= "11111110";
end case;
elsif num>25000 and num<50000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00000000";row <= "10111111";
when 2 => col <= "00000000";row <= "11011111";
when 3 => col <= "00111100";row <= "11101111";
when 4 => col <= "00100000";row <= "11110111";
when 5 => col <= "00100000";row <= "11111011";
when 6 => col <= "00111100";row <= "11111101";
when 7 => col <= "00000100";row <= "11111110";
end case;
elsif num>49999 and num<75000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00000000";row <= "10111111";
when 2 => col <= "00000000";row <= "11011111";
when 3 => col <= "00000000";row <= "11101111";
when 4 => col <= "00000000";row <= "11110111";
when 5 => col <= "00111100";row <= "11111011";
when 6 => col <= "00100000";row <= "11111101";
when 7 => col <= "00100000";row <= "11111110";
end case;
elsif num>74999 and num<100000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00000000";row <= "10111111";
when 2 => col <= "00000000";row <= "11011111";
when 3 => col <= "00000000";row <= "11101111";
when 4 => col <= "00000000";row <= "11110111";
when 5 => col <= "00000000";row <= "11111011";
when 6 => col <= "00111100";row <= "11111101";
when 7 => col <= "00100000";row <= "11111110";
end case;
end if;
elsif (pos=3 and (run_model="101" or run_model="110" ))then --3 down if num<25000 or num=25000 then
case i is
when 0 =>col <= "00000000";row <= "01111111";
when 1 =>col <= "00111100";row <= "10111111";
when 2 => col <= "00100000";row <= "11011111";
when 3 => col <= "00100000";row <= "11101111";
when 4 => col <= "00111100";row <= "11110111";
when 5 => col <= "00100000";row <= "11111011";
when 6 => col <= "00100000";row <= "11111101";
when 7 => col <= "00111100";row <= "11111110";
end case;
elsif num>25000 and num<50000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00000000";row <= "10111111";
when 2 => col <= "00000000";row <= "11011111";
when 3 => col <= "00111100";row <= "11101111";
when 4 => col <= "00100000";row <= "11110111";
when 5 => col <= "00100000";row <= "11111011";
when 6 => col <= "00111100";row <= "11111101";
when 7 => col <= "00100000";row <= "11111110";
end case;
elsif num>49999 and num<75000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00000000";row <= "10111111";
when 2 => col <= "00000000";row <= "11011111";
when 3 => col <= "00000000";row <= "11101111";
when 4 => col <= "00000000";row <= "11110111";
when 5 => col <= "00111100";row <= "11111011";
when 6 => col <= "00100000";row <= "11111101";
when 7 => col <= "00100000";row <= "11111110";
end case;
elsif num>74999 and num<100000 then
case i is
when 0 => col <= "00000000";row <= "01111111";
when 1 => col <= "00000000";row <= "10111111";
when 2 => col <= "00000000";row <= "11011111";
when 3 => col <= "00000000";row <= "11101111";
when 4 => col <= "00000000";row <= "11110111";
when 5 => col <= "00000000";row <= "11111011";
when 6 => col <= "00111100";row <= "11111101";
when 7 => col <= "00100000";row <= "11111110";
end case;
end if;
end if;
end if;
end if;
end process dianzhen;
end architecture behave;。