我在做基于
FPGA的计算器设计时,用Quartus Ⅱ 13.1写的程序,但写完8位二进制转化个位,十位,百位的进程程序后,编译时,在ctrview:PROCESS(c,clk)
BEGIN这一行时一直出错,有没有大佬帮忙解一下。
- LIBRARY IEEE;
- USE IEEE.STD_LOGIC_1164.ALL;
- USE IEEE.STD_LOGIC_ARITH.ALL;
- USE IEEE.STD_LOGIC_UNSIGNED.ALL;
- ENtiTY vdecode IS --7段译码译码器做显示
- PORT(indata:IN STD_LOGIC_VECTOR(3 DOWNTO 0);
- outdata:OUT STD_LOGIC_VECTOR(0 TO 6));
- END ENTITY vdecode;
- ARCHITECTURE behave OF vdecode IS
- BEGIN
- WITH indata SELECT
- outdata<="1111110"WHEN"0000", -- 显示0
- "0110000"WHEN"0001", -- 显示1
- "l101101"WHEN"0010", -- 显示2
- "1111001"WHEN"0011",
- "0110011"wHEN"0100",
- "1011011"WHEN"0101",
- "1011111"WHEN"0110",
- "1110000"WHEN"0111",
- "1111111"WHEN"1000",
- "1101111"WHEN"1001", -- 显示9
- "0000000"WHEN OTHERS;
- END ARCHITECTURE behave;
- ctrview:PROCESS(c,clk)--二进制转换成千位,百位,十位,个位以送至译码器
- BEGIN
- IF c='1'THEN
- view1<="0000";view2<="0000";view3<="0000";view4<="0000";
- viewstep<=takenum;
- ELSIF clk'EVENT AND clk='1'THEN
- CASE viewstep IS
- WHEN takenum=>
- ktemp<=keep;
- WHEN thousand=> --产生千位数字
- IF ktemp>="0010001100101000"THEN
- view1<="1001";ktemp<=ktemp-"0010001100101000";
- ELSIF ktemp>="0001111101000000"THEN
- view1<="1000";ktemp<=ktemp-"0001111101000000";
- ELSIF ktemp>="0001101101011000"THEN
- view1<="0111";ktemp<=ktemp-"0001101101011000";
- ELSIF ktemp>="000101110111000"THEN
- view1<="0110";ktemp<=ktemp-"0001011101110000";
- ELSIF ktemp>="0001001110001000"THEN
- view1<="0101";ktemp<=ktemp-"0001001110001000";
- ELSIF ktemp>="0000111110100000"THEN
- view1<="0100";ktemp<=ktemp-"0000111110100000";
- ELSIF ktemp>="0000101110111000"THEN
- view1<="0011";ktemp<=ktemp-"0000101110111000";
- ELSIF ktemp>="0000011111010000"THEN
- view1<="0010";ktemp<=ktemp-"0000011111010000";
- ELSIF ktemp>="0000001111101000"THEN
- view1<="0001";ktemp<=ktemp-"0000001111101000";
- ELSE view1<="0000";
- END IF;
- viewstep<=hundred; --产生百位数字
- WHEN hundred=>
- IF ktemp>="0000001110000100"THEN
- view2<="1001";ktemp<=ktemp-"0000001110000100";
- ELSIF ktemp>="0000001100100000"THEN
- view2<="1000";ktemp<=ktemp-"0000001100100000";
- ELSIF ktemp>="0000001010111100"THEN
- view2<="0111";ktemp<=ktemp-"0000001010111100";
- ELSIF ktemp>="0000001001011000"THEN
- view2<="0110";ktemp<=ktemp-"0000001001011000";
- ELSIF ktemp>="0000000111110100"THEN
- view2<="0101";ktemp<=ktemp-"0000000111110100";
- ELSIF ktemp>="0000000110010000"THEN
- view2<="0100";ktemp<=ktemp-"0000000110010000";
- ELSIF ktemp>="0000000000011110"THEN
- view2<="0011";ktemp<=ktemp-"0000000000011110";
- IF ktemp>="11001000"THEN
- view2<="0010";ktemp<=ktemp-"0000000011001000";
- ELSIF ktemp>="0000000001100100"THEN
- view2<="0001";ktemp<=ktemp-"0000000001100100"; --百位为1,ktemp-100
- ELSE vIew2<="0000"; --百位为0
- END IF;
- viewstep<=ten;
- WHEN ten=> --产生十位数字
- IF ktemp>="0000000001011010"THEN
- view1<="1001";ktemp<=ktemp-"0000000001011010";
- ELSIF ktemp>="0000000001010000"THEN
- view1<="1000";ktemp<=ktemp."0000000001010000";
- ELSIF ktemp>="0000000001000110"THEN
- view1<="0111";ktemp<=ktemp-"0000000001000110";
- ELSIF ktemp>="0000000000111100"THEN
- view1<="0110";ktemp<=ktemp-"0000000000111100";
- ELSIF ktemp>="0000000000110010"THEN
- view1<="010l";ktemp<=ktemp-"00000000000110010";
- ELSIF ktemp>="0000000000101000"THEN
- view1<="0100";ktemp<=ktemp-"0000000000101000";
- ELSIF ktemp>="0000000000011110"THEN
- view1<="0011";ktemp<=ktemp-"0000000000011110";
- ELSIF ktemp>="0000000000010100"THEN
- view1<="0010";ktemp<=ktemp-"0000000000010100";
- ELSIF ktemp>="0000101000000000"THEN
- view1<="0001";ktemp<=ktemp-"0000101000000000";
- ELSE view1<="0000";
- END IF;
- viewsteps<=one;
- WHEN one=> --产生个位数字
- view4<=ktemp(3 DOWNTO 0);
- viewstep<=takenum;
- WHEN OTHERS=>NULL;
- END CASE;
- END IF;
- END PROCESS ctrview;
复制代码
一周热门 更多>