<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ece260 | Yao Zheng@UHM</title><link>https://gustybear.github.io/tags/ece260/</link><atom:link href="https://gustybear.github.io/tags/ece260/index.xml" rel="self" type="application/rss+xml"/><description>Ece260</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Fri, 27 Feb 2026 00:00:00 +0000</lastBuildDate><image><url>https://gustybear.github.io/media/logo_hu_d0a0b1783c391ac0.png</url><title>Ece260</title><link>https://gustybear.github.io/tags/ece260/</link></image><item><title>Take-Home Midterm Exam: Combinational Logic and Advanced Verilog</title><link>https://gustybear.github.io/docs/exams/course_ece260_2026_spring/miterm_01_game/</link><pubDate>Fri, 27 Feb 2026 00:00:00 +0000</pubDate><guid>https://gustybear.github.io/docs/exams/course_ece260_2026_spring/miterm_01_game/</guid><description>&lt;p>&lt;strong>Scope:&lt;/strong> Number systems, Boolean algebra, multi-level optimization, hazards, arithmetic circuits, encoder/decoder/PLA/ROM, scalable MUX structures, parameterized Verilog&lt;br>
&lt;strong>Duration:&lt;/strong> 48 hours&lt;/p>
&lt;p>&lt;strong>Instructions&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Attempt &lt;strong>all&lt;/strong> questions. Show complete derivations and clearly state assumptions.&lt;/li>
&lt;li>Provide &lt;strong>commented, synthesizable Verilog&lt;/strong> and a &lt;strong>self-checking testbench&lt;/strong> where requested.&lt;/li>
&lt;li>Include timing and area reasoning (gate depth, gate count, or asymptotic arguments).&lt;/li>
&lt;li>No collaboration. Cite any references consulted.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="part-a--multiple-choice-10--3--30-pts">Part A — Multiple Choice (10 × 3 = 30 pts)&lt;/h2>
&lt;p>Select the &lt;strong>best&lt;/strong> answer.&lt;/p>
&lt;p>&lt;strong>Q1.&lt;/strong> Which transformation always preserves functional equivalence but may reduce logic depth?&lt;br>
a) Converting SOP to canonical SOP&lt;br>
b) Algebraic factoring&lt;br>
c) Expanding minterms&lt;br>
d) Adding consensus terms&lt;/p>
&lt;p>&lt;strong>Q2.&lt;/strong> A static-1 hazard occurs when:&lt;br>
a) Output should remain 1 but temporarily glitches to 0&lt;br>
b) Output should remain 0 but glitches to 1&lt;br>
c) Clock frequency is too high&lt;br>
d) Fan-out exceeds limit&lt;/p>
&lt;p>&lt;strong>Q3.&lt;/strong> For an N-bit ripple carry adder, worst-case delay is proportional to:&lt;br>
a) log₂N&lt;br>
b) N&lt;br>
c) √N&lt;br>
d) constant&lt;/p>
&lt;p>&lt;strong>Q4.&lt;/strong> Which gate set is functionally complete?&lt;br>
a) {XOR}&lt;br>
b) {AND, OR}&lt;br>
c) {NAND}&lt;br>
d) {XNOR}&lt;/p>
&lt;p>&lt;strong>Q5.&lt;/strong> In synthesizable combinational Verilog, the safest template is:&lt;br>
a) &lt;code>always @(posedge clk)&lt;/code>&lt;br>
b) &lt;code>always @(*)&lt;/code>&lt;br>
c) &lt;code>initial begin&lt;/code>&lt;br>
d) &lt;code>#5 y = a &amp;amp; b;&lt;/code>&lt;/p>
&lt;p>&lt;strong>Q6.&lt;/strong> A 16→1 multiplexer implemented as a balanced tree of 2→1 MUXes has depth:&lt;br>
a) 4&lt;br>
b) 8&lt;br>
c) 15&lt;br>
d) 16&lt;/p>
&lt;p>&lt;strong>Q7.&lt;/strong> ROM implementation size grows:&lt;br>
a) Linearly with inputs&lt;br>
b) Quadratically with inputs&lt;br>
c) Exponentially with inputs&lt;br>
d) Logarithmically with inputs&lt;/p>
&lt;p>&lt;strong>Q8.&lt;/strong> The consensus term of \(A'B + AC\) is:&lt;br>
a) BC&lt;br>
b) B&amp;rsquo;C&lt;br>
c) AB&lt;br>
d) A&amp;rsquo;C&lt;/p>
&lt;p>&lt;strong>Q9.&lt;/strong> Which operator performs bitwise XNOR in Verilog?&lt;br>
a) &lt;code>~^&lt;/code>&lt;br>
b) &lt;code>^~&lt;/code>&lt;br>
c) Both&lt;br>
d) None&lt;/p>
&lt;p>&lt;strong>Q10.&lt;/strong> A balanced adder tree reduces delay complexity from O(N) to:&lt;br>
a) O(1)&lt;br>
b) O(log N)&lt;br>
c) O(N²)&lt;br>
d) O(N log N)&lt;/p>
&lt;hr>
&lt;h2 id="part-b--design--analysis-10--7--70-pts">Part B — Design &amp;amp; Analysis (10 × 7 = 70 pts)&lt;/h2>
&lt;p>&lt;strong>Problem 1 — Multi-Level Optimization and Cost Analysis&lt;/strong>&lt;br>
Given&lt;br>
\(F(A,B,C,D,E)=\Sigma(1,3,4,7,11,15,16,18,19,23,27,31)\)&lt;/p>
&lt;p>a) Write canonical SOP and POS.&lt;br>
b) Minimize using K-map.&lt;br>
c) Factor to reduce depth.&lt;br>
d) Compare literal count and logic depth between two-level and factored implementations.&lt;/p>
&lt;p>&lt;strong>Problem 2 — Hazard Analysis&lt;/strong>&lt;br>
Given&lt;br>
\(F(A,B,C)=A'B+AC\)&lt;/p>
&lt;p>a) Identify static hazards and show transition causing glitch.&lt;br>
b) Add minimal consensus terms to eliminate hazard.&lt;br>
c) Estimate glitch width assuming uniform 1 ns gate delay.&lt;/p>
&lt;p>&lt;strong>Problem 3 — NAND-Only Realization&lt;/strong>&lt;br>
a) Prove NAND is functionally complete.&lt;br>
b) Implement \(F(A,B,C)=AB+A'C\) using only 2-input NAND gates.&lt;br>
c) Count gates and compute logic depth.&lt;/p>
&lt;p>&lt;strong>Problem 4 — 32→5 Priority Encoder&lt;/strong>&lt;br>
a) Define truth table with D31 highest priority and &lt;code>valid&lt;/code>.&lt;br>
b) Build hierarchically from 4→2 encoders.&lt;br>
c) Structural Verilog implementation.&lt;br>
d) Estimate worst-case delay if each 4→2 block delay = 2 ns.&lt;/p>
&lt;p>&lt;strong>Problem 5 — Shared PLA vs ROM Implementation&lt;/strong>&lt;br>
Given&lt;br>
\(F_1=\Sigma(0,2,5,8,10,13)\)&lt;br>
\(F_2=\Sigma(1,3,6,9,14,15)\)&lt;/p>
&lt;p>a) Minimize jointly and identify shared product terms.&lt;br>
b) Draw PLA matrix (AND plane and OR plane).&lt;br>
c) Determine memory size for equivalent 16×2 ROM.&lt;br>
d) Compare area tradeoffs.&lt;/p>
&lt;p>&lt;strong>Problem 6 — Balanced Adder Tree&lt;/strong>&lt;br>
Sum eight 12-bit numbers.&lt;/p>
&lt;p>a) Serial ripple accumulation: compute depth.&lt;br>
b) Balanced tree: draw structure and compute depth.&lt;br>
c) Determine required output width.&lt;/p>
&lt;p>&lt;strong>Problem 7 — Parameterized ALU&lt;/strong>&lt;/p>
&lt;p>Operations: ADD, SUB, AND, OR, XOR, CMP(==,&amp;gt;,&amp;lt;). Width parameter &lt;code>N&lt;/code>.&lt;/p>
&lt;p>a) Write synthesizable Verilog using &lt;code>unique case&lt;/code>.&lt;br>
b) Implement comparison efficiently (no redundant subtraction).&lt;br>
c) Provide self-checking randomized testbench.&lt;br>
d) Compare resource growth for N=8 and N=32.&lt;/p>
&lt;p>&lt;strong>Problem 8 — Recursive MUX Tree&lt;/strong>&lt;/p>
&lt;p>a) Implement a parameterized &lt;code>mux_tree #(N=16,W=8)&lt;/code> using &lt;code>generate&lt;/code>.&lt;br>
b) Ensure balanced structure.&lt;br>
c) Derive logic depth as function of N.&lt;br>
d) Provide synthesizable code.&lt;/p>
&lt;p>&lt;strong>Problem 9 — Gray/Binary Converters&lt;/strong>&lt;/p>
&lt;p>a) Derive 4-bit Gray→Binary and Binary→Gray equations.&lt;br>
b) Prove composition correctness.&lt;br>
c) Provide parameterized Verilog and exhaustive testbench.&lt;/p>
&lt;p>&lt;strong>Problem 10 — Power-of-Two Detector&lt;/strong>&lt;/p>
&lt;p>Design combinational circuit to detect if a 16-bit input is a power of two.&lt;/p>
&lt;p>a) Derive minimal Boolean condition.&lt;br>
b) Implement structural and behavioral Verilog versions.&lt;br>
c) Compare gate complexity.&lt;/p></description></item></channel></rss>