: Hallo, : ich habe ein paar Einstiegsprobleme mit VHDL. : Wie kann ich zum Beispiel in einem Halbaddierer meine vorher definierten und kompilierten Schaltkreise "and2" und "xor2" benutzen?: -- halbaddierer : -- ha: (a, b) --> (s1, s0) : USE work.all; : ENTITY halbaddierer IS : PORT (a, b: IN BIT; s1, s0: OUT BIT); : END halbaddierer; : ARCHITECTURE ha OF halbaddierer IS : COMPONENT and2 : PORT (a, b:IN BIT; s: OUT BIT); : END COMPONENT; : COMPONENT xor2 : PORT (a, b:IN BIT; s: OUT BIT); : END COMPONENT; : BEGIN : xor2_instance: work.xor2 PORT MAP (a, b, s0); : and2_instance: work.and2 PORT MAP (a, b, s1); : END ha; : CONFIGURATION config_ha OF halbaddierer IS : FOR ha : END FOR; : END config_ha; : ==> ERGIBT FEHLERMELDUNGEN; DASS "a" und "b" und "s" NICHT : ZU DESIGN FILE "and2" GEHÖREN, WELCHES SO AUSSIEHT:
: ENTITY and2 IS : PORT (a, b: IN BIT; s: OUT BIT); : END and2;
: ARCHITECTURE architecture_and2 OF and2 IS : BEGIN : s <= a AND b; : END architecture_and2; : CONFIGURATION config_and2 OF and2 IS : FOR architecture_and2 : END FOR; : END config_and2; : : Kann ich auch meine um Multiplikation erweiterte Recheneinheit als gdf abgeben, falls das nicht mit vhdl funktioniert?
********************************** Im "Notfall" ist auch eine GDF-Realisierung ok (bitte kennzeichnen). Allerdings sollte der VHDL-Rechner nicht auf Halb- und Volladdierer aufbauen, sondern "viel einfacher" realisert werden, wie etwa: -- Operation durchfuehren. CASE aktion IS WHEN 1 => RESULT <= A+B; WHEN 2 => RESULT <= A-B; WHEN 3 => RESULT <= A*B; WHEN 0 => RESULT <= 0; END CASE; Gruß Tobias
|