在excle中添加带有文本值自动的数字

时间:2016-09-15 16:42:08

标签: excel

嗨我有一张在文本中有重复值的工作表。我只想添加数字数字系列,以使其值独特。例如:

module StateMachine(
   input [1:0] OP,
   input [1:0] RESULT_COM,
   input clk,
   input rst,
   output reg [1:0] CONTROL_AS=0,
   output reg RESET_C,
   output reg  CONTROL_C,
   output reg [1:0] state=0
    );

  parameter toLOWER=2'b01,toUPPER=2'b10,IDLE=0;
    reg [1:0] n_state = IDLE;
    //reg [1:0] state = IDLE;
    reg [1:0] p_state = IDLE;
    reg [1:0] prevOP = 2'b00;
    reg [1:0] p_state_copy = 2'b00;
    reg [15:0] count = 0;

   always @ (posedge clk)
    begin   
     if(rst == 1)
      RESET_C = 1;
     else
      RESET_C = 0;  

      if(OP == 2'b01)
        n_state = toLOWER;
      else 
        if(OP == 2'b10)
        n_state = toUPPER;
      else
        n_state = IDLE;

      if(prevOP == OP)
         p_state = state;

      if((OP != prevOP && OP[0] != OP[1]) || (rst == 1 && (OP != 2'b00 && OP != 2'b11)))
        CONTROL_C = 1;
      else
        CONTROL_C = 0;

      if(state != n_state)      
         prevOP = OP;

      state = n_state;
   end

   always @ (n_state)
    begin
      p_state_copy = p_state;    
    end

   always @ (p_state)
    begin
      case(p_state)
       toLOWER:
         begin
           if(RESULT_COM == 2'b10)
             CONTROL_AS <= 2'b10;
           else
             CONTROL_AS <= 2'b00; 
         end

       toUPPER:
         begin
           if(RESULT_COM == 2'b01)
             CONTROL_AS <= 2'b01;
           else
             CONTROL_AS <= 2'b00; 
         end

       IDLE:
         begin
           if(p_state_copy == toUPPER && RESULT_COM == 2'b01)
              CONTROL_AS <= 2'b01;  
          else if(p_state_copy == toLOWER && RESULT_COM == 2'b10)
               CONTROL_AS <= 2'b10;
          else if(p_state_copy == toUPPER && RESULT_COM == 2'b10)
              CONTROL_AS <= 2'b0; 
          else if(p_state_copy == toLOWER && RESULT_COM == 2'b01)
              CONTROL_AS <= 2'b0;  
          else if(p_state_copy == toUPPER && RESULT_COM == 2'b0)
              CONTROL_AS <= 2'b0; 
           //(p_state_copy == toLOWER && RESULT_COM == 2'b0)
          else CONTROL_AS <= 2'b0; 
         end

      endcase
    end
endmodule    

在单元格C中,我希望单元格A值具有数字。我希望你能理解我的问题。

2 个答案:

答案 0 :(得分:2)

在A列的文字中添加行号会有效吗?

-

答案 1 :(得分:1)

即使您的A列未排序或者您有多个重复项,以下公式仍然有效。

=A1 & " " & COUNTIF(A$1:A1,A1)