\section{考察} \subsection{課題 1-1} この実験ではTC74HC08のANDゲートを使用した. ANDゲートは等価回路は\cref{fig:and-gate-equi}のようにスイッチが2つ直列に接続された回路で, 両方のスイッチが閉じた時のみ, Hレベルを出力する. \begin{figure}[H] \centering \begin{circuitikz} \ctikzset{switches/scale=1} \ctikzset{resistors/scale=1} \ctikzset{diodes/scale=1} \draw (0,0) node[vcc]{$V_{DD}$} to [normal open switch, l={$A$}] ++(2,0) to [normal open switch, l={$B$}] ++(2,0) coordinate (out) to [R] ++(2,0) node[ground]{}; \draw (out) to [short, *-o] ++(0,0.5) node[above]{Output}; \end{circuitikz} \caption{AND Gate Equivalent Circuit} \label{fig:and-gate-equi} \end{figure} このことから, \cref{tab:a1-1-res-tt}で示した結果は両方の入力がHレベルの時だけ出力がHレベルとなっているため, 理論と一致することが分かる. \subsection{課題 1-2} \Cref{tab:a1-2-res-tt}より, 全ての入力がHレベルの時のみ出力がLレベルとなっている. NANDゲートはANDゲートの否定なので, 結果は理屈に沿っている. \subsection{課題 1-3} \Cref{fig:a1-3-cd}より, 各ゲートの出力は\cref{equ:output-of-each-gate-a1-3}となる. \begin{equation} \label{equ:output-of-each-gate-a1-3} \begin{split} O_1 &= A_{\text{IN}} \cdot B_{\text{IN}} \\ O_2 &= C_{\text{IN}} \cdot D_{\text{IN}} \\ D_p &= O_1 \cdot O_2 = (A_{\text{IN}} \cdot B_{\text{IN}}) \cdot (C_{\text{IN}} \cdot D_{\text{IN}}) \end{split} \end{equation} \Cref{equ:output-of-each-gate-a1-3}より, 真理値表は\cref{tab:theoretical-a1-3}となる. \begin{table}[H] \centering \caption{Theoretical Truth Table of $D_p = (A_{\text{IN}} \cdot B_{\text{IN}}) \cdot (C_{\text{IN}} \cdot D_{\text{IN}})$} \label{tab:theoretical-a1-3} \begin{tabular}{ccccc} \hline $A_{\text{IN}}$ & $B_{\text{IN}}$ & $C_{\text{IN}}$ & $D_{\text{IN}}$ & $D_p$ \\ \hline 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 & 0 \\ 1 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & 1 & 1 & 0 \\ 1 & 0 & 1 & 1 & 0 \\ 0 & 1 & 1 & 1 & 0 \\ 1 & 1 & 1 & 1 & 1 \\ \hline \end{tabular} \end{table} \Cref{tab:theoretical-a1-3}より, 出力$D_p$が1となるのは全入力が1の時だけであり, この条件を論理式にすると\cref{equ:a1-3-final}となり, \cref{equ:output-of-each-gate-a1-3}で示した$D_p$と等価な式になる. \begin{equation} \label{equ:a1-3-final} d_p = A_{\text{IN}} \cdot B_{\text{IN}} \cdot C_{\text{IN}} \cdot D_{\text{IN}} \end{equation} \subsection{課題 1-4} \Cref{fig:a1-4-cd}の出力は\cref{equ:a1-4-out}で示され, ド・モルガンの定理で変形していくと\cref{equ:a1-4-de-morganed}となる. \begin{equation} \label{equ:a1-4-out} D_p = \overline{(A_{\text{IN}} \cdot B_{\text{IN}}) \cdot (C_{\text{IN}} \cdot D_{\text{IN}})} \end{equation} \begin{equation} \label{equ:a1-4-de-morganed} \begin{split} D_p &= \overline{(A_{\text{IN}} \cdot B_{\text{IN}}) \cdot (C_{\text{IN}} \cdot D_{\text{IN}})} = \overline{A_{\text{IN}} \cdot B_{\text{IN}}} + \overline{C_{\text{IN}} \cdot D_{\text{IN}}} \\ &= \overline{A_{\text{IN}}} + \overline{B_{\text{IN}}} + \overline{C_{\text{IN}}} + \overline{D_{\text{IN}}} = \overline{A_{\text{IN}} \cdot B_{\text{IN}} \cdot C_{\text{IN}} \cdot D_{\text{IN}}} \end{split} \end{equation} 論理式の等価は真理値表の一致を意味するので, \cref{equ:a1-4-de-morganed}で示した論理式の真理値表も全て一致する. \Cref{tab:a1-4-res-tt}の真理値表は\cref{tab:a1-2-res-tt}のものと一致している, よってこれら2つの論理式は等価である. \subsection{課題 2-1} デコーダ回路とはある意味を持つ小さなコードを別の対応するより大きなコードへの写像を取る回路のことである. 今回の場合は4ビットの二進数から7セグメントLEDの点灯パターンへの写像を論理回路で実装している. 7セグメントLEDデコーダのTC4511はそれぞれの出力が論理式の出力となってる. \subsection{課題 2-2B} この回路を制作するにあたって, まずは\cref{tab:a2-2b-tt-design}の真理値表を考える. \begin{table}[H] \centering \caption{Truth Table for Designing 7 Segment Hexadecimal Decoder} \label{tab:a2-2b-tt-design} \begin{tabular}{ccccccccccc} \hline a & b & c & d & A & B & C & D & E & F & G \\ \hline 0 & 1 & 0 & 1 & 1 & 1 & 1 & 0 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 & 0 & 0 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 & 1 & 0 & 0 & 1 & 1 & 1 & 0 \\ 1 & 0 & 1 & 1 & 0 & 1 & 1 & 1 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 1 & 1 & 1 \\ \hline \end{tabular} \end{table} ここで, dの値が全てHレベルであるので, 一旦省略する. この真理値表にもとずいたそれぞれのセグメントの論理式は\cref{equ:a2-2b-equ-design}となる. \begin{equation} \label{equ:a2-2b-equ-design} \begin{split} A &= \overline{(a \cdot b \cdot \bar{c}) + (a \cdot \bar{b} \cdot c)} \\ B &= (\bar{a} \cdot b \cdot \bar{c}) + (a \cdot \bar{b} \cdot c) \\ C &= B + (a \cdot b \cdot \bar{c}) \\ D &= \overline{(\bar{a} \cdot b \cdot \bar{c}) + (a \cdot b \cdot c)} \\ E &= d \\ F &= \overline{a \cdot \bar{b} \cdot c} \\ G &= \overline{\bar{a} \cdot \bar{b} \cdot c} \end{split} \end{equation} Eセグメントには省略していたdの値を1との論理積として戻した. これら論理式にカルノー図を適応したが, もとが十分簡略化されていたためか, あまり有用ではなかった. かわりに, 複数式に共通する項を1つのユニットとして共有して使用することにした. 共通項は\cref{equ:a2-2b-common}とした. \begin{equation} \label{equ:a2-2b-common} \begin{split} X &= (a \cdot b \cdot \bar{c}) \\ Y &= (a \cdot \bar{b} \cdot c) \\ Z &= (\bar{a} \cdot b \cdot \bar{c}) \end{split} \end{equation} また, 禁止条件が入力された際の真理値値表は\cref{tab:a2-2b-not-allowed}となった. \begin{table}[H] \centering \caption{Truth Table for Disallowed Conditions} \label{tab:a2-2b-not-allowed} \begin{tabular}{ccccc} \hline a & b & c & d & $\overline{\text{EN}}$ \\ \hline * & * & * & 0 & 1 \\ * & 0 & 0 & 1 & 1 \\ \hline \end{tabular} \end{table} 上記の真理値表から論理式を作成すると\cref{equ:a2-2b-not-allowed-equ}となった. \begin{equation} \label{equ:a2-2b-not-allowed-equ} \text{EN} = d \cdot (b + c) \end{equation} この論理式の出力でNch MOSFETを駆動させ, 7セグメントLEDのコモンカソードを制御することで一括で消灯させることにした. これら論理式から回路を制作すると\cref{fig:a2-2b-cd}となった. \begin{figure}[tbh] \centering \begin{circuitikz}[scale=0.7] \ctikzset{logic ports=ieee} \ctikzset{logic ports/scale=0.7} \ctikzset{resistors/scale=0.7} \node [and port, number inputs=3] at (-5,4) (X) {}; \node [and port, number inputs=3] at (-5,2) (Y) {}; \node [and port, number inputs=3] at (-5,0) (Z) {}; \node [nor port] at (0,4) (A) {}; \node [or port] at (0,2) (B) {}; \node [or port] at (0,0) (C) {}; \node [and port, number inputs=3] at (5,4) (m) {}; \node [nor port, anchor=in 2] at ($(m.out) + (1,0)$) (D) {}; \node [not port] at (5,2) (F) {}; \node [nand port, number inputs=3] at (5,0) (G) {}; \node [notcirc,left] at (X.bin 3) {}; \node [notcirc,left] at (Y.bin 2) {}; \node [notcirc,left] at (Z.bin 1) {}; \node [notcirc,left] at (Z.bin 3) {}; \node [notcirc,left] at (G.bin 1) {}; \node [notcirc,left] at (G.bin 2) {}; \draw (X.in 1) ++(-0.5,0) node[left]{a} to [short, o-] (X.in 1); \draw (X.in 2) ++(-0.5,0) node[left]{b} to [short, o-] (X.in 2); \draw (X.in 3) ++(-0.5,0) node[left]{c} to [short, o-] (X.in 3); \draw (X.out) to [short, -o] ++(0.5,0) node[right]{X}; \draw (Y.in 1) ++(-0.5,0) node[left]{a} to [short, o-] (Y.in 1); \draw (Y.in 2) ++(-0.5,0) node[left]{b} to [short, o-] (Y.in 2); \draw (Y.in 3) ++(-0.5,0) node[left]{c} to [short, o-] (Y.in 3); \draw (Y.out) to [short, -o] ++(0.5,0) node[right]{Y}; \draw (Z.in 1) ++(-0.5,0) node[left]{a} to [short, o-] (Z.in 1); \draw (Z.in 2) ++(-0.5,0) node[left]{b} to [short, o-] (Z.in 2); \draw (Z.in 3) ++(-0.5,0) node[left]{c} to [short, o-] (Z.in 3); \draw (Z.out) to [short, -o] ++(0.5,0) node[right]{Z}; \draw (A.in 1) ++(-0.5,0) node[left]{X} to [short, o-] ++(0.5,0); \draw (A.in 2) ++(-0.5,0) node[left]{Y} to [short, o-] ++(0.5,0); \draw (A.out) to [short, -o] ++(0.5,0) node[right]{A}; \draw (B.in 1) ++(-0.5,0) node[left]{Y} to [short, o-] ++(0.5,0); \draw (B.in 2) ++(-0.5,0) node[left]{Z} to [short, o-] ++(0.5,0); \draw (B.out) to [short, -o] ++(0.5,0) node[right]{B}; \draw (C.in 1) ++(-0.5,0) node[left]{B} to [short, o-] ++(0.5,0); \draw (C.in 2) ++(-0.5,0) node[left]{X} to [short, o-] ++(0.5,0); \draw (C.out) to [short, -o] ++(0.5,0) node[right]{C}; \draw (m.in 1) ++(-0.5,0) node[left]{a} to [short, o-] ++(0.5,0); \draw (m.in 2) ++(-0.5,0) node[left]{b} to [short, o-] ++(0.5,0); \draw (m.in 3) ++(-0.5,0) node[left]{c} to [short, o-] ++(0.5,0); \draw (m.out) -- (D.in 2); \draw (D.in 1) ++(-0.5,0) node[left]{Z} to [short, o-] ++(0.5,0); \draw (D.out) to [short, -o] ++(0.5,0) node[right]{D}; \draw (F.in) ++(-0.5,0) node[left]{Y} to [short, o-] ++(0.5,0); \draw (F.out) to [short, -o] ++(0.5,0) node[right]{F}; \draw (G.in 1) ++(-0.5,0) node[left]{a} to [short, o-] (G.in 1); \draw (G.in 2) ++(-0.5,0) node[left]{b} to [short, o-] (G.in 2); \draw (G.in 3) ++(-0.5,0) node[left]{c} to [short, o-] (G.in 3); \draw (G.out) to [short, -o] ++(0.5,0) node[right]{G}; \draw (-1.5, -2) node[left]{d} to [short, o-o] ++(3,0) node[right]{E}; \draw (G.out) ++(1,-2) node[above]{Common Cathode} to [short, o-] ++(0,-1) node[nigfete,anchor=D](Q){} (Q.S) -- ++(0,-1.3) node[ground]{} (Q.G) to [short, -*] ++(-1,0) coordinate (Qin) to [R, l={$330 \ \Omega$}] ++(0,-2) node[ground]{}; \draw (Qin) -- ++(-1,0) node[and port, anchor=out](ENAnd){}; \draw (ENAnd.in 1) to [short, -o] ++(-0.5,0) node[left]{d}; \draw (ENAnd.in 2) -- ++(-1,0) node[or port, anchor=out](ENOr){}; \draw (ENOr.in 1) to [short, -o] ++(-0.5,0) node[left]{b}; \draw (ENOr.in 2) to [short, -o] ++(-0.5,0) node[left]{c}; \ctikzset{resistors/scale=0.5} \draw (-7,-4) node[dipchip, num pins=14, no topmark, external pins width=0.0, hide numbers](LED){} (LED) node[bare7seg]{}; \node [left, font=\tiny] at (LED.bpin 14) {A}; \node [left, font=\tiny] at (LED.bpin 13) {B}; \node [left, font=\tiny] at (LED.bpin 12) {C}; \node [left, font=\tiny] at (LED.bpin 11) {D}; \node [left, font=\tiny] at (LED.bpin 10) {E}; \node [left, font=\tiny] at (LED.bpin 9) {F}; \node [left, font=\tiny] at (LED.bpin 8) {G}; \node [above, font=\tiny] at (LED.s) {Cathode}; \draw (LED.bpin 14) to[R] ++(1.5,0) to [short,-o] ++(0.5,0) node[right]{A}; \draw (LED.bpin 13) to[R] ++(1.5,0) to [short,-o] ++(0.5,0) node[right]{B}; \draw (LED.bpin 12) to[R] ++(1.5,0) to [short,-o] ++(0.5,0) node[right]{C}; \draw (LED.bpin 11) to[R] ++(1.5,0) to [short,-o] ++(0.5,0) node[right]{D}; \draw (LED.bpin 10) to[R] ++(1.5,0) to [short,-o] ++(0.5,0) node[right]{E}; \draw (LED.bpin 9) to[R] ++(1.5,0) to [short,-o] ++(0.5,0) node[right]{F}; \draw (LED.bpin 8) to[R] ++(1.5,0) to [short,-o] ++(0.5,0) node[right]{G}; \draw (LED.s) to [short,-o] ++(0,-1) node[right]{Common Cathode}; \draw[dash pattern=on 4pt off 4pt, thick] (LED.ne) ++(0.1, 0.1) rectangle ($(LED.se) + (1.4,-0.1)$); \draw (LED.se) ++(0.7,-0.1) node[below]{$330 \ \Omega$}; \end{circuitikz} \caption{Circuit Diagram of 7 Segment Hexadecimal Decoder} \label{fig:a2-2b-cd} \end{figure} \subsection{課題 3-1} 今回の実験では\cref{fig:a3-1-stg}の状態遷移を行うNOR構成のRSフリップフロップを作成した. \begin{figure}[tbh] \centering \begin{tikzpicture}[shorten >=1pt, node distance=2cm, auto] \node [state] (Q0) {$Q_0$}; \node [state] (Q1) [right of=Q0] {$Q_1$}; \path[->] (Q0) edge [bend left] node[above] {$01/1$} (Q1); \path[->] (Q1) edge [bend left] node[below] {$10/0$} (Q0); \path[->] (Q0) edge [loop left] node[left] {$00/0$} () (Q1) edge [loop right] node[right] {$00/1$} (); \end{tikzpicture} \caption{ \parbox[t]{8cm}{State Transition Graph of RS Flipflop, the Edge Labels Show Input R, Input S, and Output Q from Left} } \label{fig:a3-1-stg} \end{figure} この構成ではRとS共に1が入力された時が禁止状態となる. 禁止状態では, 両方のNORゲートに1つ以上のHレベルの入力がかかり, 双方出力が0となりフリップフロップとしての機能を喪失する. どちらかの入力がLレベルになるまでこの機能は回復しない. \subsection{課題 3-3} 今回の実験で作成したカウンタは二進数のビットごとの否定を出力するものとなった. これは初期状態では全ての出力$Q$がLレベルで, 次の状態で入力Dに印加されるのは全て否定出力$\bar{Q}$のHレベルとなるためである. この回路は複数のDフリップフロップの出力が次のフリップフロップのクロック入力へ数珠接続した非同期のカウンタとなる. \subsection{課題 3-4} 最下位のDフリップフロップのクロックをパルスさせるには?の論理ゲートの出力をNANDゲートの入力関係無しにボタンからのオン・オフでトグルさせる必要がある. 手元にあるゲートの中でこのクロックをパルスさせることが出来たのはANDゲートであったが, NANDゲートの出力がLレベルになるカウンタ出力の組み合わせで状態の遷移が停止してしまった. これはANDゲートの出力をHレベルにするには2つの入力がHレベルである必要があるが, NANDゲートの出力がLレベルになってしまった以上, ボタンの出力のみでANDゲートの出力を変えることが出来なくなってしまったことに起因する. このカウンタを一巡させるには1つのHレベル入力のみで出力をパルスさせ, かつ両方がHレベルのときには出力をLレベルにすることが出来る論理ゲートが必要である. その論理ゲートこそXOR(排他的論理和)である. この論理ゲートの真理値表は\cref{tab:xor-gate-tt}で, 一方の入力がHレベルである時だけ出力をHレベルにすることが出来る\supercite{digital-circuit:xor}. \begin{table}[H] \centering \caption{Truth Table of XOR Gate} \label{tab:xor-gate-tt} \begin{tabular}{ccc} \hline a & b & x \\ \hline 0 & 0 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 0 \\ \hline \end{tabular} \end{table} \subsection{応用課題 A} \Cref{fig:aa-res}と\cref{tab:aa-res}より, 信号は最下位ビットから順番に立ち上がっている様子が分かる. しかし, $2^2$のビットは$2^3$のビットに遅れてTC74HC74のHレベルの入力電圧である3.15 Vに到達した. これにはIC内部や, 入力端子の寄生容量が関係していると思われる\supercite{tc74hc74}. これら遅延は非同期カウンタの性質上避けられない性質で, クロックとほぼ同時に状態が遷移する同期式のカウンタならこの遅延を少なくすることができる. このことから, この回路で入力できる最大周波数の理論値は$\frac{1}{80 \ \text{ns}} = 12.5 \ \text{MHz}$となる. 実際, ファンクションジェネレータで16 MHz付近の周波数をクロックに入力すると動作が不安定になった.