devilish
Newbie level 3
Welcome everyone!
I'm beginner in VHDL-coding and I've lack of experience with CPDL-designing. I've project to do... It should work as simple LED-display-tester on the Xilinx XC9500 Device. I've only ISE Webpack to compile and simulate the code in home. But I don't know if it have chance to run into device. Could some one verify the code?
In simulation each particular block seems to be ok. But I'm not sure about block with components and port maps.
PS.
I'm sorry for my bad english!
I'm beginner in VHDL-coding and I've lack of experience with CPDL-designing. I've project to do... It should work as simple LED-display-tester on the Xilinx XC9500 Device. I've only ISE Webpack to compile and simulate the code in home. But I don't know if it have chance to run into device. Could some one verify the code?
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity licznik is
port ( R : in STD_LOGIC;
CLK : in STD_LOGIC;
Z : inout STD_LOGIC_VECTOR (4 downto 0));
end licznik;
architecture a1 of licznik is
begin
process(CLK)
begin
if R='1' then Z<="00000";
elsif rising_edge(CLK) then Z<=Z+1;
end if;
end process;
end a1;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity LED7 is
port ( Z : in STD_LOGIC_VECTOR (4 downto 0);
Q : out STD_LOGIC_VECTOR (15 downto 0));
end LED7;
architecture a2 of LED7 is
begin
Q<="1111111111111111" when Z="00000" else
"1111111111111110" when Z="00001" else
"1111111111111100" when Z="00010" else
"1111111111111000" when Z="00011" else
"1111111111110000" when Z="00100" else
"1111111111100000" when Z="00101" else
"1111111111000000" when Z="00110" else
"1111111110000000" when Z="00111" else
"1111111100000000" when Z="01000" else
"1111111000000000" when Z="01001" else
"1111110000000000" when Z="01010" else
"1111100000000000" when Z="01011" else
"1111000000000000" when Z="01100" else
"1110000000000000" when Z="01101" else
"1100000000000000" when Z="01110" else
"1000000000000000" when Z="01111" else
"0000000000000000";
end a2;
library IEEE;
use IEEE.std_logic_1164.all;
entity tester is
port ( RESET : in STD_LOGIC;
CLOCK : in STD_LOGIC;
WYJSCIE : out STD_LOGIC_VECTOR (15 downto 0));
end tester;
architecture a1 of tester is
component licznik
port ( R : in STD_LOGIC;
CLK : in STD_LOGIC;
Z : inout STD_LOGIC_VECTOR (4 downto 0));
end component;
component LED7
port ( Z : in STD_LOGIC_VECTOR (4 downto 0);
Q : out STD_LOGIC_VECTOR (15 downto 0));
end component;
signal ZWEW : STD_LOGIC_VECTOR (4 downto 0);
begin
U1 : licznik port map(CLK=>CLOCK, R=>RESET, Z=>ZWEW);
U2 : LED7 port map(Z=>ZWEW, Q=>WYJSCIE);
end a1;
In simulation each particular block seems to be ok. But I'm not sure about block with components and port maps.
PS.
I'm sorry for my bad english!