题目内容
(请给出正确答案)
[主观题]
完成JK触发器的VHDL描述,要求 (1) 语言逻辑无误,并编译正确。 (2) 要进行功能仿真验证自己的设计结果。
答案
在进程中检测到时钟clk出现上升沿后,再根据对复位reset、置位set信号的检测作出相应的处理。得到的是同步方式的复位、置位。描述程序如下, library ieee; use ieee. std_logic_1164.all; entity JKFF is port(j,k,set,reset,clk:in std_logic;q,nq:out std_logic); end JKFF; architecture watdo of JKFF is begin process(clk) variable kq:std logic: ='0'; begin if clk'event and clk = '1' then if set = '0' and reset = '1' then kq: = '0'; --同步复位 elsif set = '1' and reset = '0' then kq: = '1'; elsif j ='0' and k='1' then kq: ='0'; elsif j ='1' and k='0' then kq: ='1'; elsif j ='1' and k='1' then kq: =not kq; end if; end if; q<= kq; nq<= not kq; end process; end watdo;
如搜索结果不匹配,请 联系老师 获取答案