title: Best VHDL design practice
body: <p>Question about best VHDL design practice.</p>
  
  <p>When designing state machines, should I use a signal within the Architecture or use an variable. I have until now used variables, since they are "kinda" private to the process, and IMHO makes good sense because they should not be accesses outside the process. But is this good design practice?</p>
  
  <pre><code>type state_type is (s0,s1);  
  signal state : state_type := s0;  
  
  A : process(clk)
  begin   
    if rising_edge(clk) then  
      case state is  
  .....  
      end case;  
    end if;
  end process;  
  
  --This process uses a variable  
  B : process(clk)  
    type state_type is (s0,s1);  
    variable state : state_type := s0;  
  begin  
    if rising_edge(clk) then  
      case state is  
        .....  
      end case;  
    end if;
  end process;  
  </code></pre>