VHDL allows the user to define own data types.

1 user-defined integer types  

-- This is indeed the pre-defined type integer
type integer is range - to +; -- indeed the pre-defined type natural
type natural is range to +; -- user-defined subset of integers
type my_integer is range - to ; -- user-defined subset of integers or naturals
type student_grade is range to ;

2 user-defined enumerated types

-- This is indeed the pre-defined type BIT
type bit is ('0','1'); -- user-defined subset of std_logic
type my_logic is ('','','Z'); -- indeed the pre-defined type of BIT_VECTOR
-- range <> is used to indicate that the range is unconstrained
-- NATURAL range <> indicate the range must fall within the NATURAL range
type BIT_VECTOR is array (NATURAL range <>) of BIT; -- an enumerated data type, typical of finte state machines
type state is (idle, forward, backward, stop); -- another enumerated data type
type color is (red, green, blue, white)

  The encoding of enumerated types is done sequentially and automatically. For example, for the type color above, two bits are necessary (there are four states), being ‘‘00’’ assigned to the first state (red), ‘‘01’’ to the second (green), ‘‘10’’ to the next (blue), and finally ‘‘11’’ to the last state (white).

VHDL之User-defined data types的更多相关文章

  1. ExtJS笔记 Ext.data.Types

    This is a static class containing the system-supplied data types which may be given to a Field. Type ...

  2. Data Types in the Kernel &lt;LDD3 学习笔记&gt;

    Data Types in the Kernel Use of Standard C Types /* * datasize.c -- print the size of common data it ...

  3. Data Types

    原地址: Home / Database / Oracle Database Online Documentation 11g Release 2 (11.2) / Database Administ ...

  4. Primitive Data Types

    Primitive Data Types (The Java™ Tutorials > Learning the Java Language > Language Basics) http ...

  5. Oracle Schema Objects——Tables——Oracle Data Types

    Oracle Schema Objects Oracle Data Types 数据类型 Data Type Description NUMBER(P,S) Number value having a ...

  6. NetCore + Mysql + EF:No coercion operator is defined between types 'System.Int16' and 'System.Boolean',

    总结三种解决办法: 1.Mysql升级到7 2.Nuget安装Pomelo.EntityFrameworkCore.MySql 2.2.0替代MySql.Data.EntityFrameworkCor ...

  7. C and SQL data types for ODBC and CLI

    C and SQL data types for ODBC and CLI   This topic lists the C and SQL data types for ODBC and CLI a ...

  8. allow zero datetime=true导致datetime转换失败:MySql.Data.Types.MySqlDateTime”的对象无法转换为类型“System.Nullable`1[System.DateTime]

    allow zero datetime=true导致datetime转换失败:MySql.Data.Types.MySqlDateTime”的对象无法转换为类型“System.Nullable`1[S ...

  9. "SQL Server does not handle comparison of NText, Text, Xml, or Image data types."

    "SQL Server does not handle comparison of NText, Text, Xml, or Image data types." sql2000 ...

随机推荐

  1. python - 函数的定义和使用

    目录 函数的定义和使用 一. 为什么要用函数? 二. 函数的参数 三. 函数的变量 global和nolocal 四. 递归函数 五. lamabda匿名函数 函数的定义和使用 1 def test( ...

  2. Codeforces 918C/917A - The Monster

    传送门:http://codeforces.com/contest/918/problem/C 一个括弧串由字符‘(’和‘)’组成.一个正确的串可被递归地定义,定义如下: ①空串e是一个正确的串: ② ...

  3. App后台开发运维和架构实践学习总结(2)——RESTful API设计技巧

    前言 移动互联网时代,RESTful API成为越来越重要的移动端和服务器端交互的形式.尤其是在很多互联网公司或者传统行业拥抱移动互联网的时候,一套设计良好的Restful API能够帮助互联网产品支 ...

  4. 2.1.6、SparkEnv中创建ShuffleManager

    ShuffleManager负责管理本地以及远程的block数据的shuffle操作. ShffuleManager的创建是在SparkEnv中. // Let the user specify sh ...

  5. Istio是啥?一文带你彻底了解!

    原标题:Istio是啥?一文带你彻底了解! " 如果你比较关注新兴技术的话,那么很可能在不同的地方听说过 Istio,并且知道它和 Service Mesh 有着牵扯. 这篇文章可以作为了解 ...

  6. [Cogs728] [网络流24题#3] 最小路径覆盖 [网络流,最大流,二分图匹配]

    建图:源点—>边的起点(集合1中的)—>边的终点(集合2中的)—>汇点,所有边权均为1, 计算最大流,最后枚举起点的出边,边权为0的即为匹配上的, 可以这样理解:每条边表示起点和终点 ...

  7. du 和 df的不同

    http://blog.sina.com.cn/s/blog_9c8286b7010108aj.html du和df命令都被用于获得文件系统大小的信息:df用于报告文件系统的总块数及剩余块数,du - ...

  8. Oracle数据库软件标准版的一个限制:仅仅能用一个rman channel

    Oracle数据库软件标准版的一个限制:仅仅能用一个rman channel Restrictions in "Standard Edition" Rman channel all ...

  9. Android studio 报错 gradel project sync failed Error:Cause: peer not authenticated

    在网上找了半天,应该是找不到gradel的路径,试了网上非常多方法.本人解决例如以下: 在android studio中设置gradle.打开File-> settings->Gradle ...

  10. hdu(1114)——Piggy-Bank(全然背包)

    唔..近期在练基础dp 这道题挺简单的(haha).可是我仅仅想说这里得注意一个细节. 首先题意: 有T组例子,然后给出储蓄罐的起始重量E,结束重量F(也就是当它里面存满了零钱的时候).然后给你一个数 ...