Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for this code - - - - - - - - - - - - - - - - - - - - -

for this code "---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
--
--!!!!!!!!!!!!!!!!!!!
--!!! DE1 FILESET !!!
--!!!!!!!!!!!!!!!!!!!
--
-- ADD YOUR NAME:
--Mridhini Koyalkar
--
-- ADD YOUR STUDENT NUMBER:
--
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
library IEEE;
use ieee.std_logic_1164.all;
use IEEE.numeric_std.all;
use work.subccts.all;
entity bitbreaker is
port( SW : in std_logic_vector(9 downto 0);
KEY : in std_logic_vector(0 to 2);
HEX0 : out std_logic_vector(0 to 6);
HEX1 : out std_logic_vector(0 to 6);
HEX2 : out std_logic_vector(0 to 6);
HEX3 : out std_logic_vector(0 to 6);
LED : out std_logic_vector(9 downto 0));
end bitbreaker;
architecture mixed of bitbreaker is
-- signals associated with ports as illustrated in Figure 1
signal ledCntrl, reset, start, load, clk : std_logic;
signal guess, guessChk : std_logic_vector(7 downto 0);
signal targetLo : std_logic_vector(0 to 6);
signal targetHi : std_logic_vector(0 to 6);
signal guessLeft : std_logic_vector(0 to 6);
signal bitsCorrect : std_logic_vector(0 to 6);
-- ADD YOUR SIGNALS AS NEEDED BELOW THIS LINE
TYPE state_t is (init, display, saved, gameEnd);
signal curr_s, next_s: state_t;
begin
-- associate ports with player signals as illustrated in Figure 1
start <= not KEY(0);
load <= not KEY(1);
clk <= KEY(2);
guess <= SW(7 downto 0) ;
reset <= SW(8);
ledCntrl <= SW(9);
HEX0<= targetLo;
HEX1<= targetHi;
HEX2<= guessLeft;
HEX3<= bitsCorrect;
WITH ledCntrl SELECT
LED(9 DOWNTO 0)<="00" & guessChk WHEN '0',
"000000" & reset & clk & load & start WHEN OTHERS;
-- ADD YOUR CONTROL PATH BELOW
--targetLo <= SW(3 downto 0);
--targetHi <= SW(7 downto 4);
-- Include your FSM transitions
--TYPE state_t IS (init, display, saved, gameEnd);
--signal next_s: state_t;
-- Include your FSM output signals
process(curr_s, next_s, reset, start, load)
begin
CASE curr_s IS
when init =>
if start ='0' then
next_s <= init;
else
guessLeft <="8";
bitsCorrect <=(others =>'0');
guessChk <=(others =>'0');
targetHi <= SW(7 downto 4);
targetLo <= SW(3 downto 0);
next_s <= display;
end if;
when display =>
--correct bits
seg7_port: seg7 PORT MAP(bitsCorrect, HEX3);
--guesses left
seg7_port: seg7 port map(guessLeft, HEX2);
--guess hi
seg7_port: seg7 port map(targetHi, HEX1);
--guess lo
seg7_port: seg7 port map(targetLo, HEX0);
--if loaded
if load ='0' then
next_s <= display;
else
next_s <= saved;
end if;
--else stay here
when saved =>
--change guess hi and lo
targetHi <= SW(7 downto 4);
targetLo <= SW(3 downto 0);
--find correct bits
bitsCorrect <= match8 port map(SW(7 downto 0), guessChk, bitsCorrect);
--guesses left --;
if guessLeft >'0' then
guessLeft <= guessLeft -1;
else
guessLeft :='0';
end if;
--game end or display
if guessLeft ='0' then
next_s <= gameEnd;
elsif bitsCorrect ='8' then
next_s <= gameEnd;
else
next_s <= display;
end if;
when gameEnd =>
--correct bits
seg7 port map(bitsCorrect, HEX3);
--guesses left
seg7 port map(guessLeft, HEX2);
--guess hi
seg7 port map(targetHi, HEX1);
--guess lo
seg7 port map(targetLo, HEX0);
END CASE;
end process;
process(clk, reset)
begin
if reset ='0' then
curr_s <= init;
elsif(clk'event and clk ='1') then
curr_s <= next_s;
end if;
end process;
--else if ledCntrl ='0' then
-- LED <= guess_copy;
--else if ledCntrl ='1' then
-- LED(0)<= reset;
-- LED(1)<= clk;
-- LED(2)<= load;
-- LED(3)<= start;
-- ADD YOUR DATAPATH BELOW
end architecture;" i am getting this error "Error (10500): VHDL syntax error at bitbreaker.vhd(102) near text "entity"; expecting "(", or an identifier ("entity" is a reserved keyword), or a sequential statement
Error (10500): VHDL syntax error at bitbreaker.vhd(102) near text "PORT"; expecting "(", or "'", or "."
Error (10500): VHDL syntax error at bitbreaker.vhd(102) near text ";"; expecting ":=", or "<="
Error (10500): VHDL syntax error at bitbreaker.vhd(104) near text "port"; expecting "(", or "'", or "."
Error (10500): VHDL syntax error at bitbreaker.vhd(106) near text "seg7_port"; expecting ":=", or "<="
Error (10500): VHDL syntax error at bitbreaker.vhd(106) near text "port"; expecting "(", or "'", or "."
Error (10500): VHDL syntax error at bitbreaker.vhd(106) near text ";"; expecting ":=", or "

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

Solve for x: 2(3x 1)2(x + 5) = 12

Answered: 1 week ago