Added VHDL syntax highlighting, and example code. issue #1642
This commit is contained in:
parent
9fd726a81c
commit
d9fe4880dc
5 changed files with 150 additions and 0 deletions
34
demo/kitchen-sink/docs/vhdl.vhd
Normal file
34
demo/kitchen-sink/docs/vhdl.vhd
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
library IEEE
|
||||
user IEEE.std_logic_1164.all;
|
||||
use IEEE.numeric_std.all;
|
||||
|
||||
entity COUNT16 is
|
||||
|
||||
port (
|
||||
cOut :out std_logic_vector(15 downto 0); -- counter output
|
||||
clkEn :in std_logic; -- count enable
|
||||
clk :in std_logic; -- clock input
|
||||
rst :in std_logic -- reset input
|
||||
);
|
||||
|
||||
end entity;
|
||||
|
||||
architecture count_rtl of COUNT16 is
|
||||
signal count :std_logic_vector (15 downto 0);
|
||||
|
||||
begin
|
||||
process (clk, rst) begin
|
||||
|
||||
if(rst = '1') then
|
||||
count <= (others=>'0');
|
||||
elsif(rising_edge(clk)) then
|
||||
if(clkEn = '1') then
|
||||
count <= count + 1;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
end process;
|
||||
cOut <= count;
|
||||
|
||||
end architecture;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue