ammar_kurd
Junior Member level 3
What is the difference between a reg type in Verilog and an actual register?
When using a reg type what will be inferred by synthesis tools, is it a flip-flop? if it was what type of flip-flop? I am a little bit confused since a register (reg) is basically a flip-flop but here I read it can infer a combinational circuit as well.
When using a reg type what will be inferred by synthesis tools, is it a flip-flop? if it was what type of flip-flop? I am a little bit confused since a register (reg) is basically a flip-flop but here I read it can infer a combinational circuit as well.
Now, coming to reg data type, reg can store value and drive strength. Something that we need to know about reg is that it can be used for modeling both combinational and sequential logic. Reg data type can be driven from initial and always block.
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 module reg_combo_example( a, b, y); input a, b; output y; reg y; wire a, b; always @ ( a or b) begin y = a & b; end endmodule