hali wrote on Feb 12th, 2010, 6:46am:Can anyone tell me that can I use binary numbers in verilog A .e.g can i assign( integer i=0100);
There is no direct method which is available in Verilog-D or Verilog-AMS.
hali wrote on Feb 12th, 2010, 6:46am:if no wat is the way to use binary numbers in verilog A?
It is same as C-language.
i = 0*(1<<3) + 1*(1<<2) + 0*(1<<1) + 0*(1<<0);
Quote:integer iflag, i, j, a, d;
integer x, h;
real test;
analog begin
@(initial_step) begin
iflag = 0;
d = 1;
x = 0;
for(i=0; i<=REGISTER_LENGTH;i=i+1) begin
x = x + (1 << i);
end
if(REGISTER_LENGTH == 15)
h = (1 << 0) + (1 << 14) + (1 << 15);
else
h = (1 << 0) + (1 << 5) + (1 << 9);
end // initial_step
@(timer(Clock_Period/10, Clock_Period)) begin
if(iflag > 0) begin
a = x & h;
j = 0;
for(i=1; i<=REGISTER_LENGTH;i=i+1) begin
j = j ^ ((a >> i) & 1);
end
x = x & (~1);
x = x ^ j;
x = x << 1;
end
iflag = 1;
end // timer