Forum Discussion
Altera_Forum
Honored Contributor
17 years agolpm_decode output
I am trying to use the lpm_decode ip core to generate a 7 input to 128 output decoder but it keeps generating 128 individual outputs eq0 - eq128. How do I get it to generate a single 128 bit wide eq signal as indicated by the documentation. Any assitance would be greatly appreciated.
Thanks, Steve1 Reply
- Altera_Forum
Honored Contributor
The lpm_decode MegaFunction has a std_logic_vector output, but the MegaWizard is generating individual outputs in the instantiation. If you you want std_logic_vector, you should instantiate the MegaFunction directly in your code.
LIBRARY lpm; USE lpm.all; -- .... COMPONENT lpm_decode GENERIC ( lpm_decodes : NATURAL; lpm_type : STRING; lpm_width : NATURAL ); PORT ( eq : OUT STD_LOGIC_VECTOR (lpm_decodes-1 DOWNTO 0); data : IN STD_LOGIC_VECTOR (3 DOWNTO 0) ); END COMPONENT; -- .. lpm_decode_component : lpm_decode GENERIC MAP ( lpm_decodes => 128, lpm_type => "LPM_DECODE", lpm_width => 7 ) PORT MAP ( data => your_inputdata, eq => your_decodeddata );