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. vue 实现点赞

    在v-for循环里 <ul class="project_content"> <li v-for="(item, index) in items&quo ...

  2. 【Codeforces 1106B】Lunar New Year and Food Ordering

    [链接] 我是链接,点我呀:) [题意] 给你n个菜以及每个人需要的菜以及数量 如果某个人无法满足它对菜的需求的话 就用价格比较低的菜来填充它的要求. (如果价格低的菜不够了,那么就直接输出0) 否则 ...

  3. 【郑轻邀请赛 C】DOBRI

    [题目链接]:https://acm.zzuli.edu.cn/zzuliacm/problem.php?id=2129 [题意] [题解] NMB 直接说i-1,i-2,i-3不就好了- [Numb ...

  4. WPF的TextBox以及PasswordBox显示水印文字

    1.TextBox <ControlTemplate x:Key="WaterMarkTextBox" TargetType="{x:Type TextBox}&q ...

  5. 用keil编写的 C51错误 *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_START

    可能原因: 替换工程的文件未先 remove该文件. 正常替换文件步骤: 1. 右键 欲 替换的文件,remove  XXXXX.c from build  ----> remove  XXXX ...

  6. gcc动态链接库so的制作和使用

    http://blog.csdn.net/CSqingchen/article/details/51546784 参考: http://blog.sina.com.cn/s/blog_69e96b37 ...

  7. 【Hibernate学习】 ——ORM(四)再次认识实体继承

    在信用办时.做失信.守信.黑名单这一块的时候.先把原来的需求看了看.紧接着就開始设计实体,这一块大部分都是同样的信息,所以就设计了一个实体,而且用一个状态标识出来是失信.守信还是黑名单. 在之后的改动 ...

  8. 3D数学读书笔记——多坐标系和向量基础

    本系列文章由birdlove1987编写,转载请注明出处. 文章链接: http://blog.csdn.net/zhurui_idea/article/details/24662453 第一个知识点 ...

  9. Git版本号控制:Git分支处理

    http://blog.csdn.net/pipisorry/article/details/46958699分支的意义创建分支能够避免提交代码后对主分支的影响,同一时候也使你有了相对独立的开发环境. ...

  10. Java-java-com-util-common-service:TreeService.java

    ylbtech-Java-java-com-util-common-service:TreeService.java 1.返回顶部 1. package com.shineyoo.manager.ut ...