Download presentation
Presentation is loading. Please wait.
1
Digilent Spartan 3 Board Discussion D3.3
7-Segment Displays Digilent Spartan 3 Board Discussion D3.3
2
Spartan 3 Board
3
Spartan 3 Board
4
Turning on an LED Note: A zero turns on the LED
5
Spartan 3 Board
6
7-Segment Decoder a-g LOW to turn on segment
7
7-Segment Display Truth table q a b c d e f g 0 1 1 1 1 1 1 0
seg7dec q(3:0) AtoG(6:0) Truth table q a b c d e f g q a b c d e f g A b C d E F
8
7-Segment Decoder library IEEE; use IEEE.std_logic_1164.all;
entity seg7dec is port (q: in STD_LOGIC_VECTOR(3 downto 0); AtoG: out STD_LOGIC_VECTOR(6 downto 0)); end seg7dec; seg7dec q(3:0) AtoG(6:0)
9
architecture seg7dec_arch of seg7dec is
begin process(q) case q is when "0000" => AtoG <= " "; when "0001" => AtoG <= " "; when "0010" => AtoG <= " "; when "0011" => AtoG <= " "; when "0100" => AtoG <= " "; when "0101" => AtoG <= " "; when "0110" => AtoG <= " "; when "0111" => AtoG <= " "; when "1000" => AtoG <= " "; when "1001" => AtoG <= " "; when "1010" => AtoG <= " "; when "1011" => AtoG <= " "; when "1100" => AtoG <= " "; when "1101" => AtoG <= " "; when "1110" => AtoG <= " "; when others => AtoG <= " "; end case; end process; end seg7dec_arch;
10
7-Segment Display Behavior (Active LOW) VHDL seg7dec q(3:0) AtoG(6:0)
with q select AtoG <= " " when "0001", --1 " " when "0010", --2 " " when "0011", --3 " " when "0100", --4 " " when "0101", --5 " " when "0110", --6 " " when "0111", --7 " " when "1000", --8 " " when "1001", --9 " " when "1010", --A " " when "1011", --b " " when "1100", --C " " when "1101", --d " " when "1110", --E " " when "1111", --F " " when others; --0 Behavior (Active LOW) AtoG seg7dec q(3:0) AtoG(6:0)
11
.ucf file NET "AN<0>" LOC = "E13" ;
NET "AN<1>" LOC = "F14" ; NET "AN<2>" LOC = "G14" ; NET "AN<3>" LOC = "d14" ; NET "AtoG<6>" LOC = "E14" ; NET "AtoG<5>" LOC = "G13" ; NET "AtoG<4>" LOC = "N15" ; NET "AtoG<3>" LOC = "P15" ; NET "AtoG<2>" LOC = "R16" ; NET "AtoG<1>" LOC = "F13" ; NET "AtoG<0>" LOC = "N16" ; NET "dp" LOC = "P16" ;
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.