<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/6283d730ebb030486d900fc0/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/6283d730ebb030486d900fc0/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">Code (D Flip Flop):</div><div class="t m0 x1 h4 y3 ff2 fs1 fc0 sc0 ls0 ws0">module d(q, D, clk,res);</div><div class="t m0 x1 h4 y4 ff2 fs1 fc0 sc0 ls0 ws0">output reg q;</div><div class="t m0 x1 h4 y5 ff2 fs1 fc0 sc0 ls0 ws0">input D;</div><div class="t m0 x1 h4 y6 ff2 fs1 fc0 sc0 ls0 ws0">input clk;</div><div class="t m0 x1 h4 y7 ff2 fs1 fc0 sc0 ls0 ws0">input res;</div><div class="t m0 x2 h4 y8 ff2 fs1 fc0 sc0 ls0 ws0">inial</div><div class="t m0 x3 h4 y9 ff2 fs1 fc0 sc0 ls0 ws0">begin</div><div class="t m0 x4 h4 ya ff2 fs1 fc0 sc0 ls0 ws0">q<=1'b0;</div><div class="t m0 x3 h4 yb ff2 fs1 fc0 sc0 ls0 ws0">end</div><div class="t m0 x2 h4 yc ff2 fs1 fc0 sc0 ls0 ws0">always@(posedge clk)</div><div class="t m0 x3 h4 yd ff2 fs1 fc0 sc0 ls0 ws0">begin</div><div class="t m0 x3 h4 ye ff2 fs1 fc0 sc0 ls0 ws0">if(res==1)</div><div class="t m0 x4 h4 yf ff2 fs1 fc0 sc0 ls0 ws0">q<=0;</div><div class="t m0 x3 h4 y10 ff2 fs1 fc0 sc0 ls0 ws0">else</div><div class="t m0 x4 h4 y11 ff2 fs1 fc0 sc0 ls0 ws0">q<=D;</div><div class="t m0 x3 h4 y12 ff2 fs1 fc0 sc0 ls0 ws0">end</div><div class="t m0 x1 h4 y13 ff2 fs1 fc0 sc0 ls0 ws0">endmodule</div><div class="t m0 x1 h3 y14 ff1 fs0 fc0 sc0 ls0 ws0">Code (PIPO):</div><div class="t m0 x1 h4 y15 ff2 fs1 fc0 sc0 ls0 ws0">module pipo(q1,q2,q3,a,b,c,clk1,res1);</div><div class="t m0 x1 h4 y16 ff2 fs1 fc0 sc0 ls0 ws0">input a,b,c;</div><div class="t m0 x1 h4 y17 ff2 fs1 fc0 sc0 ls0 ws0">input res1;</div><div class="t m0 x1 h4 y18 ff2 fs1 fc0 sc0 ls0 ws0">input clk1;</div><div class="t m0 x1 h4 y19 ff2 fs1 fc0 sc0 ls0 ws0">output q1,q2,q3;</div><div class="t m0 x1 h4 y1a ff2 fs1 fc0 sc0 ls0 ws0">d d1(q1,a,clk1,res1);</div><div class="t m0 x1 h4 y1b ff2 fs1 fc0 sc0 ls0 ws0">d d2(q2,b,clk1,res1);</div><div class="t m0 x1 h4 y1c ff2 fs1 fc0 sc0 ls0 ws0">d d3(q3,c,clk1,res1);</div><div class="t m0 x1 h4 y1d ff2 fs1 fc0 sc0 ls0 ws0">endmodule</div></div></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div>
</body>
</html>