Question: CAN YOU PLEASE MAKE THE COUNT GO UP BY 1 ONCE IT REACHES 3 SECONDS? 3 use ieee.std _ logic _ 1 1 6 4
CAN YOU PLEASE MAKE THE COUNT GO UP BY ONCE IT REACHES SECONDS? use ieee.stdlogicall;
use ieee.stdlogicunsigned.all;
entity duabiasal is clr: in stdlogic; statecounter : out stdlogicvector downto ;;
end duabiasal;
architecture bhv of duabiasal issignal state: statetype; differentiaties between different statessignal seconds: stdlogicvector downto ; determines when the sttaecounter should change valueconstant secl: stdlogicvector downto :; the amount of time for states sl and s
beginbegin state s; seconds ; case state is if count secl then count count ; else count ; end if; if count secl then count count ; state s; end if; if count secl then count count ; else count ; end if; if count secl then count count ; state s; seconds ; when others end case; clockcounter seconds;C: processstate case state is statecounter ; nsy ; ewr; ewg l; statecounter ; nsy ; ewr; ewg ; case state is statecounter ; nsy ; ewr; ewg ; statecounter ; nsy ; ewr ; ewg ; statecounter ; nsy ; ewr; ewg ; statecounter ; nsy ; ewrl; ewg ; statecounter ; nsy ; ewr; ewg l;end process;
end bhv;
library ieee;
use ieee.stdlogicall;
use ieee.stdlogicunsigned.all;
entity duabiasa is
port clk: in stdlogic;
clr: in stdlogic;
nsr nsg nsy ewr, ewg, ewy: out stdlogic;
statecounter : out stdlogicvector downto ;
clockcounter : out stdlogicvector downto
;
end duabiasa;
architecture bhv of duabiasa is
type statetype is s s s s;
signal state: statetype; differentiaties between different states
signal count: stdlogicvector downto ; counts from s
signal seconds: stdlogicvector downto ; determines when the sttaecounter should change value
constant sec: stdlogicvector downto :; maximum value at which the timer will count up to
constant sec: stdlogicvector downto :; the amount of time for states s and s
begin
processclk clr seconds
begin
if clr then
state s;
count ;
seconds ;
elsif risingedgeclk then
case state is
when s
if count sec then
state s;
count count ;
seconds seconds ;
else
state s;
count ;
seconds ;
end if;
when s
if count sec then
state s;
count count ;
else
state s;
count ;
seconds ;
end if;
when s
if count sec then
state s;
count count ;
seconds seconds ;
else
state s;
count ;
seconds ;
end if;
when s
if count sec then
state s;
count count ;
else
state s;
count ;
seconds ;
end if;
when others
state s;
end case;
end if;
clockcounter seconds;
end process;
C: processstate
begin
case state is
when s
statecounter ;
nsr ;
nsy ;
nsg ;
ewr ;
ewy ;
ewg ;
when s
statecounter ;
nsr ;
nsy ;
nsg ;
ewr ;
ewy ;
ewg ;
when s
statecounter ;
nsr ;
nsy ;
nsg ;
ewr ;
ewy ;
ewg ;
when s
statecounter ;
nsr ;
nsy ;
nsg ;
ewr ;
ewy ;
ewg ;
when others
statecounter ;
nsr ;
nsy ;
nsg ;
ewr ;
ewy ;
ewg ;
end case;
end process;
end bhv;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
