Question

In: Electrical Engineering

I need to develop a VHDL code for a FPGA basys 3, 4 digit 7 segment...

I need to develop a VHDL code for a FPGA basys 3, 4 digit 7 segment display. So when binary 0, 1 ,and 2 are inputted the display says bad. When binary 3,4,5,6, the display says good.

Solutions

Expert Solution

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity display is
   port (   clock   : in std_logic;
       reset   : in std_logic;
       binary   : in std_logic_vector(2 downto 0);
       W4    : out std_logic;   --A1
       V4    : out std_logic;   --A2
       U4    : out std_logic;   --A3
       U2   : out std_logic;   --A4
       W7   : out std_logic;   --CA
       W6   : out std_logic;   --CB
       U8   : out std_logic;   --CC
       V8   : out std_logic;   --CD
       U5   : out std_logic;   --CE
       V5   : out std_logic;   --CF
       U7   : out std_logic;   --CG
       V7   : out std_logic       --DP
   );
end display;

architecture arch of display is

signal segment   : std_logic_vector(7 downto 0);

signal display_refresh_count : std_logic_vector (19 downto 0):= x"00000";

begin

   process(clock, reset)
   begin
       if (reset = '1') then
           display_refresh_count   <= x"00000";
       else
           if rising_edge (clock) then
               display_refresh_count   <= display_refresh_count + 1;
           end if;
       end if;
   end process;

   process (display_refresh_count(19 downto 18))
   begin
       W4 <= '1'; V4 <= '1'; U4 <= '1'; U2 <= '1';
       case (display_refresh_count(19 downto 18)) is
           when "00"=> if (binary = "000" or binary = "001" or binary = "010") then
                   segment <= "10000011";    --display 'b'
               elsif (binary = "011" or binary = "100" or binary = "101" or binary = "110") then
                   segment <= "10010000";    --display 'g'
               end if;
                   W4   <= '0';       --display on segment 1

           when "01"=> if (binary = "000" or binary = "001" or binary = "010") then
                   segment <= "10001000";    --display 'A'
               elsif (binary = "011" or binary = "100" or binary = "101" or binary = "110") then
                   segment <= "11000000";    --display 'O'
               end if;
                   V4   <= '1';       --display on segment 2

           when "10"=> if (binary = "000" or binary = "001" or binary = "010") then
                   segment <= "10100001";    --display 'd'
               elsif (binary = "011" or binary = "100" or binary = "101" or binary = "110") then
                   segment <= "11000000";    --display 'O'
               end if;
                   U4   <= '0';       --display on segment 3

           when "11"=> if (binary = "000" or binary = "001" or binary = "010") then
                   segment <= "11111111";    -- keep blank
               elsif (binary = "011" or binary = "100" or binary = "101" or binary = "110") then
                   segment <= "10100001";    --display 'd'
               end if;
                   U2   <= '0';       --display on segment 4

           when others=> null;
       end case;
   end process;
  
   W7 <= segment(0);
   W6 <= segment(1);
   U8 <= segment(2);
   V8 <= segment(3);
   U5 <= segment(4);
   V5 <= segment(5);
   U7 <= segment(6);
   V7 <= segment(7);
  
end arch;
          

          
                  

--Simulated


Related Solutions

I need to develop a VHDL code for a FPGA basys 3, 4 digit 7 segment...
I need to develop a VHDL code for a FPGA basys 3, 4 digit 7 segment display. So when binary 0, 1 ,and 2 are inputted the display says bad. When binary 3,4,5,6, the display says good.
How do I implement Image Processing using VHDL for FPGA? Please provide VHDL code
How do I implement Image Processing using VHDL for FPGA? Please provide VHDL code
I need a Verilog code that makes the LEDs on the FPGA board works like this....
I need a Verilog code that makes the LEDs on the FPGA board works like this. https://image.ibb.co/mu5tnS/6.gif There are 16 LEDs in the FPGA board
Write a verilog code for digital clock and display it’s seven segment using fpga?
Write a verilog code for digital clock and display it’s seven segment using fpga?
I need the vhdl code to display the binary number specified by an 8 input dip...
I need the vhdl code to display the binary number specified by an 8 input dip switch on a 7 segment display.
Write VHDL code (behavior model) to implement a 4-bit modulo-9 counter and simulate your VHDL code...
Write VHDL code (behavior model) to implement a 4-bit modulo-9 counter and simulate your VHDL code of 4-bit modulo-9 counter in ModelSim, and capture the screenshot of your simulated waveform. Assume clock period Tclk=100ns, initially, the counter is reset to Q3Q2Q1Q0=0000 you need to simulate a complete counting cycle plus one more additional clock period after it is reset to “0000” state.
Write VHDL code for the following: Use HEX-to-seven segment display converters to display the inputs and...
Write VHDL code for the following: Use HEX-to-seven segment display converters to display the inputs and results for a 4-bit adder. The inputs are unsigned 4-bit binary numbers. The outcome is a 4-bit binary adder with LED display. First you need to create a symbol for the HEX-to-seven segment display converter. Then implement a 4-bit adder using VHDL. Finally, connect three HEX-to-seven segment display converters to display input X, input Y, and sum S.
Design in VHDL a gray code decoder to excess 3 code Screenshot the simulation and code.
Design in VHDL a gray code decoder to excess 3 code Screenshot the simulation and code.
Fill in the blanks of the following segment of code, so that the output would be 1 3 4.
Fill in the blanks of the following segment of code, so that the output would be 1 3 4.int count = 0;do{++ count;if (count == 2)Blank;cout << count << " ";} while (count <= Blank);cout << endl;
I need these written in shell code 1.nested loop. e.g. 1*2 + 2*3 + 3*4 +...
I need these written in shell code 1.nested loop. e.g. 1*2 + 2*3 + 3*4 + ...(n-1)*n. (Only nested loops) 2.Fibonacci numbers.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT