综合资讯 技术文章 原文阅读 在线商城 下载专区 DATASHEET 技术论坛 商务频道

电子技术 | 技术资料 | 嵌入式系统 | 单片机专题 | DSP专题
EDA/PLD专题 | 电源技术专题 | 电子制作专题 | 其他综合 | 芯片选型

所在的位置:首页在线阅读EDA/PLD专题VHDL程序举例-基本语法正文
 
将16进制转化为std_logic

VHDL: Converting a Hexadecimal Value to a Standard Logic Vector

This example shows how to convert a hexadecimal value to a std_logic_vector. 
It is shown in both VHDL '87 (IEEE Std 1076-1987) and VHDL '93 (IEEE Std 1076-1993). 
For more information on using this example in your project, go to: http://www.fpga.com.cn


hex.vhd 

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;

ENTITY hex IS
    PORT(
        D : OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
END hex;

ARCHITECTURE a OF hex IS
BEGIN
-- The following line will convert the hex value 
-- to a STD_LOGIC_VECTOR in VHDL '87.

    D(7 DOWNTO 0) <= to_stdlogicvector(x"FC");
    
-- The following line will work in VHDL '93 (the standard allows 
-- this conversion implicitly).
-- D <= x"FC";
END a;


返回 上一页 下一页   信息发布:工号01   转引自: 【 】 【打印】 【关闭

关于我们 ┋ 友情链接


深圳市福田区海滨广场福业大厦12C
电话:0755-88305880 25960580 传真:0755-88305880
Copyright©2005-2007 无忧电子开发网版权所有

粤ICP备05064233号