Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Nächste Überarbeitung Beide Seiten der Revision | ||
introduction_to_digital_systems:sequential_logic [2022/01/10 15:00] tfischer [Exercises] |
introduction_to_digital_systems:sequential_logic [2023/02/04 12:44] mexleadmin [Bearbeiten - Panel] |
||
---|---|---|---|
Zeile 5: | Zeile 5: | ||
===== 6.1 First Terminology ===== | ===== 6.1 First Terminology ===== | ||
- | The most important term is the word **state** But what is a state? It is a unique situation, where the possible next steps (= possible next states), the inner behavior or the outputs are distinguishable from other situations. | + | The most important term for the upcoming topics |
Here some practical examples: | Here some practical examples: | ||
- | * being happy or being sad, are two different states, since the inner behavior is different (this least often also to a different output). Similarly, an empty memory (or harddrive) is in a different state compared to an compared to a full one. Even a fresh deleted one is distingisable, | + | * Being happy or being sad, are two different states, since the inner behavior is different (this least often also to a different output). |
- | * | + | * Similarly, an empty memory (or harddrive) is in a different state compared to a filled |
- | Sequential logic is used to describe logic cicruits which show internal states (" | + | * A traffic light showing green has a output distinguishable from red, or yellow. |
+ | Sequential logic is used to describe logic cicruits which show internal states (" | ||
The following terminology is used in the upcoming explanations: | The following terminology is used in the upcoming explanations: | ||
Zeile 21: | Zeile 22: | ||
The <imgref pic04> shows the different terms in an abstract diagram. The " | The <imgref pic04> shows the different terms in an abstract diagram. The " | ||
- | < | + | < |
The principle interior of the blackbox in <imgref pic04> was already shown in one practical application in the [[: | The principle interior of the blackbox in <imgref pic04> was already shown in one practical application in the [[: | ||
- | < | + | < |
<panel type=" | <panel type=" | ||
<imgref pic06> depicts a state machine. | <imgref pic06> depicts a state machine. | ||
- | * What happens, when $X$ is changed? On which edge the change is triggered? | + | * What happens, when $X$ is changed? |
* Write down how many components each vector $\vec{X}$ and $\vec{Y}$ has. | * Write down how many components each vector $\vec{X}$ and $\vec{Y}$ has. | ||
* How many bits (= flip flops) might the state vector $\vec{Z}$ need? | * How many bits (= flip flops) might the state vector $\vec{Z}$ need? | ||
Zeile 51: | Zeile 52: | ||
The first idea might be to use what we already have: an up-counter, which faciliate 2 flip-flops in order to result into 2-bit output. | The first idea might be to use what we already have: an up-counter, which faciliate 2 flip-flops in order to result into 2-bit output. | ||
- | The wanted new state machine needs 3 bits for the output, since the binary representation of our outputs are $%001$,$%010$,$%011$,$%100$. | + | The wanted new state machine needs 3 bits for the output, since the binary representation of our outputs are $001_2$,$010_2$,$011_2$,$100_2$. |
- | An simple idea is to take the 2-bit up-counter and add an combinatorial logic in behind. This logic shall convert the 2-bit up-counter output $%00$ into $%001$, the $%01$ into $%010$, $%10$ into $%011$ and $%11$ into $%101$. This can be logic can be created by: | + | An simple idea is to take the 2-bit up-counter and add an combinatorial logic in behind. This logic shall convert the 2-bit up-counter output $00_2$ into $001_2$, the $01_2$ into $010_2$, $10_2$ into $011_2$ and $11_2$ into $101_2$. This can be logic can be created by: |
* writing down the truth table | * writing down the truth table | ||
* putting the values into a Karnaugh map | * putting the values into a Karnaugh map | ||
Zeile 115: | Zeile 116: | ||
< | < | ||
- | {{url> | + | {{url> |
<WRAP column 100%> | <WRAP column 100%> | ||
Zeile 133: | Zeile 134: | ||
The <imgref pic101> shows the principle differences in the architecture of the state machines. | The <imgref pic101> shows the principle differences in the architecture of the state machines. | ||
- | < | + | < |
\\ \\ | \\ \\ | ||
Zeile 150: | Zeile 151: | ||
In <imgref pic01> image (1) the states of water are shown on the temperature axis. When only the state transistions are relevant, the states are simplified to a circle, showing the state name and behaviour. The transitions are depict as arrows, where the needed condititon is written onto (See <imgref pic01> image (2) ). This diagram is called **state transition diagram**. | In <imgref pic01> image (1) the states of water are shown on the temperature axis. When only the state transistions are relevant, the states are simplified to a circle, showing the state name and behaviour. The transitions are depict as arrows, where the needed condititon is written onto (See <imgref pic01> image (2) ). This diagram is called **state transition diagram**. | ||
- | < | + | < |
For matter not only the dimension " | For matter not only the dimension " | ||
By this, another variable is available and more transistions. These can be drawn into the state transition diagram (<imgref pic02> image (2)). | By this, another variable is available and more transistions. These can be drawn into the state transition diagram (<imgref pic02> image (2)). | ||
- | < | + | < |
==== 6.3.2 Simple logic Example ==== | ==== 6.3.2 Simple logic Example ==== | ||
Zeile 162: | Zeile 163: | ||
Once paid, the turnstile will release and one can enter. Once the turnstile was pushed the entrance is closed again. | Once paid, the turnstile will release and one can enter. Once the turnstile was pushed the entrance is closed again. | ||
- | < | + | < |
The <imgref pic04> the state transition diagram is drawn. | The <imgref pic04> the state transition diagram is drawn. | ||
Zeile 172: | Zeile 173: | ||
* A state transition diagram is not complete without a **legend** and without an **beginning/ | * A state transition diagram is not complete without a **legend** and without an **beginning/ | ||
- | < | + | < |
Out of this state transition diagram one can create a table-like representation, | Out of this state transition diagram one can create a table-like representation, | ||
- | < | + | < |
the inputs, outputs and states have to be encoded into binary, in order to investigate this table a bit more. How the binary value is connected to the outputs does not matter. We will choose the following coding: | the inputs, outputs and states have to be encoded into binary, in order to investigate this table a bit more. How the binary value is connected to the outputs does not matter. We will choose the following coding: | ||
Zeile 185: | Zeile 186: | ||
This table is shown in <imgref pic06a> and is called **state transition table**. | This table is shown in <imgref pic06a> and is called **state transition table**. | ||
- | < | + | < |
- | {{drawio> | + | {{drawio> |
Interestingly, | Interestingly, | ||
Zeile 195: | Zeile 196: | ||
In the previous sub-chapter (6.2) we had a look onto different implementations of an up counter and on this chapter the way to represent a state machine via a state transition diagram. So one question is: how does these up counter look like in the state transition diagram? | In the previous sub-chapter (6.2) we had a look onto different implementations of an up counter and on this chapter the way to represent a state machine via a state transition diagram. So one question is: how does these up counter look like in the state transition diagram? | ||
- | The Answer ist quite simple: there are 4 states, so 4 " | + | The Answer ist quite simple: there are 4 states, so 4 " |
With a deeper look onto is: This is therefore in particular a Medvedev machine! | With a deeper look onto is: This is therefore in particular a Medvedev machine! | ||
Zeile 203: | Zeile 204: | ||
< | < | ||
- | {{drawio> | + | {{drawio> |
<panel type=" | <panel type=" | ||
Zeile 222: | Zeile 223: | ||
< | < | ||
- | {{drawio> | + | {{drawio> |
+ | <wrap # | ||
<panel type=" | <panel type=" | ||
This exercise directly attached onto Exercise 6.3.3.2 | This exercise directly attached onto Exercise 6.3.3.2 | ||
Zeile 229: | Zeile 231: | ||
The counter shall now be changed in such a way, that it counts $1 - 2 - 3 - 4$. For this: right click on each present states beginning with state 0 and add for '' | The counter shall now be changed in such a way, that it counts $1 - 2 - 3 - 4$. For this: right click on each present states beginning with state 0 and add for '' | ||
- | {{drawio> | + | {{drawio> |
Tasks: | Tasks: | ||
Zeile 240: | Zeile 242: | ||
< | < | ||
- | {{drawio> | + | {{drawio> |
<panel type=" | <panel type=" | ||
Zeile 247: | Zeile 249: | ||
The last step is to add the transitions: | The last step is to add the transitions: | ||
- | {{drawio> | + | {{drawio> |
Tasks: | Tasks: | ||
Zeile 259: | Zeile 261: | ||
Use the following addition to the resulting citcuit in order to get the light running: | Use the following addition to the resulting citcuit in order to get the light running: | ||
- | {{drawio> | + | {{drawio> |
Tasks: | Tasks: | ||
Zeile 271: | Zeile 274: | ||
The following state transistion diagram shall be given: | The following state transistion diagram shall be given: | ||
- | {{drawio> | + | {{drawio> |
+ | |||
+ | |||
+ | * There are two transitions marked with $A$ and $B$. \\ What values does the inputs need to have in order show all transistions explicitely? | ||
+ | |||
+ | <WRAP indent>< | ||
+ | <button size=" | ||
+ | * Find the transitions wanted | ||
+ | * Look at which state these transitions starts. | ||
+ | * Which other transitions starts there? | ||
+ | * Which transition conditions are missing? | ||
+ | </ | ||
+ | * transition A | ||
+ | * Starts at state $000$ | ||
+ | * Also transition with $11$, $00$ starts here | ||
+ | * $01$, $10$ are missing | ||
+ | * transition B | ||
+ | * Starts at state $010$ | ||
+ | * Also transition with $0-$ starts here | ||
+ | * $1-$ are missing | ||
+ | </ | ||
+ | * A: $01$, $10$ | ||
+ | * B: $1-$ | ||
+ | </ | ||
+ | </ | ||
- | * There are two transitions marked with $A$ and $B$. What values does the inputs need to have in order show all transistions explicitely? | ||
* How many flipflops are necessary for such a Moore Machine? | * How many flipflops are necessary for such a Moore Machine? | ||
+ | |||
+ | <WRAP indent>< | ||
+ | <button size=" | ||
+ | Each flipflop can store one Bit. Each stored bit can be used to address states. So, check the number of bits $i$ of states $Z_i$ ("size of the state vector" | ||
+ | Be aware, that one bit can address maximum 2 states, two bits maximum 4 states, three bits maximum 8 states and so on. | ||
+ | </ | ||
+ | * Number of bits $i$ of states $Z_i$ is given in the legend. The number of bits $i$ has also to fit to the number of states. | ||
+ | * Here the legend give $Z_2, Z_1, Z_0$, so 3 bits. | ||
+ | * Also the number of states i the diagram are 5. This can only be numbered with at least 3 bits. | ||
+ | |||
+ | </ | ||
+ | 3 | ||
+ | </ | ||
+ | </ | ||
* Fill in the missing cells in the following state transition table: | * Fill in the missing cells in the following state transition table: | ||
- | {{drawio> | + | {{drawio> |
+ | |||
+ | |||
+ | <WRAP indent>< | ||
+ | <button size=" | ||
+ | {{drawio> | ||
+ | </ | ||
+ | {{drawio> | ||
+ | |||
+ | </ | ||
+ | {{drawio> | ||
+ | </ | ||
+ | </ | ||
</ | </ | ||
Zeile 305: | Zeile 358: | ||
Explicitely draw all possible transitions. | Explicitely draw all possible transitions. | ||
- | {{drawio> | + | {{drawio> |
</ | </ | ||
Zeile 314: | Zeile 367: | ||
Develop a sequential circuit, which creates the following output | Develop a sequential circuit, which creates the following output | ||
- | {{drawio> | + | {{drawio> |
* Draw the state transition diagram of the moore machine of the synchronous sequential circuit. | * Draw the state transition diagram of the moore machine of the synchronous sequential circuit. | ||
Zeile 326: | Zeile 380: | ||
Develop a sequential circuit, which allows driving the following LED sequence | Develop a sequential circuit, which allows driving the following LED sequence | ||
- | {{drawio> | + | {{drawio> |
* Draw the state transition diagram of the moore machine of the synchronous sequential circuit. | * Draw the state transition diagram of the moore machine of the synchronous sequential circuit. | ||
Zeile 336: | Zeile 390: | ||
<panel type=" | <panel type=" | ||
- | Develop a sequential circuit, which generate a clock driven up-counter from 1..6. The not reqired states shall lead after one clock cycle to the state of number 1 . | + | Develop a sequential circuit, which generate a clock driven up-counter from $1..6$. The not reqired states shall lead after one clock cycle to the state of number |
* Draw the state transition diagram of the moore machine of the synchronous sequential circuit. | * Draw the state transition diagram of the moore machine of the synchronous sequential circuit. |