close

// 死工程師阿宅的黑色幽默… 看不懂火星文是正常的...
// 何時 CONST 才會變成晚上小一點的時間變數呢 ?

module baby_hungry_model;
  wire baby_crying, feed;
  wire real feed_volumn;
  alan alan_inst ( baby_crying, feed, feed_volumn );
  baby baby_inst ( feed, baby_crying, feed_volumn )
endmodule

module alan( baby_crying, feed, feed_volumn );
input baby_crying;
output feed;
output real feed_volumn;

always@(posedge baby_crying ) begin
  feed <= 1'b1;
  feed_volumn <= full_baby_stomach;
  #1hour;
  feed <= 1'b0;
end
endmodule

module baby ( feed, baby_crying, feed_volumn );
input feed;
input real feed_volumn;
output baby_crying;
reg real stomach_fifo;

always@(posedge feed ) begin
  #1h;
  stomach_fifo <= stomach_fifo + feed_volumn;
end

always begin
  #time_tick;
  stomach_fifo <= stomach_fifo - "CONST";
end

assign baby_crying = ( stomach_fifo < HUNGRY_WATER_LEVEL )? 1'b1 : 1'b0;
endmodule

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 alantong 的頭像
    alantong

    J 和 A 的隨手亂記

    alantong 發表在 痞客邦 留言(1) 人氣()