in verilog what is the differnce between "=" and "="
- User
in verilog what is the differnce between "=" and "="
- Assistant
In your question, you seem to have intended to ask about the difference between
=and another operator, but both operators mentioned are . In Verilog, however, the is primarily used in assignments, and the comparison might actually be between and , so I will explain the difference between (blocking assignment) and (non-blocking assignment), assuming that's what you meant: - User
yes i meant between "=" and "<="
- Assistant
- User
in verilog can you put delay
- Assistant
- User
i have this code: module adder8bit(clk, c, s, cout, Q, op);
reg [31:0] counter; reg [7:0] a, b; reg [8:0] s_cout; reg clk_out; input clk; input [7:0] c; input [1:0] op; output reg [7:0] s; output reg cout; output Q; reg [1:0] opr;initial begin counter <= 32'h0000_0000; clk_out <= 0; end
always @(posedge clk) begin
counter <= counter + 1'd1; if (counter == 32'd100_000_000) begin clk_out <= 1 ; case(op) 2'b00: begin a <= c; end 2'b01: begin b <= c; end 2'b10: begin cout <= s_cout[8]; s_cout <= a + b; end 2'b11: begin s_cout = 0; s = 0; cout = 0; a = 0; b = 0; end default : ; endcase s <= s_cout[7:0] end else if ( counter == 32'd200_000_000) begin counter <= 32'h0000_0000; clk_out <= 0; end end assign Q = clk_out;endmodule
and have this error: Error (10110): Verilog HDL error at adder8bit.v(6): variable "s_cout" has mixed blocking and nonblocking Procedural Assignments -- must be all blocking or all nonblocking assignments
- Assistant