LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY ADCINT IS
PORT(D :IN STD_LOGIC_VECTOR(7 DOWNTO 0);
CLK : IN STD_LOGIC;
EOC : IN STD_LOGIC;
ALE : OUT STD_LOGIC;
START : OUT STD_LOGIC;
OE : OUT STD_LOGIC;
ADDA : OUT STD_LOGIC;
LOCK0 : OUT STD_LOGIC;
Q : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
END ADCINT;
ARCHITECTURE BEHAV OF ADCINT IS
TYPE STATES IS (STO,ST1,ST2,ST3,ST4,);
SIGNAL current_state,next_state:states :=st0;
SIGNAL REGL :STD_LOGIC_VECTOR(7 DOWNTO 0);
SIGNAL LOCK :STD_LOGIC;
BEGIN
ADDA<='1';
Q<=REGL; LOCK0<=LOCK;
COM: PROCESS(CURRENT_STATE,EOC) BEGIN
CASE CURRENT_STATE IS
WHEN ST0=>ALE<='0';START<='0';LOCK<='0';OE<='0'; NEXT_ATATE <=ST1;
WHEN ST1=>ALE<='1';START<='1';LOCK<='0';OE<='0'; NEXT_ATATE <=ST2;
WHEN ST2=>ALE<='0';START<='0';LOCK<='0';OE<='0';
IF (EOC='1') THEN NEXT_STATE<=ST3;
ELSE NEXT_STATE<=ST2;END IF;
WHEN ST3=>ALE<='0';START<='0';LOCK<='0';OE<='1';NEXT_STATE<=ST4;
WHEN ST4=>ALE<='0';START<='0';LOCK<='0';OE<='1';NEXT_STATE<=ST0;
WHEN OTHERS=>NEXT_STATE<=ST0;
END CASE;
END PROCESS COM;
REG PRECESS (CLK)
BEGIN
IF (CLK'ENENT AND CLK='1') THEN CURRENT_STATE<NEXT_STATE;ENDIF;
END PROCESS REG;
LATCH1:PROCESS (LOCK)
BEGIN
IF LOCK='1' AND LOCK'EVENT THEN REGL<=D;END IF;
END PROCESS LATCH1;
END BEHAV;
Error (10500): VHDL syntax error at mylunwen.vhd(13) near text "END"; expecting an identifier ("end" is a reserved keyword), or "constant", or "file", or "signal", or "variable"
Error (10500): VHDL syntax error at mylunwen.vhd(15) near text ")"; expecting an identifier
Error (10500): VHDL syntax error at mylunwen.vhd(19) near text "BEGIN"; expecting an identifier ("begin" is a reserved keyword), or "constant", or "file", or "signal", or "variable"
翻翻过去那场雪
叮当猫咪
慕运维8079593