Implementação em VHDL do protocolo de comunicações GPIB

Page 1

--Sistemas de Aquisição de Dados, TPC nº10<CR> --Implementação em VHDL do protocolo de comunicações GPIB<CR> --11/06/2007<CR> <CR> --André Bastos da Cunha<CR> --nº53757<CR> --LEFT<CR> library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity GPIB_VHDL is Port ( ATN : out STD_LOGIC; DIO : out STD_LOGIC_VECTOR (7 downto 0); out_DAV : out STD_LOGIC; out_NRFD : out STD_LOGIC; out_NDAC : out STD_LOGIC; in_DAV : in STD_LOGIC; in_NRFD : in STD_LOGIC; in_NDAC : in STD_LOGIC; in_DIO : in STD_LOGIC_VECTOR (7 downto 0)); end GPIB_VHDL; architecture Behavioral of GPIB_VHDL is type STATE_TYPE is (S0, S1, S2, S3, S4, S5); attribute ENUM_ENCODING: STRING; attribute ENUM_ENCODING of STATE_TYPE:type is "000 001 010 011 100 101"; signal state, nextstate: STATE_TYPE; --nota: a sequência de estados é definida no test bench "teste.tbw" através dos --sinais de controlo in_DAV, in_NRFD, in_NDAC e in_DIO. begin process (in_DAV, in_NRFD, in_NDAC, in_DIO, state) begin state <= nextstate; case state is --no primeiro estado, inicializam-ze as linhas de handshake --o dispositivo decide se é TALKER ou LISTENER when S0 => out_DAV <= '1'; out_NRFD <= '0';

e


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.