dir_con.vhd

来自「直流电机的VHDL源程序,经过编译和仿真.」· VHDL 代码 · 共 21 行

VHD
21
字号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity dir_con is
    port(w_pwm:   in std_logic;
         sel:       in std_logic;
         forward: out std_logic;
         back:    out std_logic);
end dir_con;
architecture arc_dir of dir_con is
begin 
    process(sel,w_pwm)
    begin
       case sel is
         when '0'   =>forward<=w_pwm; back<='0';
         when '1'   =>forward<='0';   back<=w_pwm;
         when others=>forward<=w_pwm; back<='0';
       end case;
    end process;
end arc_dir;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?