er.akhilkumar
Full Member level 2
- Joined
- Feb 1, 2011
- Messages
- 123
- Helped
- 4
- Reputation
- 8
- Reaction score
- 4
- Trophy points
- 1,298
- Location
- Noida
- Activity points
- 2,443
Hello all,
I have a problem in writing an independent statement assigning 1-bit constant value to a reg type (not in always block) in module.
Here is the dummy code:
module one_bit (input a , output reg b);
assign b = 0; // is not synthesizable as b is of reg type
//always will not make sense in assigning permanent value
endmodule
Can anyone please help me in solving out this problem?
In VHDL I can simply write:
b <= '0'; // Permanently bound to ground as in VHDL there is no reg type std_logic is same for all
But in verilog I cannot write like above and I also cannot use assign statement as bit is of reg type.
Thanx
I have a problem in writing an independent statement assigning 1-bit constant value to a reg type (not in always block) in module.
Here is the dummy code:
module one_bit (input a , output reg b);
assign b = 0; // is not synthesizable as b is of reg type
//always will not make sense in assigning permanent value
endmodule
Can anyone please help me in solving out this problem?
In VHDL I can simply write:
b <= '0'; // Permanently bound to ground as in VHDL there is no reg type std_logic is same for all
But in verilog I cannot write like above and I also cannot use assign statement as bit is of reg type.
Thanx