2021年4月25日 星期日

HBLbits_Verilog Basic_Exams/ece241 2013 q7

HBLbits_Verilog Basic_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.

JKQ
00Qold
010
101
11~Qold


module top_module (
    input clk,// positive clock edge.
    input j,
    input k,
    output Q); 
    always @(posedge clk) begin
        case ({j,k})
            2'b00: Q<=Q;
            2'b01: Q<=0;
            2'b10: Q<=1;
            2'b11: Q<=~Q;
        endcase
    end

endmodule

沒有留言:

張貼留言

Telegram +ESP32自動發報機

  Telegram   +ESP32自動發報機 這套系統是一個典型的 IoT(物聯網)架構 ,結合了遠端配置(Python)、通訊中介(MQTT)與硬體執行(ESP32)。 以下我為您拆解這兩支程式的核心運作原理: 一、 系統架構流程 Python 端 (控制台) :使用者輸入...