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;

     

  • 相关阅读:
    ajax 中文乱码问题 主要是IE浏览器
    js 带省略号的分页源码及应用实例
    js iframe onload &line-height浏览器兼容问题
    Js 正则表达式特殊字符含义
    js prototype
    js call apply caller callee bind
    怎么查看一个网站是用什么语言编写的?
    ASP.NET之AreaRegistration
    产品经理
    程序猿全面充电10本书
  • 原文地址:https://www.cnblogs.com/zhongguo135/p/3453127.html
Copyright © 2011-2022 走看看