Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] how to write a vhdl program with two conditional statements

Status
Not open for further replies.

prashanthi999

Member level 1
Joined
Nov 19, 2014
Messages
39
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
287
hello guys, im missing some pulses in my conditional statement, kindly guide me, here are my conditional statements, the conditions are not getting updated at the rising edge clock cycle.

Code:
process (clk)
   begin
	   if( ce = '1') then
			if s = '0' and c = '0' then 
					 zr <= xr;
					 zr1 <= xr1;
					 zi <= xi;
					 zi1 <= xi1;
			elsif s = '0' and c = '1' then 
					 zr <= xr;
					 zr1 <= xi1;
					 zi <= xi;
					 zi1 <= xr1;
			elsif s = '1' and c = '0' then 
					 zr <= xr + xr1;
					 zi <= xi + xi1;
					 zr1 <= xr - xr1;
					 zi1 <= xi - xi1;
			else
					 zr <= xr + xi1;
					 zi <= xi - xr1;
					 zr1 <= xr - xi1;
					 zi1 <= xi + xr1;
			end if;
      end if;			
   end process;
end Behavioral;
 

To get an update at rising edge, both in simulation and synthesized hardware, you'll use a rising_edge(clk) condition.

Code:
process (clk)
   begin
     if rising_edge(clk) then
       if ce = '1' then
          ....
       end if;
     end if;
   end process;
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top