我在做基于
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";
- viewstep<=takenum;
- ELSIF clk'EVENT AND clk='1'THEN
- CASE viewstep IS
- when takenun=>
- ktemp<=keep;
- viewstep<=hundred;
- When hundred=>
- IF ktemp>="11001000"THEN --如果ktemp大于200
- view1<="0010";ktemp<=ktemp-"11001000" --百位为2,ktemp--200
- ElSIF ktemp>="01100100"THEN --如果ktemp大于100
- vew1<="0001"ktemp<=ktemp-"01100100"; --百位为1,ktemp--100
- else view1<="0000" --百位为0
- END iF;
- viewstep<=ten;
- when ten=> --产生十位数字
- if ktemp>="01011010"THEN
- view2<="1001";ktemp<=ktemp-"01011010";
- ELSIF ktemp>="01010000"THEN
- view2<="1000";ktemp<=ktemp-"01010000";
- elSiF ktemp>="01000110"THEN
- view2<="0111";ktemp<=ktemp-"01000110";
- ELSIF ktemp>="00111100"THEN
- view2<="0110";ktemp<=ktemp-"00111100";
- elSiF ktemp>="00110010"THEN
- view2<="010l";ktemp<=ktemp-"00110010";
- ELSIF ktemp>="00101000"THEN
- view2<="0100";ktemp<=ktemp-"00101000";
- ELSIF ktemp>="00011110"THEN
- view2<="0011";ktemp<=ktemp-"00011110";
- ElSIF ktemp>="00010100"THEN
- view2<="0010";ktemp<=ktemp-"00010100";
- ELSIF ktemp>="00001010"THEN
- view2<="0001";ktemp<=ktemp-"00001010";
- ELSE view2<="0000";
- END IF;
- viewstep<=one
- When one=> --产生个位数字
- view3<=ktemp(3 DOWNTO 0);
- viewstep<=takeup;
- WHEN OTHERS=>NULL;
- END CASE;
- END IF;
- END PROCESS ctrview;
复制代码
一周热门 更多>