Error (10137): Verilog HDL Procedural Assignment error at 8bitadder.v(32): object "s" on…
- User
Error (10137): Verilog HDL Procedural Assignment error at 8bitadder.v(32): object "s" on left-hand side of assignment must have a variable data type
- Assistant
The error you're encountering,
Error (10137): Verilog HDL Procedural Assignment error at 8bitadder.v(32): object "s" on left-hand side of assignment must have a variable data type, suggests that there is an issue with how you are attempting to assign a value to an object named in your Verilog code. In Verilog, the procedural assignment error typically occurs when trying to assign a value to something that is not declared as a variable (reg or integer for example) within a procedural block (like or ). - User
here is the code: module adder8bit(clk, c, s, cout);
reg [1:0] op; reg [31:0] counter; reg [7:0] a, b; reg [8:0] s_cout; reg qr; input clk; input [7:0] c; output [7:0] s; output cout;initial begin counter <= 32'h00000000; op <= 2'b00; qr <= 0; end
always @(posedge clk) begin if (counter == 32'd100_000_000) begin qr <= 1; case(op) 2'b00: a <= c; 2'b01: b <= c; 2'b10: begin s_cout <= a + b; assign s = s_cout[7:0]; assign cout = s_cout[8]; end 2'b10: s_cout = 'b0000_00000; default: op = 2'bxx; endcase
counter <= 32'h0000_0000; end else begin qr <=0; counter <= counter + 1'd1; end end assign Q = qr;endmodule
and here are the errors: Error (10137): Verilog HDL Procedural Assignment error at adder8bit.v(32): object "s" on left-hand side of assignment must have a variable data type Error (10137): Verilog HDL Procedural Assignment error at adder8bit.v(33): object "cout" on left-hand side of assignment must have a variable data type
- Assistant