Jun 12, 2010 #1 D Digit0001 Member level 1 Joined Jun 12, 2010 Messages 41 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,547 Hi Can someone tell me, Is it possible to have a case statement without using a process? P.S
Jun 12, 2010 #2 M Marcel Majoor Full Member level 2 Joined Jan 17, 2004 Messages 148 Helped 69 Reputation 138 Reaction score 39 Trophy points 1,308 Activity points 1,569 A 'case' is exclusively for sequential code. For combinatorial code there is the simular WHEN or WITH you could use.
A 'case' is exclusively for sequential code. For combinatorial code there is the simular WHEN or WITH you could use.
Jun 12, 2010 #3 D Digit0001 Member level 1 Joined Jun 12, 2010 Messages 41 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,547 yeh i looked through my notes again and the process is required.
Jun 13, 2010 #4 R radix Full Member level 3 Joined Jul 23, 2002 Messages 156 Helped 7 Reputation 14 Reaction score 1 Trophy points 1,298 Activity points 1,534 Marcel, A case statement is just a mux. It can be used in a sequential or combinatorial process. Radix
Marcel, A case statement is just a mux. It can be used in a sequential or combinatorial process. Radix
Jun 13, 2010 #5 A amraldo Advanced Member level 4 Joined Aug 29, 2004 Messages 1,183 Helped 145 Reputation 290 Reaction score 37 Trophy points 1,328 Location Egypt Activity points 5,880 It is used in sequential statements description only. -- Amr Ali
Jun 14, 2010 #6 M magesh87ece Newbie level 6 Joined May 5, 2010 Messages 11 Helped 1 Reputation 2 Reaction score 0 Trophy points 1,281 Location chennai Activity points 1,336 Digit0001 said: Hi Can someone tell me, Is it possible to have a case statement without using a process? P.S Click to expand... library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity mux is Port ( i : in STD_LOGIC_VECTOR (3 downto 0); s : in STD_LOGIC_VECTOR (1 downto 0); y : out STD_LOGIC); end mux; architecture Behavioral of mux is begin using if statement --process (i,s) --begin --(if s="00" then y<=i(0); --elsif s="01"then y<=i(1); --elsif s="10"then y<=i(2); --end if; ) --end process; -- with statement act same as case statement outside process --with s select -- y<=i(0) when "00", -- i(1) when "01", -- i(2) when "10", -- i(3) when "11", -- 'Z' when others; -- when statement -- y<=i(0) when s="00"else -- i(1) when s="01"else -- i(2) when s="10"else --i(3) ; -- case statement with in process process(s,i) begin case s is when "00"=> y<=i(0); when "01"=> y<=i(1); when "10"=> y<=i(2); when "11"=> y<=i(3); when others=> null; end case; end process; end Behavioral; [/b] so if want to write a case statement outside process , use with select statement both are equl
Digit0001 said: Hi Can someone tell me, Is it possible to have a case statement without using a process? P.S Click to expand... library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity mux is Port ( i : in STD_LOGIC_VECTOR (3 downto 0); s : in STD_LOGIC_VECTOR (1 downto 0); y : out STD_LOGIC); end mux; architecture Behavioral of mux is begin using if statement --process (i,s) --begin --(if s="00" then y<=i(0); --elsif s="01"then y<=i(1); --elsif s="10"then y<=i(2); --end if; ) --end process; -- with statement act same as case statement outside process --with s select -- y<=i(0) when "00", -- i(1) when "01", -- i(2) when "10", -- i(3) when "11", -- 'Z' when others; -- when statement -- y<=i(0) when s="00"else -- i(1) when s="01"else -- i(2) when s="10"else --i(3) ; -- case statement with in process process(s,i) begin case s is when "00"=> y<=i(0); when "01"=> y<=i(1); when "10"=> y<=i(2); when "11"=> y<=i(3); when others=> null; end case; end process; end Behavioral; [/b] so if want to write a case statement outside process , use with select statement both are equl