![]() |
|
|
|
#1 |
|
Code:
the code doesnt work , anyone know why ?!! HaYZaM |
|
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Oct 2007
Posts: 5
|
Hi
check this modified code...its syntactically correct...please check functionality. library ieee; use ieee.std_logic_1164.all; ENTITY Decoder3_8_Enable IS port (a: in std_logic_vector(2 downto 0); e: in std_logic ; y: out std_logic_vector(7 downto 0) ); END Decoder3_8_Enable; -- ARCHITECTURE RTL OF Decoder3_8_Enable IS BEGIN process (e , a) begin if e = '1' then if a = "000" then y <="00000001"; elsif a = "001" then y <="00000010"; elsif a = "010" then y <="00000100"; elsif a = "011" then y <="00001000"; elsif a = "100" then y <="00010000"; elsif a = "101" then y <="00100000"; elsif a = "110" then y <="01000000"; elsif a = "111" then y <="10000000"; else null; end if; end if; end process; END ARCHITECTURE RTL; manasiw2 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2007
Posts: 2
|
library ieee;
use ieee.std_logic_1164.all; use ieee.numeric_std_all entity dec is port( a:in std_ulogic_vector(2 downto 0); z : out std_ulogic_vector(7 downto 0); e : in std_ulogic); --enable end entity ; architecture shiftdec of dec is constant z_out:bit_vector(7 downto 0):=(0=>'1',others=>'0'); --"00000001"; begin z<=to_stdulogicvector(z_out sll to_integer(unsigned(a))) when e='1' else 'Z'; end architecture; ----------------------- also u can use conv_std_logic_vector (parameter,bit_number) conv_integer(parameter) use ieee.std_logic_1164.all or use ieee.std_logic_signed.all forums4f |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PIX 501 [ERR]vpdn enable outside | waqas001 | General Help Related Topics | 0 | 04-22-2008 12:08 PM |
| AAA authentication problem for enable mode access | leopard | Hardware | 1 | 07-02-2007 08:08 AM |
| save cost advice: decoder chip for large printer | lois8386 | General Help Related Topics | 0 | 11-03-2006 06:19 AM |
| Spoke to Spoke Enhanced Config (ASA-PIX) NEED HELP ASAP!! | T-Mak | Hardware | 1 | 10-27-2006 11:56 AM |
| How to enable communication between VLANS on a singlel switch | makhan | Hardware | 1 | 10-26-2006 08:39 AM |