jwx1904说道:2011-12-25 21:25:49
你好,帮我看一下下面这段程序,错误的原因,应该是语法上的错误,谢谢
module temperature (clk,dq,
d,cont,temp
);
input clk;//时钟1MHZ
input dq;//数字温度串行输入端口
output d;//控制信号输出端口
output cont;//三态门控制信号
output [9:0] temp;//10为温度值并行输出端口
reg d;
reg cont;
reg [9:0] temp;
reg data;
reg [6:0] num;//时隙计数,70个时钟周期为一个时隙
reg [6:0] count;//一次温度转换和输出技术,70个时隙
reg [9:0] t;
always @(posedge clk)
begin
num = num 1 ;
if (num > 7'b1000100)
begin num = 7'b0000000;
if (count == 7'b1001011)
begin count = 7'b0000000 ; end
else
begin count = count 1 ; end
end
else
begin num = num 1 ; end
//---------------------------------------------------------------
if (count >= 7'b0000000