diff options
author | 1138-4EB <1138-4EB@users.noreply.github.com> | 2017-03-02 00:24:57 +0100 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2017-12-10 12:02:05 +0100 |
commit | 28d9ddf0e2aff8fe6937949f54285cae9ee478a7 (patch) | |
tree | 0b91e072680c96493037360f7c05f1568912a99c /doc/using/UART_srcs/capitalisation/capitalisation.vhd | |
parent | 13a5256846f946d646a21faf221001f9ba15044d (diff) | |
download | ghdl-28d9ddf0e2aff8fe6937949f54285cae9ee478a7.tar.gz ghdl-28d9ddf0e2aff8fe6937949f54285cae9ee478a7.tar.bz2 ghdl-28d9ddf0e2aff8fe6937949f54285cae9ee478a7.zip |
Add raw sources of tutorial 'How to simulate an UART VHDL code with ghdl}' by 'René Doß'
Diffstat (limited to 'doc/using/UART_srcs/capitalisation/capitalisation.vhd')
-rw-r--r-- | doc/using/UART_srcs/capitalisation/capitalisation.vhd | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/doc/using/UART_srcs/capitalisation/capitalisation.vhd b/doc/using/UART_srcs/capitalisation/capitalisation.vhd new file mode 100644 index 000000000..e904eda95 --- /dev/null +++ b/doc/using/UART_srcs/capitalisation/capitalisation.vhd @@ -0,0 +1,51 @@ +-- loopback engine +---------------------------------------------------------------------- +library IEEE; +use IEEE.STD_LOGIC_1164.all; +use ieee.numeric_std.all; + +entity capitalisation is + port( + clk : in std_logic; + reset : in std_logic; + --in + rdata : in std_logic_vector(7 downto 0); + rd_en : in std_logic; + rd : out std_logic; + --out + wdata : out std_logic_vector(7 downto 0); + wr_en : in std_logic; + wr : out std_logic + ); +end; + +architecture Behavioral of capitalisation is + + + +begin + + + process(clk) + begin + wr<='0'; + rd<='0'; + if wr_en='1' and rd_en ='1' then + wr<='1'; + rd<='1'; + if (unsigned(rdata)>X"60") and + (unsigned(rdata)<X"7B") then + wdata<=rdata(7 downto 6 )&'0'& rdata(4 downto 0); + else + wdata<=rdata; + end if; + end if; + if reset='1' then + wr<='0'; + end if; + end process; + + + +end Behavioral; + |