注册 登录
电子工程世界-论坛 返回首页 EEWORLD首页 频道 EE大学堂 下载中心 Datasheet 专题
宝义的个人空间 https://home.eeworld.com.cn/space-uid-230979.html [收藏] [复制] [分享] [RSS]
日志

jk触发器

已有 823 次阅读2010-5-6 08:23 |

library ieee;
use ieee.std_logic_1164.all;
USE IEEE.STD_LOGIC_UNSIGNED;
entity jk is
port(R,S,j,k,cp:in std_logic;
      Q,Q1:out std_logic);
      end jk;
      architecture a of jk is
      signal tem, tmp: std_logic;
      begin
      process(R,S,j,k,cp)
      begin
      if R<='0' AND S<='1' THEN
        tem<='0'; tmp<='1';
        elsif R<='1' AND  S<='0'THEN
          tem<='1'; tmp<='0';
         elsif R<='1' AND S<='1' THEN     
      if cp'event and cp='1' then
         if j<='0' and k<='0' then
        tem<=tem; tmp<=tmp;
        elsif j<='0' and k<='1' then
        tem<='0'; tmp<='1';
        elsif j<='1' and k<='0' then
        tem<='1'; tmp<='0';
        elsif j<='1' and k<='1' then
        tem<=not tem; tmp<=not tmp;
      end if;
      end if;
      end if;
      Q<=tem;Q1<=tmp;
      end process;
      end a;

全部作者的其他最新日志
评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

热门文章