错误(10170):在文本“和”附近的alarm_clock.v(133)处的Verilog HDL语法错误;期待“)”

时间:2012-12-13 10:56:59

标签: system-verilog

我一直收到这个错误,我尝试了各种方法来修复它,但它对我没有帮助。

我希望有人可以帮助我。

有问题的代码段如下:

if((HR == AHR) and (MIN == AMIN)) To be exact.

always @ (posedge CLK)
begin
case(state)
NORMAL: begin
        DHR <= HR;
        DMIN <= MIN;
        if(ALON)
            begin
            AENABLED <= 1;

            if((HR == AHR) and (MIN == AMIN))
                begin
                ALARM <= 1;
                if(SNOOZE) // we assume that SNOOZE is to be operated only when the Alarm is ON!
                    begin
                    AMIN <= AMIN + 2;
                    if(AMIN == 60)
                        begin
                        AMIN <= 0;
                        AHR <= AHR + 1;
                            if(AHR == 24)
                                AHR <= 0;
                        end
                    else if(AMIN == 61) // since AMIN is incremented by 2 it can either be 60 or 61 depending on previous alarm time
                        begin
                        AMIN <= 1;
                        AHR <= AHR + 1;
                            if(AHR == 24)
                            AHR <= 0;
                        end
                    end
                end
            end

1 个答案:

答案 0 :(得分:3)

and不是verilog!请改为&&