C114门户论坛百科APPEN| 举报 切换到宽版

亚星游戏官网

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索

军衔等级:

亚星游戏官网-yaxin222  一级军士长

注册:2008-10-28
发表于 2009-6-4 10:59:55 |显示全部楼层
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_signed.all;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity qianga is
port(esa,esb,esc,esd:in bit;
   rst:in std_logic;
   lta,ltb,ltc,ltd亚星游戏官网-yaxin222ut bit);
end qianga;
architecture Behavioral of qianga is
signal data1:bit_vector(3 downto 0);

begin
process(rst,data1,esa,esb,esc,esd)
   begin
      if rst='0'
    then lta<='0';ltb<='0';ltc<='0';ltd<='0';
    else
      data1(3)<=esa;
    data1(2)<=esb;
    data1(1)<=esc;
    data1(0)<=esd;
    end if;
      case data1 is
    when "0001"=>lta<='1';ltb<='0';ltc<='0';ltd<='0';
    when "0010"=>lta<='0';ltb<='1';ltc<='0';ltd<='0';
    when "0100"=>lta<='0';ltb<='0';ltc<='1';ltd<='0';
    when "1000"=>lta<='0';ltb<='0';ltc<='0';ltd<='1';
    when others=>lta<='0';ltb<='0';ltc<='0';ltd<='0';
    end case;
end process;
end Behavioral;
有个电子技术实验让做个抢答器,昨天看了一天,刚刚编了一个,语法没错了,不知道能不能实现呢,4位抢答,各位帮忙看看哈,我也是学通信的啊,不知道为啥有这个实验

举报本楼

本帖有 7 个回帖,您需要登录后才能浏览 登录 | 注册
您需要登录后才可以回帖 登录 | 注册 |

手机版|C114 ( 沪ICP备12002291号-1 )|联系大家 |网站地图  

GMT+8, 2024-9-24 15:24 , Processed in 0.104154 second(s), 15 queries , Gzip On.

Copyright © 1999-2023 C114 All Rights Reserved

Discuz Licensed

回顶部
XML 地图 | Sitemap 地图