Guest
Im trying to learn an HDL, and just trying to do a simple clock divide,
but not sure when to use 'reg' or when to use 'wire'. The xilinx ise
8.1 synthesizer complains about dclk below:
module test(clk);
input clk;
reg [1:0] CounterZ;
reg dclk; //input clk divided by 2
wire dclk;
always @(posedge clk)
CounterZ <= CounterZ + 1;
dclk = CounterZ(0);
but not sure when to use 'reg' or when to use 'wire'. The xilinx ise
8.1 synthesizer complains about dclk below:
module test(clk);
input clk;
reg [1:0] CounterZ;
reg dclk; //input clk divided by 2
wire dclk;
always @(posedge clk)
CounterZ <= CounterZ + 1;
dclk = CounterZ(0);