Forum Discussion
Altera_Forum
Honored Contributor
14 years agoHi, are you french ;-) ?
--- Quote Start --- In our college they did not teach us this programme and they want from us to make these codes in the next 3 days --- Quote End --- Did you go to the courses :-D ? Or your teacher is on hollydays. VHDL is Very High frenquency Integrated Circuit Hardware description language. So, you should have an "intro" to this language. First, make schema (for beginners). Second, describe it in VHDL In Quartus, you have templates. You will find them in Quartus menu. In the Word Wide Web (thanks to the billions of persons who are connected on and can help a poor lonesome student by freely sharing tons of knowledge....) , there are numerous examples. Q1) Not easy for pure beginners first make "n active low Enable signal using 1 to 2 Demultiplexer" Q2) http://en.wikipedia.org/wiki/vhdllibrary IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all; -- for the unsigned type
entity counter_example is
generic ( WIDTH : integer := 5); -- 5 here :-)
port (
CLK, RESET, LOAD : in std_logic;
DATA : in unsigned(WIDTH-1 downto 0);
Q : out unsigned(WIDTH-1 downto 0));
end entity counter_example;
architecture counter_example_a of counter_example is
signal cnt : unsigned(WIDTH-1 downto 0);
begin
process(RESET, CLK) is
begin
if RESET = '1' then
cnt <= (others => '0'); -- async load
elsif rising_edge(CLK) then -- synchronous domain below
if LOAD = '1' then
cnt <= DATA; -- sync load
else
cnt <= cnt + 1;
end if;
end if;
end process;
Q <= cnt;
end architecture counter_example_a; ... Good homeworks ! (in my opinon, this is the worst way to learn something) And .......... Good Luck !