|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Aug 2008
Messaggi: 35
|
Decoder VHDL - ISE 10.1
Salve ragazzi, scusate il disturbo, per il giorno di natale poi... premetto che è da poco che programmo in VHDL, e non mi funziona un cavolo.
Per esempio volevo realizzare un circuito combinatorio per un decoder. Il codice è il seguente: Codice:
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; ---- Uncomment the following library declaration if instantiating ---- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity decoder is --un banale decoder...dovrebbe essere banale... Port ( input : in STD_LOGIC_VECTOR (2 downto 0); output : out STD_LOGIC_VECTOR (7 downto 0)); end decoder; architecture Behavioral of decoder is signal local_output : std_logic_vector (7 downto 0); begin process is begin case_selezione: case input is when '000' => local_output := '10000000'; when '001' => local_output := '01000000'; when '010' => local_output := '00100000'; when '011' => local_output := '00010000'; when '100' => local_output := '00001000'; when '101' => local_output := '00000100'; when '110' => local_output := '00000010'; when '111' => local_output := '00000001'; end case case_selezione; end process; output <= local_output; end Behavioral; ERROR:HDLParsers:164 - "C:/Xilinx101/Progetti/BasiVHDL/Decoder_1/decoder.vhd" Line 43. parse error, unexpected TICK WARNING:HDLParsers:1406 - "C:/Xilinx101/Progetti/BasiVHDL/Decoder_1/decoder.vhd" Line 39. No sensitivity list and no wait in the process che mi vengono dati quando faccio il controllo della sintassi con l'ise. Perchè non funziona? Ho programmato in C, C++, Java e VB. Che chiaramente non sono linguaggi per l'HW. Quindi mi trovo un pò spaesato nel comprendere "al volo" i motivi degli errori. Se mi elencate i motivi del non funzionamento in modo "pignolo" (da rompipalle per farla breve) ve ne sarei molto grato. Buon Natale =) |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Apr 2010
Città: Leuven
Messaggi: 667
|
Togli la dichiarazione del process !
Il circuito è combinatorio, non ti serve a nulla dichiarare un process. Se lo lasci devi aggiungere la sensitivity list, altrimenti l'output non cambierà mai. |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 13:42.