@jutge.org/toolkit 4.2.34 → 4.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/problems/circuits/full_adder.pbm/README.md +10 -0
- package/assets/problems/circuits/full_adder.pbm/code.v +3 -0
- package/assets/problems/circuits/full_adder.pbm/handler.yml +1 -0
- package/assets/problems/circuits/full_adder.pbm/problem.en.tex +26 -0
- package/assets/problems/circuits/full_adder.pbm/problem.en.yml +3 -0
- package/assets/problems/circuits/full_adder.pbm/solution.v +6 -0
- package/assets/problems/circuits/half_adder.pbm/README.md +10 -0
- package/assets/problems/circuits/half_adder.pbm/code.v +0 -0
- package/assets/problems/circuits/half_adder.pbm/handler.yml +1 -0
- package/assets/problems/circuits/half_adder.pbm/problem.en.tex +27 -0
- package/assets/problems/circuits/half_adder.pbm/problem.en.yml +3 -0
- package/assets/problems/circuits/half_adder.pbm/solution.v +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
handler: circuits
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
\Problem{Full adder}
|
|
2
|
+
%\UseVerilog
|
|
3
|
+
|
|
4
|
+
\Statement
|
|
5
|
+
Design a \textbf{full adder}. A full adder is a circuit that performs
|
|
6
|
+
a 1-bit addition receiving an input carry and generating an
|
|
7
|
+
output carry.
|
|
8
|
+
|
|
9
|
+
\Specification
|
|
10
|
+
\begin{verbatim}
|
|
11
|
+
module full_adder(a, b, cin, sum, cout);
|
|
12
|
+
input a, b, cin;
|
|
13
|
+
output sum, cout;
|
|
14
|
+
\end{verbatim}
|
|
15
|
+
|
|
16
|
+
\Input
|
|
17
|
+
\begin{itemize}
|
|
18
|
+
\item \lstinline|a| and \lstinline|b| are the two inputs.
|
|
19
|
+
\item \lstinline|cin| is the input carry.
|
|
20
|
+
\end{itemize}
|
|
21
|
+
|
|
22
|
+
\Output
|
|
23
|
+
\begin{itemize}
|
|
24
|
+
\item \lstinline|sum| is the sum of the two bits and the input carry.
|
|
25
|
+
\item \lstinline|cout| is the output carry.
|
|
26
|
+
\end{itemize}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
handler: circuits
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
\Problem{Half adder}
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
\Statement
|
|
5
|
+
Design a \textbf{half adder} that is a circuit that performs the addition of
|
|
6
|
+
two binary digits, \lstinline|a| and \lstinline|b|. It outputs the \lstinline|sum| and the output \lstinline|carry|.
|
|
7
|
+
|
|
8
|
+
\Specification
|
|
9
|
+
|
|
10
|
+
\begin{lstlisting}[language=verilog]
|
|
11
|
+
module halfadder(a, b, sum, carry);
|
|
12
|
+
input a, b;
|
|
13
|
+
output sum, carry;
|
|
14
|
+
\end{lstlisting}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
\Input
|
|
18
|
+
\begin{itemize}
|
|
19
|
+
\item \lstinline|a| and \lstinline|b| are the two input values.
|
|
20
|
+
\end{itemize}
|
|
21
|
+
|
|
22
|
+
\Output
|
|
23
|
+
\begin{itemize}
|
|
24
|
+
\item \lstinline|sum| is the least significant digit of $a + b$.
|
|
25
|
+
|
|
26
|
+
\item \lstinline|carry| is the output carry, i.e., the most significant digit of $a + b$.
|
|
27
|
+
\end{itemize}
|