Answered step by step
Verified Expert Solution
Question
1 Approved Answer
library IEEE; use ieee.std _ logic _ 1 1 6 4 . ALL; use IEEE.numeric _ std . all; - - any package with overloaded
library IEEE;
use ieee.stdlogicALL;
use IEEE.numericstdall; any package with overloaded add and subtract
entity Scoreboard is
port
clk rst inc, dec: in stdlogic;
bcdout, bcdout : out unsigned downto ;
segdisp segdisp: out unsigned downto
;
end Scoreboard;
architecture Behavioral of Scoreboard is
signal State: integer range to ;
signal BCD BCD: unsigned downto :; unsigned stdlogic vector
signal rstcnt: integer range to :;
type sevsegarray is array to of unsigned downto ;
constant segRom: sevsegarray :
; active high with "gfedcba" order
signal count: integer :;
signal tmp: stdlogic :;
signal clockout: stdlogic :;
begin
bcdout bcd;
bcdout bcd;
process clk tmp
begin
if clkevent and clk then
count count ;
if count then
tmp NOT tmp;
count ;
end if;
end if;
clockout tmp;
end process;
process clockout
begin
if clockout'event and clockout then
case State is
when initial state
BCD; BCD; clear counter
rstcnt ; reset RESETCOUNT
State ;
when state in which the scoreboard waits for inc and dec
if rst then
if rstcnt then checking whether th reset cycle
State ;
else rstcnt rstcnt ;
end if;
elsif inc and dec then
rstcnt ;
if BCD then
BCD BCD; library with overloaded required
elsif BCD then
BCD BCD;
BCD;
end if;
elsif dec and inc then
rstcnt ;
if BCD then
BCD BCD; library with overloaded required
elsif BCD then
BCD BCD;
BCD;
end if;
elsif inc and dec or inc and dec then
rstcnt ;
end if;
end case;
end if;
end process;
segdisp segromtointegerBCD; type conversion function from
segdisp segromtointegerBCD; IEEE numericstdlogic package used
end Behavioral;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started