2021年5月4日 星期二

HBLbits_Verilog Basic_Exams/m2014 q6c

HBLbits_Verilog Basic_Exams/m2014 q6c 

Consider the state machine shown below, which has one input w and one output z.

For this part, assume that a one-hot code is used with the state assignment 'y[6:1] = 000001, 000010, 000100, 001000, 010000, 100000 for states A, B,..., F, respectively.

Write a logic expression for the next-state signals Y2 and Y4. (Derive the logic equations by inspection assuming a one-hot encoding. The testbench will test with non-one hot inputs to make sure you're not trying to do something more complicated).


module top_module (
    input [6:1] y,
    input w,
    output Y2,
    output Y4);
    parameter A=6'b000001,B=6'b000010,C=6'b000100;
    parameter D=6'b001000,E=6'b010000,F=6'b100000;
    assign Y2 = y[1] && ~w;
    assign Y4 = (y[2] | y[3] | y[5] | y[6]) && w;
endmodule


沒有留言:

張貼留言

Node-Red --> MQTT --> Fuxa

Node-Red --> MQTT --> Fuxa      FUXA(一個開源的 Web HMI / SCADA 自動化監控軟體)的專案設定檔 。 這份設定檔完整定義了 HMI 監控畫面的 後端通訊(MQTT 連線、點位標籤) 與 前端網頁圖形介面(SVG 畫布...