Commit c0fccc1e authored by Jules Saget's avatar Jules Saget
Browse files

Add begining of stately subsec

parent 02b19106
......@@ -120,7 +120,7 @@ I was able to meet Carl Seger and Jeremy Pope at the begining of the
internship.
I worked at Chalmers for two weeks before it closed.
From that point, I worked from my appartment in Sweden.
From that point on, I worked from my appartment in Sweden.
I had a meeting with Carl Seger and Jeremy Pope every week and a meeting with
the rest of the Octopi team every two weeks.
......@@ -285,8 +285,8 @@ on why we decided to go with it in the first place.
A common function among many IoT programs is to filter input data
and compare the resulting value against some threshold.
For example, consider a climate control IoT that should allow the user to
set the desired temperature to anything between -30 and +30 degrees centigrades
on their smartphone.
set the desired temperature to anything between -30°C and +30°C on their
smartphone.
The IoT device takes a temperature reading every minute.
In order to smooth out transient readings, the program averages the
last four readings.
......@@ -299,18 +299,18 @@ Suppose now that the initial design has a heater that
can change the temperature in the room by at most one degree per minute
and that all computations are performed with 8 bits 2's complement arithmetic.
With some effort, it is not too difficult to show that this IoT controlled
system will guarantee that the temperature never go above 33 degrees.
system will guarantee that the temperature never go above 33°C.
Suppose now that the heater is replaced with a more efficient one that
can raise the temperature 3 degrees per minute.
can raise the temperature 3°C per minute.
Now the system can fail disastrously.
To see this, consider the situation in which the system is turned on
set to 30 degrees in a room that already is 30 degrees.
The heater will turn on and after one minute the room will be at 33 degrees.
set to 30°C in a room that already is 30°C.
The heater will turn on and after one minute the room will be at 33°C.
However, the average will still be 30 (remember we are using integer
arithmetic) and thus the heater will remian on.
After two minutes, the temperature in the room will be 36 degrees and
now we encounter a problem.
arithmetic) and thus the heater will remain on.
After two minutes, the temperature in the room will be 36°C and now we
encounter a problem.
The summation in the average computation will overflow!
As a result, the average will be -32 and thus the heater will stay on;
likely burn out the system or possibly even igniting a fire!
......@@ -401,11 +401,58 @@ deletes redundant trailing chunks if needed.
\subsubsection{stately}
When designing hardware, it is useful to rely on finite state machines (FSMs)
to describe the different states a circuit will go through.
FSMs are in fact finite automata that read inputs from the rest of the circuit
and output a state name.
To showcase a concrete example, imagine some module wants to read data from
memory.
The process is the following:
\begin{enumerate}
\item[IDLE] At the begining, the reading module does nothing until prompted
by another module to do something.
\item[REQ] Emit a request signal to the memory, providing all useful
informations (namely the address to be read).
The memory could be busy, so we have to wait until it tells us it has
completed the operation.
\item[ACK] At some point, our module will receive an acknowledgement from
memory: this means that the memory is sending us the data we asked for.
By convention, the memory will keep sending us this data until we lower our
request flag.
In our case, what we (likely) want to do is to store the data from memory
in a register.
\item[DONE] When we are done with the data, we lower our request flag.
However, memory may not be ready to receive another request: we need to
wait for memory to lower its acknowledgement flag.
When it is done, we can go back to IDLE mode and tell the calling module
that the reading task has been completed.
\end{enumerate}
As you can see, this process is clearly divided into four steps with a clear
condition to go from one step to another: this process can be represented by a
FSM.
Such a FSM is shown on figure \ref{fig:4ph}.
For more details on 4 phase handshake protocols, see \cite{category}.
\begin{figure}[t]
\centering
\includegraphics{figures/4ph.pdf}
\caption{Simple FSM implementing four-phase handshake}
\label{fig:4ph}
\end{figure}
\section{Designing the arithmetical unit}
\label{sec:alu}
\subsection{General structure}
\subsection{Logcial unit}
\subsection{Comparator unit}
\subsection{Addition Unit}
\subsubsection{Subtraction}
......@@ -417,7 +464,7 @@ deletes redundant trailing chunks if needed.
\subsection{Cleaning Unit}
\nocite{*}
%\nocite{*}
\printbibliography[heading=bibintoc]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment