EmbDev.net

Forum: FPGA, VHDL & Verilog Error in simple code


von tino t. (tino09)


Rate this post
useful
not useful
Hello everyone, I am a newbie in VHDL, Im programming a code for 
simulating a T flip flop but all I get are errors.. Right now my code is 
not supossed to do nothing but giving the value '1' to q_temp but Im 
getting this error in line 47 and I dont know why, can anyone help me 
please?

Line 47. Variable 'q_temp' q_temp is at left hand side of signal 
assignment statement.
1
entity TFF2 is
2
    Port ( T : in  STD_LOGIC;
3
           CLK : in  STD_LOGIC;
4
           Q : out  STD_LOGIC;
5
           notQ : out  STD_LOGIC);
6
end TFF2;
7
8
architecture Behavioral of TFF2 is
9
10
begin
11
12
13
14
  Tff: process (CLK, T) is
15
    variable q_temp: std_logic :='0';
16
      begin
17
       if (clk'event and CLK = '1' and T = '1') then 
18
      q_temp <= '1';  --LINE 47
19
     end if;
20
  end process;
21
    
22
  --q_next<='1';  
23
  --q_past <= '1';
24
 -- Q <= q_temp;
25
  --Q <= '1';
26
  
27
end Behavioral;

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
Try this in line 47:
   q_temp := '1';

And read about the differences between variables and signals.

von tino t. (tino09)


Rate this post
useful
not useful
Thank you, thank fixed it. I still have a lot to learn :)

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.