这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 高校专区 » 周师电子设计创新社区 » 第五次作业

共1条 1/1 1 跳转至

第五次作业

菜鸟
2014-11-07 22:34:47     打赏
 

LIBRARY IEEE;

USE IEEE.STD_LOGIC_1164.ALL;

USE IEEE.STD_LOGIC_UNSIGNED.ALL;

ENTITY d3to8 IS

port( DIN: IN STD_LOGIC_VECTOR(2 DOWNTO 0);

DOUT: OUT BIT_VECTOR(7 DOWNTO 0));

END d3to8;

ARCHITECTURE behave OF d3to8 IS

BEGIN

PROCESS (DIN)

BEGIN

CASE CONV_INTEGER(DIN) IS

WHEN 0 => DOUT<="00000001";

WHEN 1 => DOUT<="00000010";

WHEN 2 => DOUT<="00000100";

WHEN 3 => DOUT<="00001000";

WHEN 4 => DOUT<="00010000";

WHEN 5 => DOUT<="00100000";

WHEN 6 => DOUT<="01000000";

WHEN 7 => DOUT<="10000000";

WHEN OTHERS => NULL;

END CASE;




关键词: eda    

共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]