BEEP蜂鸣器FPGA编程代码

//****************************************Copyright 2013(c)************************//
// ************************Declaration*************************************** //
// File name: Beep alarm //
// Author: xxxx @ huatong //
// Date: 2013-05-01 00:00 //
// Version Number: 1.0 //
// Abstract: Beep alarm temperature exceed setting scope
// //
// Modification history:(including time, version, author and abstract) //
// 2013-05-01 00:00 version 1.0 xxx //
// Abstract: Initial //
// //
// *********************************end************************************** //
module beep_alarm(
// input
clk_alarm,
rst_n,
temperature_integer,

//control setting
alarm_en,
alarm_door_value,
// output
beep
);

input clk_alarm;
input rst_n;
input [7:0] temperature_integer;
input alarm_en;
input [7:0] alarm_door_value;
output beep;

// when enable alram and current temperature is high than setting value.
assign beep = ((alarm_en == 1'b1) && (temperature_integer >= alarm_door_value)) ? clk_alarm : 1'b0;

endmodule

相关文档
最新文档