Skip to content

Commit 8c2cd85

Browse files
committed
Add comments for counter simulation
1 parent 7bef21b commit 8c2cd85

1 file changed

Lines changed: 92 additions & 46 deletions

File tree

08_StandardSchaltwerke.md

Lines changed: 92 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,24 @@ style="width: 80%; min-width: 420px; max-width: 720px;"
8181

8282
## Übungsbeispiel
8383

84+
{{0-1}}
85+
*******************************************************************************
86+
8487
Wir wollen eine Ampelanlage entwerfen, die durch einen Eingang $E$ getrieben wird, wobei der Wechsel zwischen den Zuständen von E eine Änderung der Ampelphase bewirkt. Die Umsetzung erfolgt als Moore-Automat.
8588

8689
<!--
8790
style="width: 80%; min-width: 420px; max-width: 720px;"
8891
-->
8992
```ascii
9093
^
91-
| --+--------+-----------+-----------+--------+--
92-
Phase | | Rot | Rot-Gelb | Grün | Gelb |
93-
| --+--------+-----------+-----------+--------+--
94+
| --+--------+----------------+-----------+--------+--
95+
Phase | | Rot | Rot-Gelb | Grün | Gelb |
96+
| --+--------+----------------+-----------+--------+--
9497
|
95-
| +--------+ +-----------+
96-
E | | | | |
97-
|---+ +-----------+ +---------
98-
+---------------------------------------------+ .
98+
| +--------+ +-----------+
99+
E | | | | |
100+
|---+ +----------------+ +---------
101+
+--------------------------------------------------+ .
99102
```
100103

101104
**1. Schritt: Aufstellen des Automatenmodels**
@@ -126,6 +129,10 @@ digraph finite_state_machine {
126129
```
127130
@plantUML
128131

132+
*******************************************************************************
133+
134+
{{0-3}}
135+
*******************************************************************************
129136
**2. Schritt: Erstellen der Zustandstabelle**
130137

131138
| Vorhergehender Zustand | Eingabe $E$ | Nachfolgezustand |
@@ -139,6 +146,12 @@ digraph finite_state_machine {
139146
| Gelb | 0 | Gelb |
140147
| Gelb | 1 | Rot |
141148

149+
150+
*******************************************************************************
151+
152+
{{1-3}}
153+
*******************************************************************************
154+
142155
**Schritt 3: Auswahl einer binären Zustandskodierung und Generierung einer binären Zustandstabelle**
143156

144157
| Zustand | G | F |
@@ -148,16 +161,25 @@ digraph finite_state_machine {
148161
| Grün | 1 | 0 |
149162
| Gelb | 1 | 1 |
150163

151-
| G | F | E | G' | F' | |
152-
| --- | --- | --- | --- | --- | --- |
153-
| | | 0 | | | |
154-
| | | 1 | | | |
155-
| | | 0 | | | |
156-
| | | 1 | | | |
157-
| | | 0 | | | |
158-
| | | 1 | | | |
159-
| | | 0 | | | |
160-
| | | 1 | | | |
164+
> **Aufgabe:** Ergänzen Sie die Zustandsübergangstabelle!
165+
166+
| G | F | E | G' | F' |
167+
| --- | --- | --- | --- | --- |
168+
| | | 0 | | |
169+
| | | 1 | | |
170+
| | | 0 | | |
171+
| | | 1 | | |
172+
| | | 0 | | |
173+
| | | 1 | | |
174+
| | | 0 | | |
175+
| | | 1 | | |
176+
177+
*******************************************************************************
178+
179+
{{2-3}}
180+
*******************************************************************************
181+
182+
Lösung:
161183

162184
| Vorhergehender Zustand | G | F | Eingabe $E$ | Nachfolgezustand | G' | F' |
163185
| ---------------------- | --- | --- | ----------- | ---------------- | --- | --- |
@@ -170,14 +192,10 @@ digraph finite_state_machine {
170192
| Gelb | 1 | 1 | 0 | Gelb | 1 | 1 |
171193
| Gelb | 1 | 1 | 1 | Rot | 0 | 0 |
172194

173-
Die Ansteuerung der drei Ausgabeleitungen R, Gr, Ge ergibt sich aus den Zuständen:
195+
*******************************************************************************
174196

175-
| Zustand | G | F | @gray($R$) | @gray($Gr$) | @gray($Ge$) |
176-
| ------- | --- | --- | ---------- | ----------- | ----------- |
177-
| Rot | 0 | 0 | @gray($1$) | @gray($0$) | @gray($0$) |
178-
| RotGelb | 0 | 1 | @gray($1$) | @gray($0$) | @gray($1$) |
179-
| Grün | 1 | 0 | @gray($0$) | @gray($1$) | @gray($0$) |
180-
| Gelb | 1 | 1 | @gray($0$) | @gray($0$) | @gray($1$) |
197+
{{3-5}}
198+
*******************************************************************************
181199

182200
**Schritt 4: Auswahl eines Flip-Flop Typs und Ermittlung der für jeden Zustandsübergang benötigten Flip-Flop Ansteuerungen**
183201

@@ -203,6 +221,14 @@ Schauen wir zunächst auf den Flip-Flop G, dessen Eingangsbelegung muss also auf
203221
| @blue(1) | 1 | 0 | @blue(1) | 1 | @gray(d) | @gray(0) | | |
204222
| @blue(1) | 1 | 1 | @blue(0) | 0 | @gray(d) | @gray(1) | | |
205223

224+
> **Aufgabe:** Ergänzen Sie die Einträge für $JF$ und $KF$!
225+
226+
*******************************************************************************
227+
228+
{{4-5}}
229+
*******************************************************************************
230+
231+
206232
| G | @blue(F) | E | G' | @blue(F') | JG | KG | @gray(JF) | @gray(KF) |
207233
| --- | -------- | --- | --- | --------- | --- | --- | --------- | --------- |
208234
| 0 | @blue(0) | 0 | 0 | @blue(1) | 0 | d | @gray(1) | @gray(d) |
@@ -214,6 +240,11 @@ Schauen wir zunächst auf den Flip-Flop G, dessen Eingangsbelegung muss also auf
214240
| 1 | @blue(1) | 0 | 1 | @blue(1) | d | 0 | @gray(d) | @gray(0) |
215241
| 1 | @blue(1) | 1 | 0 | @blue(0) | d | 1 | @gray(d) | @gray(1) |
216242

243+
*******************************************************************************
244+
245+
{{5-7}}
246+
*******************************************************************************
247+
217248
**Minimieren der Schaltung**
218249

219250
| G | F | E | JG | KG | JF | KF |
@@ -244,43 +275,54 @@ KG GF GF GF GF KF GF GF GF GF
244275
_ +----+----+----+----+ _ +----+----+----+----+
245276
E | d | d | | | E | d | | | d |
246277
+----+----+----+----+ +----+----+----+----+
247-
E | d | d | 1 | | E | d | 1 | | d |
278+
E | d | d | 1 | | E | d | 1 | 1 | d |
248279
+----+----+----+----+ +----+----+----+----+ .
249280
```
250281

282+
283+
> **Aufgabe:** Lesen Sie die minimierten Funktionen für die Flip-Flop-Eingänge ab!
284+
285+
*******************************************************************************
286+
287+
{{6-7}}
288+
*******************************************************************************
289+
251290
Damit lassen sich folgende Funktionen ablesen:
252291

253-
<table cellpadding="10">
254-
<tr>
255-
<td>
256-
Eingabelogik
257-
</td>
258-
<td>
259-
Ausgabelogik
260-
</td>
261-
</tr>
262-
<tr>
263-
<td>
264292
$$
265293
\begin{aligned}
266294
JG &= FE \\
267295
KG &= FE \\
268296
JF &= \overline{E} \\
269-
KF &= \overline{G}E \\
297+
KF &= E \\
270298
\end{aligned}
271299
$$
272-
</td>
273-
<td >
300+
301+
*******************************************************************************
302+
303+
{{7-8}}
304+
*******************************************************************************
305+
306+
**Ausgabelogik**
307+
308+
Die Ansteuerung der drei Ausgabeleitungen R, Gr, Ge ergibt sich aus den Zuständen:
309+
310+
| Zustand | G | F | @gray($R$) | @gray($Gr$) | @gray($Ge$) |
311+
| ------- | --- | --- | ---------- | ----------- | ----------- |
312+
| Rot | 0 | 0 | @gray($1$) | @gray($0$) | @gray($0$) |
313+
| RotGelb | 0 | 1 | @gray($1$) | @gray($0$) | @gray($1$) |
314+
| Grün | 1 | 0 | @gray($0$) | @gray($1$) | @gray($0$) |
315+
| Gelb | 1 | 1 | @gray($0$) | @gray($0$) | @gray($1$) |
316+
274317
$$
275318
\begin{aligned}
276319
R &= \overline{G} \\
277320
Gr &= G\overline{F} \\
278321
Ge &= F
279322
\end{aligned}
280323
$$
281-
</td>
282-
</tr>
283-
</table>
324+
325+
*******************************************************************************
284326

285327
## Register
286328

@@ -416,7 +458,7 @@ An dieser Stelle sei noch einmal auf die Erläuterungen zum Schieberegister aus
416458

417459
Eine sequentielle Schaltung, die Eingangsimpulse auf Zustände abbildet nennt man Zähler. Mit ihnen lassen sich zeitlich aufeinander folgende Ereignisse registrieren aber auch erzeugen.
418460

419-
+ **Synchron vs. asynchron** In einem synchronen Zähler sind alle Zähler-Speicher durch eine Taktleitung getriggert. Der Zustandwechsel wird immer zugleich vollzogen. Asynchrone Zähler heben diese Trennung auf und erlauben eine vereinfachte Umsetzung. Allerdings ist die Gültigkeit der Ergebnisse dann von dem Laufzeitverhalten der Komponenten abhängig.
461+
+ **Synchron vs. asynchron** In einem synchronen Zähler sind alle Zähler-Speicher durch eine Taktleitung getriggert. Der Zustandswechsel wird immer zugleich vollzogen. Asynchrone Zähler heben diese Trennung auf und erlauben eine vereinfachte Umsetzung. Allerdings ist die Gültigkeit der Ergebnisse dann von dem Laufzeitverhalten der Komponenten abhängig.
420462

421463
![Bild](./images/05_FlipFlops/AsynchronerBinaerZaehler.png)<!-- style="width: 80%; max-width: 800px;" -->
422464

@@ -457,8 +499,6 @@ digraph finite_state_machine {
457499

458500
Offenbar sind 4 Zustände notwendig, um die Zahlen von 0-15 abbilden zu können. Die Zustandsübergangstabelle ergibt sich folglich zu.
459501

460-
461-
q3 q2 q1 q0
462502
| F | G | H | I | F' | G' | H' | I' |
463503
| --- | --- | --- | --- | --- | --- | --- | --- |
464504
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
@@ -491,7 +531,9 @@ DI &= \overline{I} \\
491531
\end{aligned}
492532
$$
493533

494-
> Bitte hier die Simulation einfügen
534+
![Bild](./images/08_StandardSchaltwerke/Zaehler.svg.png)<!-- style="width: 90%; max-width: 800px;" -->
535+
536+
Das nachfolgende Beispiel realisiert eine alternative Umsetzung und integriert zu Demonstrationszwecken einen Reset-Kanal. Aktivieren Sie zunächst die Clock-Leitung einmal. Für den Zählmechanismus muss dann $\overline{RESET}$ gesetzt sein.
495537

496538
```json @DigiSim.evalJson
497539
{"devices":{"and5":{"label":"anew and ~reset","type":"And","propagation":1,"bits":1,"position":{"x":355,"y":5}},"and6":{"label":"bnew and ~reset","type":"And","propagation":1,"bits":1,"position":{"x":355,"y":80}},"and7":{"label":"cnew and ~reset","type":"And","propagation":1,"bits":1,"position":{"x":355,"y":145}},"and8":{"label":"dnew and ~reset","type":"And","propagation":1,"bits":1,"position":{"x":355,"y":215}},"resetButton":{"label":"~reset","type":"Button","propagation":0,"position":{"x":25,"y":265}},"countButton":{"label":"count (dflip)","type":"Button","propagation":0,"position":{"x":-95,"y":245}},"clkButton":{"label":"clk","type":"Button","propagation":0,"position":{"x":195,"y":345}},"lampa":{"label":"a","type":"Lamp","propagation":1,"position":{"x":655,"y":5}},"lampb":{"label":"b","type":"Lamp","propagation":1,"position":{"x":655,"y":70}},"lampc":{"label":"c","type":"Lamp","propagation":1,"position":{"x":655,"y":140}},"lampd":{"label":"d","type":"Lamp","propagation":1,"position":{"x":655,"y":210}},"lampco":{"label":"carry out","type":"Lamp","propagation":1,"position":{"x":630,"y":-60}},"dffa":{"label":"dff a","type":"Dff","propagation":1,"polarity":{"clock":true},"bits":1,"initial":"x","position":{"x":505,"y":5}},"dffb":{"label":"dff b","type":"Dff","propagation":1,"polarity":{"clock":true},"bits":1,"initial":"x","position":{"x":505,"y":90}},"dffc":{"label":"dff c","type":"Dff","propagation":1,"polarity":{"clock":true},"bits":1,"initial":"x","position":{"x":505,"y":160}},"dffd":{"label":"dff d","type":"Dff","propagation":1,"polarity":{"clock":true},"bits":1,"initial":"x","position":{"x":510,"y":235}},"and1":{"label":"aflip and a (carryOut)","type":"And","propagation":1,"bits":1,"position":{"x":135,"y":-65}},"and2":{"label":"bflip and b (aflip)","type":"And","propagation":1,"bits":1,"position":{"x":60,"y":0}},"and3":{"label":"cflip and c (bflip)","type":"And","propagation":1,"bits":1,"position":{"x":35,"y":80}},"and4":{"label":"dflip and d (cflip)","type":"And","propagation":1,"bits":1,"position":{"x":-30,"y":150}},"xor1":{"label":"a xor aflip","type":"Xor","propagation":1,"bits":1,"position":{"x":210,"y":5}},"xor2":{"label":"b xor bflip","type":"Xor","propagation":1,"bits":1,"position":{"x":215,"y":70}},"xor3":{"label":"c xor cflip","type":"Xor","propagation":1,"bits":1,"position":{"x":210,"y":130}},"xor4":{"label":"d xor dflip","type":"Xor","propagation":1,"bits":1,"position":{"x":210,"y":200}}},"connectors":[{"from":{"id":"countButton","port":"out"},"to":{"id":"xor4","port":"in2"}},{"from":{"id":"countButton","port":"out"},"to":{"id":"and4","port":"in1"},"vertices":[{"x":-80,"y":190}]},{"from":{"id":"and3","port":"out"},"to":{"id":"and2","port":"in1"},"vertices":[{"x":25,"y":65},{"x":5,"y":65}]},{"from":{"id":"and4","port":"out"},"to":{"id":"and3","port":"in1"},"vertices":[{"x":-15,"y":125}]},{"from":{"id":"and4","port":"out"},"to":{"id":"xor3","port":"in2"}},{"from":{"id":"and3","port":"out"},"to":{"id":"xor2","port":"in2"}},{"from":{"id":"and2","port":"out"},"to":{"id":"xor1","port":"in2"}},{"from":{"id":"dffa","port":"out"},"to":{"id":"xor1","port":"in1"},"vertices":[{"x":315,"y":-5}]},{"from":{"id":"and2","port":"out"},"to":{"id":"and1","port":"in1"},"vertices":[{"x":95,"y":-10}]},{"from":{"id":"and1","port":"out"},"to":{"id":"lampco","port":"in"}},{"from":{"id":"clkButton","port":"out"},"to":{"id":"dffd","port":"clk"},"vertices":[{"x":435,"y":360}]},{"from":{"id":"clkButton","port":"out"},"to":{"id":"dffc","port":"clk"},"vertices":[{"x":435,"y":360}]},{"from":{"id":"clkButton","port":"out"},"to":{"id":"dffb","port":"clk"},"vertices":[{"x":455,"y":340}]},{"from":{"id":"clkButton","port":"out"},"to":{"id":"dffa","port":"clk"}},{"from":{"id":"and8","port":"out"},"to":{"id":"dffd","port":"in"}},{"from":{"id":"xor1","port":"out"},"to":{"id":"and5","port":"in1"}},{"from":{"id":"xor2","port":"out"},"to":{"id":"and6","port":"in1"}},{"from":{"id":"xor3","port":"out"},"to":{"id":"and7","port":"in1"}},{"from":{"id":"xor4","port":"out"},"to":{"id":"and8","port":"in1"}},{"from":{"id":"and7","port":"out"},"to":{"id":"dffc","port":"in"}},{"from":{"id":"and6","port":"out"},"to":{"id":"dffb","port":"in"}},{"from":{"id":"and5","port":"out"},"to":{"id":"dffa","port":"in"}},{"from":{"id":"resetButton","port":"out"},"to":{"id":"and8","port":"in2"}},{"from":{"id":"resetButton","port":"out"},"to":{"id":"and7","port":"in2"},"vertices":[{"x":305,"y":255}]},{"from":{"id":"resetButton","port":"out"},"to":{"id":"and6","port":"in2"},"vertices":[{"x":305,"y":255}]},{"from":{"id":"resetButton","port":"out"},"to":{"id":"and5","port":"in2"},"vertices":[{"x":305,"y":255}]},{"from":{"id":"dffd","port":"out"},"to":{"id":"lampd","port":"in"}},{"from":{"id":"dffc","port":"out"},"to":{"id":"lampc","port":"in"}},{"from":{"id":"dffb","port":"out"},"to":{"id":"lampb","port":"in"}},{"from":{"id":"dffa","port":"out"},"to":{"id":"lampa","port":"in"}},{"from":{"id":"dffd","port":"out"},"to":{"id":"xor4","port":"in1"},"vertices":[{"x":310,"y":210},{"x":190,"y":185}]},{"from":{"id":"dffd","port":"out"},"to":{"id":"and4","port":"in2"},"vertices":[{"x":185,"y":180},{"x":15,"y":200}]},{"from":{"id":"dffc","port":"out"},"to":{"id":"xor3","port":"in1"},"vertices":[{"x":545,"y":140},{"x":285,"y":110}]},{"from":{"id":"dffc","port":"out"},"to":{"id":"and3","port":"in2"},"vertices":[{"x":545,"y":140},{"x":285,"y":110},{"x":130,"y":130}]},{"from":{"id":"dffb","port":"out"},"to":{"id":"and2","port":"in2"},"vertices":[{"x":340,"y":60}]},{"from":{"id":"dffb","port":"out"},"to":{"id":"xor2","port":"in1"},"vertices":[{"x":510,"y":60}]},{"from":{"id":"dffa","port":"out"},"to":{"id":"and1","port":"in2"},"vertices":[{"x":310,"y":-5}]}],"subcircuits":{}}
@@ -500,3 +542,7 @@ $$
500542
## Übungsaufgaben
501543

502544
+ Entwerfen Sie einen Zähler, der eine Zählrichtungsvorgabe ermöglicht und evaluieren Sie Ihre Lösung mit einem Simulator.
545+
546+
[logisim-evolution](https://github.com/reds-heig/logisim-evolution)
547+
548+
+ Implementieren Sie einen Logik-Analysator für eine gegebene Schaltung. Dieser testet die Zustände systematisch ab und generiert daraus eine Tabelle.

0 commit comments

Comments
 (0)