Forum Discussion
Altera_Forum
Honored Contributor
12 years agoi am creating a program tO TURN ON LED USINg switches from the de2 board. the problem is the program runs without errror just warning. and while i test it on my de2 board it doesnot goes as plan. so for my program is there is 3 switch the first switch must be turn on and the led will turn on, the second switch will turn on the second led and the 3rdrn on both switch also will turn the 3 led.. i wanted the first switch to be the main controller.. if the first switch does not turn switch 2 and 3 cannot turn on the led.. but when i try runn it with my de2 it doesnot work that way. only 1 led turn on.. i have set the pin assignment correctly..really need some advice on sloving this tq in advance
entity Mux is port( A_bus : in std_logic_vector(2 downto 0); output : out std_logic_vector(2 downto 0)); end Mux; architecture arc_nnmux of Mux is begin process(A_bus) begin if A_bus <= (2=>'0',1=> '0', 0=>'1')then output <="001"; elsif A_bus <=(2=>'0',1=>'1',0=>'1')then output <="011"; elsif A_bus <=(2=>'1',1=>'1',0=>'1')then output <="111"; else output<= "000"; end if; end process; end arc_nnmux;