STD_LOGIC_ARITH

扩展了UNSIGNED、SIGNED、SMALL_INT(短整型)三个数据类型,并定义了相关的算术运算和转换函数。

--================================================

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;

entity mux1 is
port(
  sclk : in std_logic;
  rst_n: in std_logic;
  count: buffer std_logic_vector(4 downto 0)
 );
end mux1;

architecture ok of mux1 is
signal cnt : std_logic_vector(4 downto 0);
begin
 
 process
 begin
  wait until sclk'event and sclk= '1';
   if rst_n = '0' then
    cnt <=(others =>'0');
   elsif unsigned(cnt ) >= 10 then
    cnt <= (others =>'0');
   else
    cnt <= unsigned(cnt) + 2;
   end if;
   
 end process;
count <= cnt;
end ok;

--========================================================

use IEEE.NUMERIC_STD.

支持整数的MOD,REM,ABS  等运算

dd <= 5 mod 3;
    dd <= 5 rem 3;
    dd <= abs(-3);

最新文章

  1. 基于Three.js的360X180度全景图预览插件
  2. Html空格字符代码:
  3. spring security 图解过滤器的使用
  4. mysql数据库---同时插入两个表以上的数据
  5. jQuery.validator 详解
  6. devexpress 控制面板汉化方式 参考信息
  7. web.xml 中的listener、 filter、servlet 加载顺序
  8. java03变量和基本数据类型
  9. C# sql操作
  10. Linux中的网络
  11. javascript 闭包基础分享
  12. Java Web(三) 会话机制,Cookie和Session详解
  13. esri-leaflet入门教程(5)- 动态要素加载
  14. 开启第一个Node.js的Express项目
  15. Docker Swarm Mode 学习笔记(创建 Swarm 集群)
  16. js设计模式(三)---代理模式
  17. 单因素方差分析的SAS实现
  18. Echarts简单案例
  19. [PHP]Nginx与PHP的文件上传大小限制
  20. Android Activity、Service、BroadcastReceiver 的生命周期

热门文章

  1. SAP订单状态最详细的解释
  2. WP runtime post 请求, json 解析
  3. VC 判断网络连接函数
  4. 从底层谈WebGIS 原理设计与实现(五):WebGIS中通过行列号来换算出多种瓦片的URL 之在线地图
  5. Producer-consumer problem in Python
  6. Hadoop主要架构
  7. while
  8. java并发:AtomicInteger 以及CAS无锁算法【转载】
  9. np.hsplit()
  10. UNITY中的MOUSE点击事件的判断和AS3中的异同