Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

expalin why i keep reciving the error Error ( 1 0 5 0 0 ) : VHDL syntax error at bitbreaker.vhd ( 1 1 0

expalin why i keep reciving the error "Error (10500): VHDL syntax error at bitbreaker.vhd(110) near text "PORT"; expecting "(", or "'", or "."
Error (10500): VHDL syntax error at bitbreaker.vhd(110) near text ";"; expecting ":=", or "<="" for every line with port "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
component seg7 IS
PORT ( bin : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ;
segments : OUT STD_LOGIC_VECTOR(0 TO 6)
);
end component;
component match8 IS
PORT ( guess, target : IN STD_LOGIC_VECTOR (7 downto 0) ;
numMatch : OUT STD_LOGIC_VECTOR (3 downto 0)) ;
END component ;
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
-- 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_3: seg7 PORT MAP(bin => bitsCorrect, segments => HEX3);
--guesses left
seg7_port_2: seg7 port map(guessLeft, HEX2);
--guess hi
seg7_port_1: seg7 port map(targetHi, HEX1);
--guess lo
seg7_port_0: 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;
end architecture;" "--
-- seg7: drives a 7-segment display with a 4-bit binary value
--
LIBRARY ieee ;
USE ieee.std_logic_1164.all ;
ENTITY seg7 IS
PORT ( bin : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ;
segments : OUT STD_LOGIC_VECTOR(0 TO 6)) ;
END seg7 ;
ARCHITECTURE Behavior OF seg7 IS
BEGIN
PROCESS ( bin )
BEGIN
CASE bin IS --0123456
WHEN "0000"=> segments <="0000001" ;
WHEN "0001"=> segments <="1001111" ;
WHEN "0010"=> segments <="0010010" ;
WHEN "0011"=> segments <="0000110" ;
WHEN "0100"=> segments <="1001100" ;
WHEN "0101"=> segments <="0100100" ;
WHEN "0110"=> segments <="0100000" ;
WHEN "0111"=> segments <="0001111" ;
WHEN "1000"=> segments <="0000000" ;
WHEN "1001"=> segments <="0000100" ;
WHEN "1010"=> segments <="0001000" ;
WHEN "1011"=> segments <="1100000" ;
WHEN "1100"=> segments <="0110001" ;
WHEN "1101"=> segments <="1000010" ;
WHEN "1110"=> segments <="0110000" ;
WHEN "1111"=> segments <="0111000" ;
WHEN OTHERS => segments <="-------" ;
END CASE ;
END PROCESS ;
END Behavior ;"

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

3. Define the roles individuals play in a group

Answered: 1 week ago