Spezielle Schaltnetze Spezielle Schaltnetze 22 Prof. Dr. Rainer Manthey Informatik II
Übersicht in diesem Abschnitt: : Vorstellung einiger wichtiger Bausteine vieler elektronischer Schaltungen, die sich aus mehreren Gattern zusammen- setzen ("spezielle Schaltnetze") und häufig benötigte Boolesche Funktionen realisieren zugehöriger Text bei Oberschelp/Vossen Vossen: : 2. - 2.3 Graphiken auf den folgenden Folien stammen weitgehend aus der zum Buch gehörenden Foliensammlung von Prof. Vossen in Münster im WWW (Copyright dieser Folien oder Folienteile bei W. Oberschelp/G.Vossen; zusätzliche Texte auf diesen Folien von R. Manthey) zunächst sowohl zum "Einüben" als auch im Vorgriff auf Addiernetze: Baustein für exklusives Oder (XOR-Funktion) dann: Multiplexer und Demultiplexer, Encoder und Decoder,, Halb- und Volladdierer 22 Prof. Dr. Rainer Manthey Informatik II 2
XOR () A B A XOR B x y x =^ x y alternatives Symbol für XOR-Funktion y 22 Prof. Dr. Rainer Manthey Informatik II 3
XOR (2) A B A XOR B x y x =^ x y y 22 Prof. Dr. Rainer Manthey Informatik II 4
XOR (3) A B A XOR B x y x =^ x y y 22 Prof. Dr. Rainer Manthey Informatik II 5
Multiplexer mit 2 Steuereingängen ("2-MUX") Multiplexer: Wählt einen der vier Dateneingänge x,.., x 3 aus und "schaltet ihn auf den Ausgang z durch". Steuerung erfolgt durch Setzen eines Steuereingang y oder y 2 (binär kodierter Index des jeweiligen Dateneingangs) z = x y y 2 + 2 x y y 2 + 2 x 2 y 2 y 2 + 2 x 3 y 3 y 2 2 22 Prof. Dr. Rainer Manthey Informatik II 6
Allgemeiner MUX-Aufbau 2 d Dateneingänge durchgeschalteter Dateneingang gemäß dem binärem Index an den Steuereingängen "zur Basis 2" d Steuereingänge 22 Prof. Dr. Rainer Manthey Informatik II 7
2-MUX: Prinzip 22 Prof. Dr. Rainer Manthey Informatik II 8
2-MUX: Prinzip (2) 22 Prof. Dr. Rainer Manthey Informatik II 9
2-MUX: Prinzip (3) 22 Prof. Dr. Rainer Manthey Informatik II
2-MUX: Prinzip (4) 22 Prof. Dr. Rainer Manthey Informatik II
Realisierung eines 2-MUX. Stufe: NOT 2. Stufe: AND 3. Stufe: OR z = x y y 2 + 2 x y y 2 + 2 x 2 y 2 y 2 + 2 x 3 y 3 y 2 2 22 Prof. Dr. Rainer Manthey Informatik II 2
Nachteile der direkten Realisierung für grössere Anzahl an Eingangsgrößen: Direkte Realisierung ist nicht empfehlenswert,, da die Anzahl der Eingangsleitungen ("Fan-In") auf 2. und 3. Stufe zu hoch ist. Alternative: Realisierung eines 2d-Multiplexers durch zweistufige Kopplung von 2 d + Exemplaren eines d-multiplexers Kosten K(n) eines n-mux gemäss dieser alternativen Realisierung (gemessen in Anzahl an AND-/OR-Gattern): K() = 3 K(2d) = (2 d + ) K(d) für d > K(n) = 3 (2 n - ) vollständige Induktion zum Vergleich: : Anzahl binäre Gatter bei direkter Realisierung K'(n) = 2 n (n+) - 22 Prof. Dr. Rainer Manthey Informatik II 3
Top-Down-Multiplexer-Entwurf 2d-Multiplexer realisiert durch Kopplung von 2 d + d-multiplexern 22 Prof. Dr. Rainer Manthey Informatik II 4
-MUX x ausgewählt 22 Prof. Dr. Rainer Manthey Informatik II 5
-MUX (2) x ausgewählt 22 Prof. Dr. Rainer Manthey Informatik II 6
-MUX (3) x ausgewählt 22 Prof. Dr. Rainer Manthey Informatik II 7
-MUX (4) x ausgewählt 22 Prof. Dr. Rainer Manthey Informatik II 8
-MUX (5) x ausgewählt 22 Prof. Dr. Rainer Manthey Informatik II 9
-MUX (6) x ausgewählt 22 Prof. Dr. Rainer Manthey Informatik II 2
-MUX (7) x ausgewählt 22 Prof. Dr. Rainer Manthey Informatik II 2
-MUX (8) x ausgewählt z = y x + y x 22 Prof. Dr. Rainer Manthey Informatik II 22
Systematische Konstruktion eines 2-MUX K(2) K(2) = 3 (2 (2 2 2 - - ) ) = 9 z = x y y 2 + 2 x y y 2 + 2 x 2 y 2 y 2 + 2 x 3 y 3 y 2 2 = y (y (y 2 x 2 + y 2 x 2 ) ) + y (y (y 2 x 2 2 + 2 y 2 x 2 3 ) 3 ) 22 Prof. Dr. Rainer Manthey Informatik II 23
noch mal zum Vergleich: 2-MUX bei direkter Realisierung Kosten, wenn nur binäre Gatter verwendet würden: K'(2) = 2 2 2 (2 (2 + ) ) - - = 22 Prof. Dr. Rainer Manthey Informatik II 24
Kostenvergleich: numerisch n K(n) = 3 (2 n - ) K'(n) = 2 n (n+) - 2 9 4 45 79 8 765 233 6 9665 494......... bei grösseren n: erhebliche Einsparung bei den "Gatterkosten" Gatterkosten" " durch zweistufige MUX-Architektur 22 Prof. Dr. Rainer Manthey Informatik II 25
MUX zur Realisierung Boolescher Funktionen Multiplexer sind "Universalbausteine", mit denen sich beliebige andere Boolesche Funktionen systematisch realisieren lassen; Minterme m m z.b.: m 2 m 3 m 4 m 5 m 6 m 7 22 Prof. Dr. Rainer Manthey Informatik II 26
Realisierung der Funktion 22 Prof. Dr. Rainer Manthey Informatik II 27
Realisierung der Funktion 22 Prof. Dr. Rainer Manthey Informatik II 28
Realisierung der Funktion 22 Prof. Dr. Rainer Manthey Informatik II 29
Realisierung der Funktion 22 Prof. Dr. Rainer Manthey Informatik II 3
Hardware-Lookup Alternative, die auf beliebige f anwendbar ist: Minterme m m m 2 m 3 m 4 m 5 m 6 m 7 22 Prof. Dr. Rainer Manthey Informatik II 3
-DeMUX Dateneingang Steuereingang De-Multiplexer: Dateneingang d Steuereingänge 2 d Ausgänge auf die der Daten- eingang durchge- schaltet wird die an den Steuer- eingängen binär adressiert werden 22 Prof. Dr. Rainer Manthey Informatik II 32
-DeMUX 22 Prof. Dr. Rainer Manthey Informatik II 33
-DeMUX 22 Prof. Dr. Rainer Manthey Informatik II 34
-DeMUX 22 Prof. Dr. Rainer Manthey Informatik II 35
Allgemeiner Aufbau eines DeMUX 22 Prof. Dr. Rainer Manthey Informatik II 36
2-DeMUX wird durch "Setzen" des Dateneingangs zum... 22 Prof. Dr. Rainer Manthey Informatik II 37
2 x 4-Decoder... 2 x 4 - Decoder 22 Prof. Dr. Rainer Manthey Informatik II 38
2 x 4-Decoder binäre : Binärzahl an an den den Eingängen wird wird durch Ansteuern des des zugehörigen Ausgangs (dezimaler Index) "dekodiert". 22 Prof. Dr. Rainer Manthey Informatik II 39
2 x 4-Decoder binäre : 22 Prof. Dr. Rainer Manthey Informatik II 4
2 x 4-Decoder binäre 2: 22 Prof. Dr. Rainer Manthey Informatik II 4
2 x 4-Decoder binäre 3: spielt wichtige Rolle beim Umsetzen von Adressen vor Speicherzugriffen 22 Prof. Dr. Rainer Manthey Informatik II 42
4 x 2-Encoder Index des des angesteuerten Eingangs wird wird binär am am Ausgang kodiert binäre : 22 Prof. Dr. Rainer Manthey Informatik II 43
4 x 2-Encoder binäre : 22 Prof. Dr. Rainer Manthey Informatik II 44
4 x 2-Encoder binäre 2: 22 Prof. Dr. Rainer Manthey Informatik II 45
4 x 2-Encoder binäre 3: 22 Prof. Dr. Rainer Manthey Informatik II 46
Addiernetze letztes Thema dieses Abschnitts: Schaltnetze zur Addition von Binärzahlen bilden Grundlage aller arithmetischen Operationen auf Rechnern ausführlichere Behandlung des Themas folgt noch im Zusammenhang mit Zahldarstellung und Rechnerarithmetik binäre Addition einstellig: A B Übertrag Resultat dezimal: 2 A AND B A XOR B 22 Prof. Dr. Rainer Manthey Informatik II 47
Halbaddierer Schaltnetz für einstellige binäre Addition mit Übertrag: Halbaddierer x y XOR AND Resultat R U Übertrag 22 Prof. Dr. Rainer Manthey Informatik II 48
Volladdierer y x u Übertrag aus aus einer vorherigen Addition HA einstelliger Binäraddierer, der zu einem mehrstelligen Addierer erweiterbar ist: R Volladdierer U U 2 U HA 2 R 2 R U = U OR OR U 2 2 U = x AND y U 2 = 2 R AND u R = x XOR y R = R 2 2 R 2 = 2 R XOR u 22 Prof. Dr. Rainer Manthey Informatik II 49
Volladdierer: Funktionsweise. Halbaddierer H : x y Ü R Übertrag aus der vorigen Stelle ("carry in") 2. Halbaddierer H 2 : OR-Gatter: R u Ü 2 R 2 XOR XOR auch auch hier hier möglich, da da Input Input (,) (,) nie nie auftritt auftritt!! R 22 Prof. Dr. Rainer Manthey Informatik II 5
Addiernetz für zwei 4-stellige Dualzahlen "(durch)rieseln" "(über)tragen" A 4 22 Prof. Dr. Rainer Manthey Informatik II 5
n-stelliges Addiernetz Aufbau von Addiernetzen für höhere Stelligkeiten (hier z.b. 32 Bit) durch Hintereinanderschalten von 4-Bit-Ripple Ripple-Carry-Addierern: wie A 4, aber nur aus Volladdierern aufgebaut aufgebaut offensichtlicher Nachteil bei bei grossen n: n: Zeit Zeit für für das das Durchlaufen ("ripple" der der Überträge wird wird immer grösser 22 Prof. Dr. Rainer Manthey Informatik II 52
Carry-Bypass-Addiernetz Ausweg: separates Schaltnetz für Übertragsbehandlung zur Vermeidung des "Ripple"-Effekts Carry-Bypass-Addierer 22 Prof. Dr. Rainer Manthey Informatik II 53
Addiernetze: generelle Problematik diverse weitere Ideen für Effizienzsteigerung bei Addiernetzen (s. Oberschelp/Vossen Vossen) generelles Problem grösserer Schaltnetze deutlich erkennbar: Laufzeiten werden relevant Notwendigkeit der Zwischenspeicherung von Resultaten Notwendigkeit der Synchronisation verschiedener Teil- netze durch Anlegen eines Taktsignals für das Gesamtnetz daher im nächsten Kapitel: Schaltnetze mit Speicherelementen und Taktung Schaltwerke 22 Prof. Dr. Rainer Manthey Informatik II 54
Schaltnetze als Speicher? Ist Ist es es möglich, ein ein Schaltnetz als als Speicher zu zu verwenden? S Q RS-Flipflop R Q unzulässig! R S Q unverändert set (S) reset (R) 22 Prof. Dr. Rainer Manthey Informatik II 55