[HDLBits] Exams/ece241 2013 q7

A JK flip-flop has the below truth table. Implement a JK flip-flop with only a D-type flip-flop and gates. Note: Qold is the output of the D flip-flop before the positive clock edge.

J K Q
0 0 Qold
0 1 0
1 0 1
1 1 ~Qold
复制代码
module top_module (
    input clk,
    input j,
    input k,
    output Q); 
    //Q(~j)(~k)+
    wire d;
    assign d=(Q&(~j)&(~k))|(j&(~k))|(j&k&(~Q));
    always@(posedge clk) begin
        Q<=d;
    end
endmodule
相关推荐
Js_cold16 小时前
Verilog函数function
开发语言·fpga开发·verilog
Js_cold19 小时前
Verilog任务task
开发语言·fpga开发·verilog
brave and determined21 小时前
可编程逻辑器件学习(day3):FPGA设计方法、开发流程与基于FPGA的SOC设计详解
嵌入式硬件·fpga开发·soc·仿真·电路·时序·可编程逻辑器件
Lee_yayayayaya1 天前
锁相环技术及FPGA实现
fpga开发
Js_cold1 天前
Verilog局部参数localparam
开发语言·fpga开发·verilog
promising-w1 天前
【FPGA】使用移位实现LED流水灯
fpga开发
爱吃汽的小橘1 天前
ZYNQ介绍
fpga开发
ThreeYear_s2 天前
电力电子技术学习路径与FPGA/DSP技术结合方向(gemini生成)
学习·fpga开发
奋斗的牛马2 天前
FPGA—ZYNQ学习spi(六)
单片机·嵌入式硬件·学习·fpga开发·信息与通信
GateWorld2 天前
FPGA核心约束类型与语法
fpga开发