1 / 27

VHDL

VHDL. Exemplo de construção IF ELSE. -- Exemplo do uso de if else -- Esta descrição sintetiza uma porta nxor -- Isto é um comentário em VHDL ENTITY exemplo_if IS PORT ( a, b : IN BIT; c : OUT BIT ); END exemplo_if; ARCHITECTURE comportamental OF exemplo_if IS BEGIN

adair
Download Presentation

VHDL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. VHDL

  2. Exemplo de construção IF ELSE -- Exemplo do uso de if else -- Esta descrição sintetiza uma porta nxor -- Isto é um comentário em VHDL ENTITY exemplo_if IS PORT ( a, b : IN BIT; c : OUT BIT ); END exemplo_if; ARCHITECTURE comportamental OF exemplo_if IS BEGIN PROCESS (a, b) -- processo envolve a construção IF ELSE BEGIN IF (a = b) THEN c <= '1'; -- bit (entre aspas simples) ELSE c <= '0'; -- bit (entre aspas simples) END IF; END PROCESS; END comportamental;

  3. -- Uso do tipo STD_LOGIC -- Esta descrição sintetiza um buffer tri_state library IEEE; -- biblioteca IEEE use ieee.std_logic_1164.all; -- pacote define tipo STD_LOGIC ENTITY buffer_tri_state IS PORT ( a, habilita : IN STD_LOGIC; b : OUT STD_LOGIC); END buffer_tri_state; ARCHITECTURE comportamental OF buffer_tri_state IS BEGIN PROCESS (a ) -- processo envolve a construção IF ELSE BEGIN IF (habilita = '1') THEN b <= a; ELSE b <= 'Z'; -- símbolo de alta impedância (entre aspas simples) END IF; END PROCESS; END comportamental;

  4. Simulação do Buffer tri-state

More Related