ismailov-e
Member level 1
- Joined
- Jan 26, 2015
- Messages
- 34
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 295
Hi everybody.
I have an aray of registers named slv_reg (10 registers and 32 bits of each). I want to check and count every register per bite for non zero. But unfortunately it shows different value. Here is a code:
And if i change the sign equal
to
sine it changes a value. Why?
I have an aray of registers named slv_reg (10 registers and 32 bits of each). I want to check and count every register per bite for non zero. But unfortunately it shows different value. Here is a code:
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 module loop( input wire clock, output reg [31:0] outputa ); reg [31:0] slv_reg [9:0]; reg [7:0] count = 0; reg [7:0] temp = 0; reg off = 0; integer i, k; initial begin slv_reg[0] = 32'b11111111_00001000_11111111_01000000; slv_reg[1] = 32'b10101010_01010101_10101010_01010101; slv_reg[2] = 32'b11111111_11111111_00001000_11111111; slv_reg[3] = 32'b00000100_10000000_11111111_00010000; slv_reg[4] = 32'b11100011_00011000_11110001_10111000; slv_reg[5] = 32'b11111111_11111111_00000001_00100000; slv_reg[6] = 32'b11111110_01111111_01000000_10000000; slv_reg[7] = 32'b11111111_00001000_11111111_01000000; slv_reg[8] = 32'b10101010_01010101_10101010_01010101; slv_reg[9] = 32'b00001000_10011111_00010000_00100000; end always@ (posedge clock) begin for (i = 0; i < 10; i = i + 1) begin for (k = 0; k < 4; k = k + 1) begin temp = slv_reg[i][(k*8)+:8]; if (temp != 0) count = count + 1; end end outputa = count; end endmodule
And if i change the sign equal
Code:
count = count + 1
Code:
<=