Fehlermeldung mit unsigned

OP #713365
Lesenswert?

Hallo,

ich versuche mit folgendem Codeausschnitt einen Dezimal zu 7 Segment 
Decoder zu bauen.
Es kommt jedoch folgende Fehlermeldung:

Error (10621): VHDL Use Clause error at SegmentDecoder.vhd(16): more 
than one Use Clause imports a declaration of simple name "unsigned" -- 
none of the declarations are directly visible

##################################################
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE IEEE.std_logic_arith.all;
use IEEE.numeric_std.all;

ENTITY SegmentDecoder IS
  PORT (
    bit : in std_logic_vector(4 downto 0);
    seg1,seg2 : out std_logic_vector(6 downto 0));
END SegmentDecoder;

ARCHITECTURE Behavior OF SegmentDecoder IS
SIGNAL geteilt : unsigned(3 downto 0);
SIGNAL modrest : unsigned(3 downto 0);

COMPONENT Decoder
  PORT (
    binaer:IN STD_LOGIC_VECTOR(3 downto 0);
    segmente: OUT STD_LOGIC_VECTOR(6 downto 0)); --ausgangsports
END COMPONENT;

BEGIN
  dec1 : Decoder
    PORT MAP (geteilt,seg1);
  dec2 : Decoder
    PORT MAP (modrest,seg2);
PROCESS (bit)
BEGIN
  geteilt <= bit mod 10 ;
  modrest <= bit / 10 ;
END PROCESS;
END Behavior;

##################################################
#716287
Lesenswert?

Hab da noch was für ein Spartan 3e Starter Kit. Passt vielleicht nicht 
genau zu Deiner Frage, aber so als Ansatz...
1
-- Ansteuerung der 7_SegmentAnzeige Xilinx-Board - Spartan3
2
--
3

4
-------------------------------------------------------
5
  -- Pinzuweisungen im Top-Level:
6
  --attribute LOC: string;
7
  --attribute LOC of anzeige: signal is "E14 G13 N15 P15 R16 F13 N16 P16";
8
  --attribute LOC of mux_u: signal is "E13 F14 G14 D14";
9
-------------------------------------------------------
10
library IEEE;
11
use IEEE.std_logic_1164.all; 
12

13

14
package spartan3_anzeige_pack is
15
--Ausgabe von vier vier-bit Dualzahlen 
16
component dual4_7Segment 
17
  port(
18
    clk:      in std_logic;
19
    AN3:     in  std_logic_vector(3 downto 0);    --Anzeige links
20
    AN2:     in  std_logic_vector(3 downto 0);    --      .
21
    AN1:     in  std_logic_vector(3 downto 0);    --      .
22
    AN0:     in  std_logic_vector(3 downto 0);    --Anzeige rechts
23
    dps:     in  std_logic_vector(3 downto 0);  --Dezimalpunkte von links nach rechts
24
    seg_out: out std_logic_vector(7 downto 0);    --Ausgang zur Anzeige
25
    mux_u:   out std_logic_vector(3 downto 0)      --Auswahl/multiplexen der Anzeige
26
  );
27
end component;
28
end spartan3_anzeige_pack;
29
----------------------------------------------------------------------------------
30

31

32
library IEEE;
33
use IEEE.std_logic_1164.all; 
34
use work.freq_pack.all;
35

36
entity dual4_7Segment is
37
  port(
38
    clk:   in std_logic;
39
    AN3:     in  std_logic_vector(3 downto 0);
40
    AN2:     in  std_logic_vector(3 downto 0);
41
    AN1:     in  std_logic_vector(3 downto 0);
42
    AN0:     in  std_logic_vector(3 downto 0);
43
    dps:     in  std_logic_vector(3 downto 0); 
44
    seg_out: out std_logic_vector(7 downto 0);
45
    mux_u:   out std_logic_vector(3 downto 0)
46
   );
47
 
48
end dual4_7Segment;  
49

50
architecture  verhalten of dual4_7Segment is
51

52
signal Sieben_Segment_Ausgang    : std_logic_vector(7 downto 0);
53
signal sig_u                     : Std_logic_vector(3 downto 0);
54
signal mux_takt :  std_logic;
55

56
begin
57
  process(Sig_u)
58
  begin
59
    case sig_u is
60
      when "0000" => Sieben_segment_Ausgang(7 downto 1) <= "0000001";
61
      when "0001" => Sieben_segment_Ausgang(7 downto 1) <= "1001111";
62
      when "0010" => Sieben_segment_Ausgang(7 downto 1) <= "0010010";
63
      when "0011" => Sieben_segment_Ausgang(7 downto 1) <= "0000110";
64
      when "0100" => Sieben_segment_Ausgang(7 downto 1) <= "1001100";
65
      when "0101" => Sieben_segment_Ausgang(7 downto 1) <= "0100100";
66
      when "0110" => Sieben_segment_Ausgang(7 downto 1) <= "0100000";
67
      when "0111" => Sieben_segment_Ausgang(7 downto 1) <= "0001111";
68
      when "1000" => Sieben_segment_Ausgang(7 downto 1) <= "0000000"; 
69
      when "1001" => Sieben_segment_Ausgang(7 downto 1) <= "0000100";
70
      when "1010" => Sieben_segment_Ausgang(7 downto 1) <= "0001000";  
71
      when "1011" => Sieben_segment_Ausgang(7 downto 1) <= "1100000";
72
      when "1100" => Sieben_segment_Ausgang(7 downto 1) <= "0110001";  
73
      when "1101" => Sieben_segment_Ausgang(7 downto 1) <= "1000010";
74
      when "1110" => Sieben_segment_Ausgang(7 downto 1) <= "0110000";
75
      when "1111" => Sieben_segment_Ausgang(7 downto 1) <= "0111000";
76
      when others => Sieben_segment_Ausgang(7 downto 1) <= "0000000";     
77
    end case;
78

79
  end process;
80
  
81
  seg_out <= Sieben_Segment_ausgang;
82
    
83
  Takt: frequenzteiler generic map(25000)
84
        port map(clk, '0', '1', mux_takt);
85

86
  mux1:  Process(mux_takt) 
87
   variable mux: integer:=0;
88
   begin
89
     if (mux_takt'event and mux_takt = '1') then
90
       if mux = 0 then
91
         Sig_u <= AN3;
92
         mux := mux+1;
93
         mux_u <= "0111";   
94
      Sieben_segment_Ausgang(0) <= not dps(3); --Dezimalpunkt
95
       elsif mux = 1 then
96
         Sig_u <= AN2;
97
         mux := mux+1;
98
         mux_u <= "1011";
99
      Sieben_segment_Ausgang(0) <= not dps(2); --Dezimalpunkt
100
       elsif mux = 2 then
101
         Sig_u <= AN1;
102
         mux := mux+1;
103
         mux_u <= "1101";
104
      Sieben_segment_Ausgang(0) <= not dps(1); --Dezimalpunkt
105
       elsif mux = 3 then
106
         Sig_u <= AN0;
107
         mux := 0;
108
         mux_u <= "1110";   
109
      Sieben_segment_Ausgang(0) <= not dps(0); --Dezimalpunkt    
110
       end if;
111
     end if;
112
   end process;
113
   
114
end  verhalten;

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren