Demo entry 6685859

abc

   

Submitted by anonymous on Dec 21, 2017 at 12:14
Language: vhdl. Code size: 2.0 kB.

----------------------------------------------------------------------------------
-- Company: Hochschule Coburg
-- Engineer: Fabian Kremer, Johannes Bauer
-- Group: 12
-- 
-- Create Date:    15:40:29 12/07/2017 
-- Design Name: 
-- Module Name:    BCD7SEG - Behavioral 
-- Project Name: 
-- Target Devices: 
-- Tool versions: 
-- Description: 
--
-- Dependencies: 
--
-- Revision: 
-- Revision 0.01 - File Created
-- Additional Comments: 
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity BCD7SEG is
    Port ( BCD0 : in  STD_LOGIC;
           BCD1 : in  STD_LOGIC;
           BCD2 : in  STD_LOGIC;
           BCD3 : in  STD_LOGIC;
           LED : out  STD_LOGIC_VECTOR (6 downto 0));
end BCD7SEG;

architecture Behavioral of BCD7SEG is

signal HEX : STD_LOGIC_VECTOR (3downto 0);

begin

HEX <= BCD3 & BCD2 & BCD1 & BCD0;

--HEX-to-seven-segment decoder
--   HEX:   in    STD_LOGIC_VECTOR (3 downto 0);
--   LED:   out   STD_LOGIC_VECTOR (6 downto 0);
-- 
-- segment encoinputg
--      0
--     ---  
--  5 |   | 1
--     ---   <- 6
--  4 |   | 2
--     ---
--      3
   
    with HEX select
   LED<= "0000110" when "0001",   --1
         "1011011" when "0010",   --2
         "1001111" when "0011",   --3
         "1100110" when "0100",   --4
         "1101101" when "0101",   --5
         "1111101" when "0110",   --6
         "0000111" when "0111",   --7
         "1111111" when "1000",   --8
         "1101111" when "1001",   --9
         "1110111" when "1010",   --A
         "1111100" when "1011",   --b
         "0111111" when others;   --0
 
    
				

end Behavioral;

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).