D
Deepu
Guest
Hi All,
I had a question on how to compare 5-6 integer numbers.
always @ (a or b)
begin
if ( a == 1)
begin
if (b == 1000 || 2000 || 3000 || 4000 || 5000 || 6000)
begin
$display ("All is Fine");
end
end
end
In the above example 'a' will be '1' and then when it enters the if
loop, it doesnot enter the 2nd 'if' loop even though b is 1000 or 2000
so on, Is this way of comparing allowed? How else i can do the
comparison of integer numbers.
Thanks
I had a question on how to compare 5-6 integer numbers.
always @ (a or b)
begin
if ( a == 1)
begin
if (b == 1000 || 2000 || 3000 || 4000 || 5000 || 6000)
begin
$display ("All is Fine");
end
end
end
In the above example 'a' will be '1' and then when it enters the if
loop, it doesnot enter the 2nd 'if' loop even though b is 1000 or 2000
so on, Is this way of comparing allowed? How else i can do the
comparison of integer numbers.
Thanks