Question

12 Find and correct four errors in this program: ENTITY magnitude IS PORT (a,b: IN BIT_VECTOR (3 DOWNTO 0); aEQb, aGTb, aLTb:OUT BIT); END magnitude; ARCHITECTURE a OF magnitude IS BEGIN PROCESS BEGIN IF a b THEN aEQb< 1; aLTb <= 0; ELSIF a > b THEN ELSIF a <b THEN END a;
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution :-

The errors in the program are corrected in the below program. The underlined sections in the below given program are the corrected errors. In the first IF loop the assignment of the output bits are not in inverted comma. Then the process is not terminated with a matching end process clauseas well as if loop. All the errors are syntax errors in the program and corrected in the given program.

The code starts here -

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ENTITY magnitude IS

PORT ( a, b : IN BIT_VECTOR (3 DOWNTO 0);

aEQb, aGTb, aLTb : OUT BIT);

end magnitude;

ARCHITECTURE a OF magnitude IS

BEGIN

PROCESS

BEGIN

IF a = b THEN

aEQb <= '1';

  aGTb <= '0';

  aLTb <= '0';   

ELSEIF a > b THEN

aEQb <= '0';

  aGTb <= '1';

aLTb <= '0';

ELSEIF a < b THEN

aEQb <= '0';

  aGTb <= '0';

aLTb <= '1';

  ENDIF;

END PROCESS;

END a;

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Add a comment
Know the answer?
Add Answer to:
12 Find and correct four errors in this program: ENTITY magnitude IS PORT (a,b: IN BIT_VECTOR...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am making a 4-bit universal shift register that can perform right shift, left shift, and...

    I am making a 4-bit universal shift register that can perform right shift, left shift, and parallel loading using 4-to-1 multiplexers in VHDL. I keep getting red lines for u3, u2, u1, u0. The error says the following below. What is wrong with my code? How can I fix it? librarviees, use ieee.std_logic_1164.all; entity uni shift.reg.is porti 1 : in std. Jogis vector (3 downto.0); I, w, clock : in std logici 9: buffer std. Jogis vector (3 downto 0));...

  • Name: ·5. (10 lts) Find and correct errors in the following VHDL ed. IEEE ; library use IEEE . STD LOGIC-1104 . all...

    Name: ·5. (10 lts) Find and correct errors in the following VHDL ed. IEEE ; library use IEEE . STD LOGIC-1104 . all; entity cicuitl is port (a, b, elk: in STD_LOGIC: This part of the code its correct.That is, the entity definition and the 1ibraries are written correctly S out STD LOGIC) ond; architecture synth of eicuiti is begin This part of the code ธhould be a process that groups input a and input b together to forn a...

  • Question 18 (5 points) LIBRARY ece USE ieee.std logic 1164.all ENTITY prob6 21 IS PORT (w...

    Question 18 (5 points) LIBRARY ece USE ieee.std logic 1164.all ENTITY prob6 21 IS PORT (w IN STD LOGIC VECTOR(3 DOWNTO 0) y: OUT STD LOGIC VECTOR(I DOWNTO 0)); END prob6 21 ARCHITECTURE Behavior OF prob6 21 IS BEGIN WITH w SELECT y <= "O0" WHEN "0001" ..01.. WHEN "O010", "10" WHEN 0100" 11" WHEN OTHERS END Behavior What type of circuit does the VHDL code represents? 4-bit shifter a 4-to-2 binary encoder A two bit multiplier None of the...

  • 8.(5 points).There is an error in following VHDL code. Find the error and correct (only that...

    8.(5 points).There is an error in following VHDL code. Find the error and correct (only that line of code). LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY dec2to4 IS PORT (i IN STD LOGIC VECTOR (1 DOWNTO 0); : En IN STD_LOGIC; d OUT STD LOGIC); END dec2to4; ARCHITECTURE dataflow OF dec2to4 IS BEGIN SIGNAL Eni: STD_LOGIC_VECTOR(2 DOWNTO 0); Eni <= En & i; -concatenate signals WITH Eni SELECT d <"0001" WHEN "100" "0010" WHEN "101", "0100" WHEN "110", "1000" WHEN "111", 0000"...

  • QUESTION 1 Complete the following peice of VHDL code with the necessary VHDL statements for a...

    QUESTION 1 Complete the following peice of VHDL code with the necessary VHDL statements for a counter that counts through this sequence(0,9,17,15,4,26) repeatedly. library IEEE use IEEE.STD_LOGIC_1164 ALL entity GCC is Port ( systemClock, reset in STD_LOGIC end GCC architecture Behavioral of GCC is stateOutput out STD LOGIC_ VECTOR (4 downto 0)) component FreqDivider is Port (systemClock in STD_LOGIC; slowClock: out STD LOGIC); end component, signal nextState, presentState: std_logic_vector(5 downto 0) := "00000"; signal slowClock: std_logic begin FD0: FreqDivider port...

  • Draw the RTL schematic of the hardware that will be synthesized for the VHDL code below....

    Draw the RTL schematic of the hardware that will be synthesized for the VHDL code below. entity unknown is port (x: in std_logic_vector(7 downto 0); op: in std_logic_vector(1 downto 0); clk: in std_logic; f: out std_logic_vector(7 downto 0)); end entity. architecture arch of unknown is signal a, b, c, d: std_logic_vector(7 downto 0); begin d <= x; process (clk) begin if (rising_edge(clk)) then a <= b; b <= c + a; c <= d; if (op = “00”) then f...

  • b. Suppose you are provided with a 4-bit ripple carry adder. It has the following entity...

    b. Suppose you are provided with a 4-bit ripple carry adder. It has the following entity declaration and schematic representation А(3:0] B[3: entity fourbit FA is portA, B in std logic_vector (3 downto 0); 4-bit RCA Cin in std_logic; S out stdlogic_vector (3 downto 0) Cout out std logic: Cin Cout S3:0] end fourbitFA Create a VHDL architecture for the following circuit (15 Marks) C3:0] D[3:0] A[3:0] B[3:0] Е[3:0] F[3:0] 4-bit RCA 4-bit RCA inA 4-bit RCA CinB CinC Coutl...

  • Provided N(0, 1) and without using the LSND program, find P( - 2 <3 <0) Provided...

    Provided N(0, 1) and without using the LSND program, find P( - 2 <3 <0) Provided N(0, 1) and without using the LSND program, find P(Z < 2). Provided N(0, 1) and without using the LSND program, find P(Z <OOR Z > 2). Message instructor about this question Provided N(0, 1) and without using the LSND program, find P(-1<2<3). 0.84 Message instructor about this question

  • Please fully answer BOTH parts of the question (a) and (b). a) Draw the high level...

    Please fully answer BOTH parts of the question (a) and (b). a) Draw the high level synthesized diagram of the following VHDL code. What does the following circuit do? Write the sequence of output generated by this circuit. library ieee; use ieee.std_logic_1164.all; entity sequence is port ( cout :out std_logic_vector (3 downto 0); clk :in std_logic; reset :in std_logic ); end entity; architecture rtl of sequence is signal count :std_logic_vector (3 downto 0); begin process (clk) begin if (rising_edge(clk)) then...

  • Some questions may require well bulum 1. HDL stands for? a. Hardware Design Language b. Hardware...

    Some questions may require well bulum 1. HDL stands for? a. Hardware Design Language b. Hardware Development Language c. Hardware Description language d. Hot Dry Land 2. What is the basic building unit of a VHDL design? a. Blocks b. Cubes c . Dices d. Bricks 3. What reserved word do all VHDL entities end with? a. entity b. use c. port d. end d. IEEE 4. Which block describes a design's interface? a. entity b. architecture c. library 5....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT