Skip to content

Commit 887006e

Browse files
committed
Topological sort and PERT
1 parent 9482317 commit 887006e

File tree

5 files changed

+91
-1
lines changed

5 files changed

+91
-1
lines changed

ECE27000/ECE27000.pdf

-125 Bytes
Binary file not shown.

ECE27000/midterm2.pdf

-90 Bytes
Binary file not shown.

ECE27000/midterm3.tex

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
\documentclass[8pt]{article}
2+
\usepackage{amssymb}
3+
\usepackage{hyperref}
4+
\usepackage{pgfplots}
5+
\usepackage{placeins}
6+
\usepackage{array}
7+
\usepackage{tikz}
8+
\usepackage{circuitikz}
9+
\usetikzlibrary{circuits.logic.US, circuits.ee.IEC, positioning}
10+
\usepackage{amsmath}
11+
\usepackage{graphicx}
12+
\usepackage[T1]{fontenc}
13+
\usepackage[utf8]{inputenc}
14+
\usepackage{listings}
15+
\usepackage{xcolor}
16+
\usepackage{geometry}
17+
\input{kvmacros.tex}
18+
\geometry{margin=0.4in}
19+
20+
\lstdefinelanguage{SystemVerilog}{
21+
morekeywords={module, endmodule, logic, bit, int, enum, struct,
22+
always_ff, always_comb, initial, final, interface, modport, property,
23+
assert, class, rand, constraint, generate, endgenerate, if, else, begin, end},
24+
sensitive=true,
25+
morecomment=[l]{//},
26+
morecomment=[s]{/*}{*/},
27+
morestring=[b]",
28+
}
29+
30+
\lstset{
31+
language=SystemVerilog,
32+
basicstyle=\ttfamily\footnotesize,
33+
keywordstyle=\color{blue}\bfseries,
34+
commentstyle=\color{gray}\itshape,
35+
stringstyle=\color{red},
36+
frame=single,
37+
breaklines=true,
38+
postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space},
39+
}
40+
41+
\begin{document}
42+
43+
\begin{itemize}
44+
\item Setup time $t_{setup}$: time before clock edge that data must be
45+
stable.
46+
\item Hold time $t_{hold}$: time after clock edge that data must be stable.
47+
\item Propagation delay $t_{pcq}$: time after clock edge that output
48+
is guaranteed to be stable.
49+
\item Contamination delay $t_{ccq}$: time after clock edge that output
50+
might be unstable.
51+
\end{itemize}
52+
53+
\begin{align}
54+
T_{clk} \geq t_{pcq} + t_{pd} + t_{setup} & \text{Setup Time Constraint} \\
55+
t_{hold} < t_{ccq} + t_{cd} & \text{Hold Time Constraint}
56+
\end{align}
57+
\end{document}

ECE36800/ECE36800.pdf

4.89 KB
Binary file not shown.

ECE36800/chapters/graphs.tex

+34-1
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,37 @@ \subsection{Shortest Path Algorithms}
209209
\end{lstlisting}
210210
Bellman-Ford can be optimized to stop early once the optimal paths have
211211
been reached. If there is no change after two iterations in a row, then
212-
the best solution has been found and the algorithm can terminate early.
212+
the best solution has been found and the algorithm can terminate early.
213+
214+
Given a directed acyclic graph (DAG), finding the shortest path is as
215+
easy as following these steps:
216+
\marginnote{A topological sort of an acyclic directed graph is an ordering of its
217+
vertices such that for every directed edge $<u,v>$ from vertex $u$ to
218+
vertex $v$, $u$ comes before $v$ in the ordering. Both depth-first and
219+
breadth-first sorting works.}
220+
\begin{lstlisting}[label={DAG Shortest Path Algorithm}]
221+
DAG-Shortest-Paths(G, w, s) // s: source
222+
Topologically sort V[G]
223+
for each node u in V[G]
224+
d[u] <- INFTY; pred[u] <- NULL
225+
d[s] <- 0
226+
for each node u in topological order
227+
for each v in adj[u]
228+
if (d[v] > d[u] + w<u,v>)
229+
d[v] <- d[u] + w<u,v>
230+
pred[v] <- u
231+
\end{lstlisting}
232+
233+
Finding the longest path is as easy as initializing distances to negative infinity
234+
and changing the $>$ to a $<$.
235+
\marginnote{In general, finding the longest path is an NP hard problem. DAGs are
236+
a special case.}
237+
238+
239+
\subsection{PERT Diagrams}
240+
Project Evaluation and Review Technique (PERT) diagrams are represented as graphs.
241+
Each project has a number of tasks, each with duration D.
242+
Each task is a node in the graph. An edge $<i, j>$ represents that the task $j$ is a
243+
successor of task $i$ and cannot begin until task $i$ is completed. A critical path
244+
is one where each task is critical. A critical task is one that if its completion is
245+
delayed, project completion is delayed.

0 commit comments

Comments
 (0)