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;

     

  • 相关阅读:
    JID 2.0 RC4 发布,高性能的 Java 序列化库
    FBReaderJ 1.6.3 发布,Android 电子书阅读器
    Arquillian 1.0.3.Final 发布,单元测试框架
    JavaScript 的宏扩展 Sweet.js
    Hypertable 0.9.6.5 发布,分布式数据库
    JRuby 1.7.0 发布,默认使用 Ruby 1.9 模式
    httppp 1.4.0 发布,HTTP响应时间监控
    Redis 2.6.0 正式版发布,高性能K/V服务器
    OfficeFloor 2.5.0 发布,IoC 框架
    XWiki 4.3 首个里程碑发布
  • 原文地址:https://www.cnblogs.com/zhongguo135/p/3453127.html
Copyright © 2011-2022 走看看