Demo entry 4073013

sfg

   

Submitted by anonymous on Mar 16, 2016 at 16:54
Language: vhdl. Code size: 2.1 kB.

-- VHDL do Sensor De Distância

library IEEE;
use IEEE.Std_logic_1164.all;
use IEEE.Std_logic_arith.all;
use ieee.std_logic_unsigned.all;

ENTITY SD_sensor_de_distancia IS 
PORT (
	CLK				: IN  STD_LOGIC;
	CLK2			: IN  STD_LOGIC;
	MEDIR 			: IN  STD_LOGIC;
	ECHO			: IN  STD_LOGIC;
	RESET			: IN  STD_LOGIC;
	MEDIDA 			: OUT STD_LOGIC_VECTOR(15 downto 0);
	PRONTO			: OUT STD_LOGIC;
	TRIGGER 		: OUT STD_LOGIC;
	UC_DEBUG_ESTADO	: OUT STD_LOGIC_VECTOR(2 downto 0);
	A7SEG3			: OUT  STD_LOGIC_VECTOR(6 downto 0);
	A7SEG2			: OUT  STD_LOGIC_VECTOR(6 downto 0);
	A7SEG1			: OUT  STD_LOGIC_VECTOR(6 downto 0);
	A7SEG0			: OUT  STD_LOGIC_VECTOR(6 downto 0);
	CLK2_OUT		: OUT  STD_LOGIC		
);
END ENTITY;

ARCHITECTURE arch_SD_sensor_de_distancia OF SD_sensor_de_distancia IS
 COMPONENT UC_sensor_de_distancia
   PORT(
      CLK			: IN   STD_LOGIC;
      MEDIR			: IN   STD_LOGIC;
      ECHO			: IN   STD_LOGIC;
      RESET			: IN   STD_LOGIC;
      TRIGGER		: OUT  STD_LOGIC;
      PRONTO		: OUT  STD_LOGIC;
      DEBUG_ESTADO	: OUT  STD_LOGIC_VECTOR(2 downto 0)
      );
END COMPONENT;

COMPONENT FD_sensor_de_distancia
   PORT(
      CLK			: IN   STD_LOGIC;
      ECHO			: IN   STD_LOGIC;
      RESET			: IN   STD_LOGIC;
	  MEDIDA		: OUT  STD_LOGIC_VECTOR(15 downto 0);
	  A7SEG3			: OUT  STD_LOGIC_VECTOR(6 downto 0);
	  A7SEG2			: OUT  STD_LOGIC_VECTOR(6 downto 0);
	  A7SEG1			: OUT  STD_LOGIC_VECTOR(6 downto 0);
	  A7SEG0			: OUT  STD_LOGIC_VECTOR(6 downto 0)	  
      );
END COMPONENT;

BEGIN
	CLK2_OUT <= CLK;
FLUXO_DE_DADOS: FD_sensor_de_distancia PORT MAP (
													CLK,
													ECHO,
													RESET,
													MEDIDA,
													A7SEG3,
													A7SEG2,
													A7SEG1,
													A7SEG0
													);
													
UNIDADE_DE_CONTROLE : UC_sensor_de_distancia PORT MAP (
													  CLK,
													  MEDIR,
													  ECHO,
													  RESET,
													  TRIGGER,
													  PRONTO,
													  UC_DEBUG_ESTADO
													  );
 -- TODO PORT MAPPING
END ARCHITECTURE;

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).