高手清帮忙看下VHDL AD控制

来源:百度知道 编辑:UC知道 时间:2024/04/28 12:05:04
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity adcontroller is
port( clk , eoc : in std_logic;
cs , sc , oe : out std_logic );
end adcontroller;
architecture state_machine of adcontroller is
type state_type is (idle ,start ,convert ,read1 , read2);
signal present_state , next_state : state_type;
begin
state_comb : process(present_state , eoc)
begin
case present_state is
when idle=>
cs<='1'; sc<='1'; oe<='1';
when start=>
cs<='0'; sc<='0'; oe<='1';
if (eoc='0') then next_state<=convert;
else next_state<=start;
end if;
when convert=>
cs<='0

你的控制太混乱了,改了几个地方,对照着看看吧,呵呵,我也是新手,共同进步

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_arith.all;

use ieee.std_logic_unsigned.all;

entity adcontroller is

port( clk , eoc : in std_logic;

cs , sc , oe : out std_logic );

end adcontroller;

architecture state_machine of adcontroller is

type state_type is (idle ,start ,convert ,read1 , read2);

signal present_state , next_state : state_type;

begin

state_comb : process(present_state , eoc)

begin

case present_state is

when idle=>

cs<='1'; sc<='1'; oe<='1';next_state<=start;

when start=>

cs<='0'; sc<='0'; oe