Answered step by step
Verified Expert Solution
Question
1 Approved Answer
for this code - - - - - - - - - - - - - - - - - - - - -
for this code
DE FILESET
ADD YOUR NAME:
Mridhini Koyalkar
ADD YOUR STUDENT NUMBER:
library IEEE;
use ieee.stdlogicall;
use IEEE.numericstdall;
use work.subccts.all;
entity bitbreaker is
port SW : in stdlogicvector downto ;
KEY : in stdlogicvector to ;
HEX : out stdlogicvector to ;
HEX : out stdlogicvector to ;
HEX : out stdlogicvector to ;
HEX : out stdlogicvector to ;
LED : out stdlogicvector downto ;
end bitbreaker;
architecture mixed of bitbreaker is
signals associated with ports as illustrated in Figure
signal ledCntrl, reset, start, load, clk : stdlogic;
signal guess, guessChk : stdlogicvector downto ;
signal targetLo : stdlogicvector to ;
signal targetHi : stdlogicvector to ;
signal guessLeft : stdlogicvector to ;
signal bitsCorrect : stdlogicvector to ;
ADD YOUR SIGNALS AS NEEDED BELOW THIS LINE
TYPE statet is init display, saved, gameEnd;
signal currs nexts: statet;
begin
associate ports with player signals as illustrated in Figure
start not KEY;
load not KEY;
clk KEY;
guess SW downto ;
reset SW;
ledCntrl SW;
HEX targetLo;
HEX targetHi;
HEX guessLeft;
HEX bitsCorrect;
WITH ledCntrl SELECT
LED DOWNTO & guessChk WHEN
& reset & clk & load & start WHEN OTHERS;
ADD YOUR CONTROL PATH BELOW
targetLo SW downto ;
targetHi SW downto ;
Include your FSM transitions
TYPE statet IS init display, saved, gameEnd;
signal nexts: statet;
Include your FSM output signals
processcurrs nexts reset, start, load
begin
CASE currs IS
when init
if start then
nexts init;
else
guessLeft ;
bitsCorrect others ;
guessChk others ;
targetHi SW downto ;
targetLo SW downto ;
nexts display;
end if;
when display
correct bits
segport: seg PORT MAPbitsCorrect HEX;
guesses left
segport: seg port mapguessLeft HEX;
guess hi
segport: seg port maptargetHi HEX;
guess lo
segport: seg port maptargetLo HEX;
if loaded
if load then
nexts display;
else
nexts saved;
end if;
else stay here
when saved
change guess hi and lo
targetHi SW downto ;
targetLo SW downto ;
find correct bits
bitsCorrect match port mapSW downto guessChk, bitsCorrect;
guesses left ;
if guessLeft then
guessLeft guessLeft ;
else
guessLeft :;
end if;
game end or display
if guessLeft then
nexts gameEnd;
elsif bitsCorrect then
nexts gameEnd;
else
nexts display;
end if;
when gameEnd
correct bits
seg port mapbitsCorrect HEX;
guesses left
seg port mapguessLeft HEX;
guess hi
seg port maptargetHi HEX;
guess lo
seg port maptargetLo HEX;
END CASE;
end process;
processclk reset
begin
if reset then
currs init;
elsifclkevent and clk then
currs nexts;
end if;
end process;
else if ledCntrl then
LED guesscopy;
else if ledCntrl then
LED reset;
LED clk;
LED load;
LED start;
ADD YOUR DATAPATH BELOW
end architecture;" i am getting this error "Error : VHDL syntax error at bitbreaker.vhd near text "entity"; expecting or an identifier entity is a reserved keyword or a sequential statement
Error : VHDL syntax error at bitbreaker.vhd near text "PORT"; expecting or or
Error : VHDL syntax error at bitbreaker.vhd near text ;; expecting : or
Error : VHDL syntax error at bitbreaker.vhd near text "port"; expecting or or
Error : VHDL syntax error at bitbreaker.vhd near text "segport"; expecting : or
Error : VHDL syntax error at bitbreaker.vhd near text "port"; expecting or or
Error : VHDL syntax error at bitbreaker.vhd near text ;; expecting : or
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started