📄 hdb3a.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity hdb3a is
port(reset,clk,datain: in std_logic;
dout: out std_logic_vector(1 downto 0));
end entity;
architecture rtl of hdb3a is
signal counter:integer range 0 to 3;
begin
process(reset,clk,datain) is
begin
if reset='0' then counter<=0;dout<="00";
elsif(clk='1' and clk'event) then
if datain='0' then
counter<=counter+1;
if counter=3 then --连4个0了
dout<="11"; counter<=0;
else
dout<="00"; --没连4个0
end if;
else
dout<="01"; --1 码
counter<=0;
end if;
end if;
end process;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -