Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I don\'t understand what\'s wrong? how is there an 8 element error rather than b

ID: 2268214 • Letter: I

Question

I don't understand what's wrong? how is there an 8 element error rather than being the 7 needed?

Use the Quartus Prime Text Editor to implement a behavioral_model of a hex-to-7-segment decoder/driver combinational logic network in a file named hex_to_7seg_decoder.vhd. Specify the hex-to-7-segment decoder/driver entity according to the interface specification given in the table below. Port Mode Data Type Size Direction Description hex in std logic vector 4 bits downto 4-bit binary number Decoder enable std logic | std-logic-vector | 7-bits l to en in 1-bit N/A leds | out LED driver signals Within the declaration portion of an architecture named behavior, declare a signal named en hex of type std_logic_vector that represents an intermediate bus composed of input port signals en and hex [3:0], respectively Within the implementation portion of the behavior architecture, model the hex-to-7- segment decoder/driver according to the following specification Use a simple concurrent signal assignment (SCSA) statement and the concatenation operator (&) to assign signal en hex by appending the enable control signal en to the leftmost end . of the input port signal hex [3:0] Describe the truth table of the hex-to-7-segment decoder/driver using a single concurrent selected signal assignment (CSSA) statement. Use hexadecimal enhanced bit-string literals when referring (i.e. reading/writing) to values of any std logic vector signals in the CSSA

Explanation / Answer

VHDL code:

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

entity hex_to_7seg is

Port ( hex : in STD_LOGIC_VECTOR (3 downto 0);

en : in STD_LOGIC;

leds : out STD_LOGIC_VECTOR (6 downto 0)

);

end hex_to_7seg;

architecture Behavioral of hex_to_7seg is

begin

process (A)

begin

if en == 1 then

case A is

when "0000"=> leds <="1111110"; -- '0'

when "0001"=> leds <="0110000"; -- '1'

when "0010"=> leds <="1101101"; -- '2'

when "0011"=> leds <="1111001"; -- '3'

when "0100"=> leds <="0110011"; -- '4'

when "0101"=> leds <="1011011"; -- '5'

when "0110"=> leds <="1011111"; -- '6'

when "0111"=> leds <="1110000"; -- '7'

when "1000"=> leds <="1111111"; -- '8'

when "1001"=> leds <="1111011"; -- '9'

when "1010"=> leds <="1110111"; -- 'A'

when "1011"=> leds <="0011111"; -- 'b'

when "1100"=> leds <="1001110"; -- 'C'

when "1101"=> leds <="0111101"; -- 'd'

when "1110"=> leds <="1001111"; -- 'E'

when "1111"=> leds <="1000111"; -- 'F'

when others => NULL;

end case;

else then

leds < = "0000000";

end if;

end process;