zoukankan      html  css  js  c++  java
  • 加减与有符号和无符号库

    library ieee;

    use ieee.std_logic_1164.all;

    use ieee.std_logic_unsigned.all;

    entity mult_test is

     

    port(sclk : in std_logic ;

     a : in std_logic_vector(3 downto 0);

     b : in std_logic_vector(3 downto 0);

     c : out std_logic_vector(7 downto 0)

     );

     

    end mult_test;

     

    architecture rtl of mult_test is

     

    begin

     process(sclk)

     begin

    if sclk'event and sclk = '1' then

    c <= a * b;

    end if;

     end process;

     

    end rtl;

     

    library ieee;

    use ieee.std_logic_1164.all;

    use ieee.std_logic_signed.all;

    entity mult_test is

     

    port(sclk : in std_logic ;

     a : in std_logic_vector(3 downto 0);

     b : in std_logic_vector(3 downto 0);

     c : out std_logic_vector(7 downto 0)

     );

     

    end mult_test;

     

    architecture rtl of mult_test is

     

    begin

     process(sclk)

     begin

    if sclk'event and sclk = '1' then

    c <= a * b;

    end if;

     end process;

     

    end rtl;

     

     

    library ieee;

    use ieee.std_logic_1164.all;

    use ieee.std_logic_unsigned.all;

    entity mult_test1 is

     

    port(sclk : in std_logic ;

     a : in std_logic_vector(3 downto 0);

     b : in std_logic_vector(3 downto 0);

     d : out std_logic_vector(3 downto 0)

     );

     

    end mult_test1;

     

    architecture rtl of mult_test1 is

     

    begin

     process(sclk)

     begin

    if sclk'event and sclk = '1' then

    d <= a + b;

     

    end if;

     end process;

    end rtl;

     

    library ieee;

    use ieee.std_logic_1164.all;

    use ieee.std_logic_signed.all;

    entity mult_test1 is

     

    port(sclk : in std_logic ;

     a : in std_logic_vector(3 downto 0);

     b : in std_logic_vector(3 downto 0);

     d : out std_logic_vector(3 downto 0)

     );

     

    end mult_test1;

     

    architecture rtl of mult_test1 is

     

    begin

     process(sclk)

     begin

    if sclk'event and sclk = '1' then

    d <= a + b;

     

    end if;

     end process;

     

    end rtl;

     

  • 相关阅读:
    Delphi的IDE的快捷键
    XE4 There is no overloaded version GetTextExtentPoint32A
    正确安装DevExpress.ExpressQuantumGrid.Suite For D7
    按比例缩小图片(80分)
    Delphi 2010 新增功能之: TWICImage 类[3]
    Delphi image 等比例缩小
    delphi 图片加水印源代码
    DELPHI窗体属性
    delphi透明panel组件或者制作方法
    利用VB、Delphi轻松实现图像漫游
  • 原文地址:https://www.cnblogs.com/zhongguo135/p/3453127.html
Copyright © 2011-2022 走看看