109 年 國立臺灣大學電子工程學研究所丁組《邏輯設計》

📄 試題原卷 免費註冊後即可對照原始考卷 PDF免費註冊

第 1 題20 分

Given a Boolean function f(a,b,c,d)f(a,b,c,d) with the properties f(a,b,c,d)=f(b,a,c,d)f(a,b,c,d) = f(b,a,c,d) and f(a,b,c,d)=f(a,c′,b′,d)f(a,b,c,d) = f(a,c',b',d) (notice the complements), suppose ff is partially known as shown in the following Karnaugh map.

🖼️【此處有附圖,請對照原卷】

(a) (11%) Which of the unknown minterms (m1,m2,m3,m4,m5,m6,m8,m10,m11,m12,m15m_1, m_2, m_3, m_4, m_5, m_6, m_8, m_{10}, m_{11}, m_{12}, m_{15}) are uniquely determined? What are their values (please indicate all known values in a Karnaugh map)?
(b) (4%) How many functions satisfy the above constraints?
(c) (5%) Among these functions, which one has the simplest sum-of-product (SOP) expression?

🖼️ 本題含圖表,以下為原卷對應頁面:
原卷第 1 頁

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

函數在變數轉換後保持不變,代表同一等價類中的 minterm 必須有相同函數值。先依轉換找出等價類,再用已知格子的值傳播到同類 minterm。SOP 則可用 Karnaugh map 的相鄰格分組化簡。

解題方法

原圖欄位依序為 ab=00,01,11,10ab=00,01,11,10,列依序為 cd=00,01,11,10cd=00,01,11,10;已知 m0=0m_0=0、m13=0m_{13}=0、m9=1m_9=1、m7=1m_7=1、m14=0m_{14}=0。題目給定交換 a,ba,b 不變,且 (a,b,c,d)(a,b,c,d) 換成 (a,cˉ,bˉ,d)(a,\bar c,\bar b,d) 後函數值不變。以下依這兩種轉換建立等價類。

以 mim_i 的索引為二進位 abcdabcd 表示。兩種轉換都不改變 dd;對 abcabc 的等價類如下:

abcabc 等價類d=0d=0 對應 mintermd=1d=1 對應 minterm
{000,011,101}\{000,011,101\}{m0,m6,m10}\{m_0,m_6,m_{10}\}{m1,m7,m11}\{m_1,m_7,m_{11}\}
{100,010,111}\{100,010,111\}{m4,m8,m14}\{m_4,m_8,m_{14}\}{m5,m9,m15}\{m_5,m_9,m_{15}\}
{001}\{001\}{m2}\{m_2\}{m3}\{m_3\}
{110}\{110\}{m12}\{m_{12}\}{m13}\{m_{13}\}

因此,m0=0m_0=0 使 m6,m10m_6,m_{10} 為 00;m14=0m_{14}=0 使 m4,m8m_4,m_8 為 00。同理,m7=1m_7=1 使 m1,m11m_1,m_{11} 為 11;m9=1m_9=1 使 m5,m15m_5,m_{15} 為 11。m2,m3,m12m_2,m_3,m_{12} 各自所在的等價類沒有其他已知值,因此尚未確定。

完整 Karnaugh map 如下;「?」表示未被唯一決定:

cd\abcd\backslash ab0000010111111010
00000 (m0)0\ (m_0)0 (m4)0\ (m_4)? (m12)?\ (m_{12})0 (m8)0\ (m_8)
01011 (m1)1\ (m_1)1 (m5)1\ (m_5)0 (m13)0\ (m_{13})1 (m9)1\ (m_9)
1111? (m3)?\ (m_3)1 (m7)1\ (m_7)1 (m15)1\ (m_{15})1 (m11)1\ (m_{11})
1010? (m2)?\ (m_2)0 (m6)0\ (m_6)0 (m14)0\ (m_{14})0 (m10)0\ (m_{10})

(a) 唯一確定的 minterm

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 2 題15 分

Consider a Boolean function ff such that f=x2′x3+x2x4f = x_2' x_3 + x_2 x_4 when x1=0x_1 = 0, f=x3x4′f = x_3 x_4' when x1=1x_1 = 1 and x2=0x_2 = 0, and f=x3+x4′f = x_3 + x_4' when x1=1x_1 = 1 and x2=1x_2 = 1.
(a) (10%) Draw the Karnaugh map and express ff in minimum sum of products (SOP).
(b) (5%) If the minimum SOP expression obtained in (a) is implemented by a two-level AND-OR circuit, does it suffer from static 1-hazards? If yes, explain why and how to fix the problem. Otherwise, explain why not.

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考查:

  1. 由條件式建立四變數 Boolean function 的 Karnaugh map。
  2. 利用相鄰的 11 格進行圈選,化簡為 minimum SOP。
  3. 判斷兩層 AND-OR 電路的 static 1-hazard。
  4. 利用共識項(consensus term)補足 hazard-free SOP。

Static 1-hazard 的判斷原則是:

若兩個相鄰的 11 格在 SOP 中沒有被同一個 product term 覆蓋,輸入變化時可能因閘門延遲不同而產生瞬間的 00。

因此,hazard-free SOP 必須使每一對相鄰的 11 格至少被同一個乘積項涵蓋。


(a) Karnaugh map 與 minimum SOP

1. 依條件列出各情況

當 x1=0x_1=0 時:

f=x2′x3+x2x4f=x_2'x_3+x_2x_4

因此:

  • x2=0x_2=0 時,f=x3f=x_3;
  • x2=1x_2=1 時,f=x4f=x_4。

當 x1=1x_1=1 時:

  • x2=0x_2=0:
f=x3x4′f=x_3x_4'
  • x2=1x_2=1:
f=x3+x4′f=x_3+x_4'

2. 找出輸出為 11 的 minterms

依照變數順序 x1x2x3x4x_1x_2x_3x_4:

  • x1=0,x2=0x_1=0,x_2=0:x3=1x_3=1
m2,m3m_2,m_3
  • x1=0,x2=1x_1=0,x_2=1:x4=1x_4=1
m5,m7m_5,m_7
  • x1=1,x2=0x_1=1,x_2=0:x3x4′=1x_3x_4'=1
m10m_{10}
  • x1=1,x2=1x_1=1,x_2=1:x3+x4′=1x_3+x_4'=1
m12,m14,m15m_{12},m_{14},m_{15}

所以:

f=∑m(1,2,3,5,7,10,12,14,15)f=\sum m(1,2,3,5,7,10,12,14,15)

3. Karnaugh map

列採用 x3x4=00,01,11,10x_3x_4=00,01,11,10 的 Gray code 順序,列採用 x1x2=00,01,11,10x_1x_2=00,01,11,10:

x1x2\x3x4x_1x_2\backslash x_3x_400011110
000111
010110
111011
100001

4. 圈選

可作以下圈選:

圈選一:四格

涵蓋 m1,m3,m5,m7m_1,m_3,m_5,m_7:

x1′x4x_1'x_4

圈選二:兩格

涵蓋 m2,m10m_2,m_{10}:

x2′x3x4′x_2'x_3x_4'

圈選三:兩格

涵蓋 m10,m14m_{10},m_{14}:

x1x3x4′x_1x_3x_4'

圈選四:兩格

涵蓋 m12,m14m_{12},m_{14}:

x1x2x4′x_1x_2x_4'

圈選五:兩格

涵蓋 m14,m15m_{14},m_{15}:

x1x2x3x_1x_2x_3

因此 minimum SOP 為:

f=x1′x4+x2′x3x4′+x1x3x4′+x1x2x4′+x1x2x3\boxed{ f=x_1'x_4+x_2'x_3x_4'+x_1x_3x_4'+x_1x_2x_4'+x_1x_2x_3 }

其中:

  • m1,m5,m7m_1,m_5,m_7 主要由 x1′x4x_1'x_4 覆蓋;
  • m2m_2 需要 x2′x3x4′x_2'x_3x_4';
  • m12m_{12} 需要 x1x2x4′x_1x_2x_4';
  • m15m_{15} 需要 x1x2x3x_1x_2x_3;
  • m10m_{10}、m14m_{14} 可由相鄰圈選共同覆蓋。

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 3 題10 分

Consider the following switching network consisting of five switches.

🖼️【此處有附圖,請對照原卷】

(a) (5%) Give a minimum sum-of-product (SOP) Boolean expression describing the condition that the left and right terminals are connected.
(b) (5%) Give a minimum product-of-sum (POS) Boolean expression describing the condition that the left and right terminals are connected.

🖼️ 本題含圖表,以下為原卷對應頁面:
原卷第 1 頁

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

令開關閉合時為 11,斷開時為 00。左、右端點相連的條件,是存在一條由左端點到右端點的「全閉合路徑」。

  • 串聯:所有開關都閉合,使用 AND。
  • 並聯:任一路徑成立即可,使用 OR。
  • SOP:列出所有可能的導通路徑。
  • POS:列出所有能切斷電路的最小割集。

圖中的五個開關形成兩條水平支路,並由 CC 連接上下兩支路的中點。

(a) 最小 SOP

由左端點到右端點共有四條最小導通路徑:

  1. 上方路徑:AA、BB 串聯,條件為 ABAB。
  2. 下方路徑:DD、EE 串聯,條件為 DEDE。
  3. 經由中央開關的左上至右下路徑:AA、CC、EE,條件為 ACEACE。
  4. 經由中央開關的左下至右上路徑:DD、CC、BB,條件為 BCDBCD。

因此連接函數為

F=AB+DE+ACE+BCDF=AB+DE+ACE+BCD

這已是最小 SOP。四個乘積項分別對應四個必要的最小導通路徑,無法再以吸收律刪除。

(b) 最小 POS

改以「切斷左、右端點連接」來找最小割集。

最小割集一:AA 與 DD

若 AA、DD 同時斷開,左端點無法進入電路,因此對應最大項

(A+D)(A+D)

最小割集二:BB 與 EE

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 4 題16 分

The following circuit diagram implements a finite state machine (FSM) with two state bits, S0S_0 and S1S_1:

🖼️【此處有附圖,請對照原卷】

(a) (4%) Assume the propagation delays (delay from clock edge to Q), setup times, and hold times of rising-edge triggered D flip-flops are 2ns\text{2ns}, 3ns\text{3ns}, and 1ns\text{1ns}, respectively. Assume the delays of inverter and NOR gates are 2ns\text{2ns} and 2ns\text{2ns}, respectively. Assume wire (interconnect) delays are zero. What is the smallest clock period for which the circuit still operates correctly?
(b) (4%) A sharp-eyed student suggests optimizing the circuit by removing the pair of inverters and connecting Q1Q_1 directly to D0D_0. If the clock period can be adjusted appropriately, would the optimized circuit operate correctly? If yes, explain the adjustment to the clock period that would be needed.
(c) (4%) When the RESET signal is set to "1" for several cycles, what state is the FSM set to? (Give values of S0S_0 and S1S_1.)
(d) (4%) Suppose there is skew in the CLK signal such that the rising edge of CLK always arrives at FF1\text{FF}_1 exactly 1ns\text{1ns} before it arrives at FF0\text{FF}_0. What is the smallest clock period for which the FSM still operates correctly?

🖼️ 本題含圖表,以下為原卷對應頁面:
原卷第 1 頁原卷第 2 頁

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

此題考查同步循序電路的時序分析,包含:

  • 暫存器的 clock-to-Q 延遲 tCQt_{CQ}
  • 組合邏輯延遲
  • D 觸發器的 setup time tsetupt_{setup}
  • hold time tholdt_{hold}
  • clock skew 對資料傳遞時間的影響

由電路圖可得:

D1=RESET+Q0‾D_1=\overline{RESET+Q_0}

Q1Q_1 經過兩個反相器後送至 D0D_0,因此:

D0=Q1D_0=Q_1

其中 Q1=S1Q_1=S_1、Q0=S0Q_0=S_0。


(a) 最小 clock period

同步電路的 setup time 約束為:

Tclk≥tCQ+tlogic+tsetupT_{clk}\geq t_{CQ}+t_{logic}+t_{setup}

Q0Q_0 到 D1D_1 的路徑

此路徑經過 NOR gate:

TQ0→D1=2+2+3=7 nsT_{Q_0\to D_1} =2+2+3 =7\text{ ns}

Q1Q_1 到 D0D_0 的路徑

此路徑經過兩個 inverter:

TQ1→D0=2+2+2+3=9 nsT_{Q_1\to D_0} =2+2+2+3 =9\text{ ns}

必須滿足所有資料路徑的 setup time,因此取較大值:

Tclk,min⁡=max⁡(7,9)=9 nsT_{clk,\min}=\max(7,9)=9\text{ ns}

hold time 亦符合,因為最早資料變化至少在 clock edge 後 2 ns2\text{ ns} 才發生,而 hold time 只有 1 ns1\text{ ns}。


(b) 移除兩個 inverter 後的電路

移除兩個 inverter 後,邏輯功能仍為:

D0=Q1D_0=Q_1

因此功能上仍可正常運作。

此時 Q1Q_1 到 D0D_0 的路徑只剩下觸發器本身的 clock-to-Q 延遲:

TQ1→D0=2+3=5 nsT_{Q_1\to D_0}=2+3=5\text{ ns}

而 Q0Q_0 到 D1D_1 的路徑仍需:

2+2+3=7 ns2+2+3=7\text{ ns}

所以最佳化後的最小 clock period 為:

Tclk,min⁡=max⁡(5,7)=7 nsT_{clk,\min}=\max(5,7)=7\text{ ns}

因此,最佳化電路可以正常運作,但 clock period 必須由原本至少 9 ns9\text{ ns} 調整為至少 7 ns7\text{ ns}。


(c) RESET 設為 11

當 RESET=1RESET=1 時,NOR gate 輸出必定為 00:

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 5 題19 分

The following figure shows a digital lock design based on a 6-state finite state machine (FSM). The design has three buttons labeled "0", "1", and "SS" (Start), and generates an unlock signal (output) U=1U=1 when the user presses SS followed by the sequence 0, 1, 1, 0.

🖼️【此處有附圖,請對照原卷】

(a) (6%) This design can be further simplified by removing the "SS" button. Please design a Moore FSM whose inputs are simply "0" and "1" buttons, whose output is the UU (unlock) signal, and which has the property that U=1U=1 if and only if the last four button presses correspond to the sequence 0,1,1,0. Show the state transition diagram with fewest states corresponding to your design. (No partial credits for a FSM with more states.)
(b) (4%) Is it possible that an equivalent FSM might be implemented in fewer than 5 states? Explain.
(c) (4%) D flip-flops are used to hold your FSM states, and they contain random values when power is first applied to your lock. Does this constrain your handling of unused states? Explain and show your modified FSM state transition diagram.
(d) (5%) Use a ROM and several D flip-flops to implement your FSM. Completely specify the ROM contents including those corresponding to unused states.

🖼️ 本題含圖表,以下為原卷對應頁面:
原卷第 2 頁

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考查:

  • Moore 型有限狀態機:輸出只由「目前狀態」決定。
  • 序列偵測器:狀態代表目前輸入序列與目標序列前綴的最長匹配部分。
  • 狀態最小化:不同狀態若能被某段輸入序列產生不同輸出,就不能合併。
  • 未使用狀態的處理:D 觸發器上電值不定,因此所有狀態編碼都必須定義後續行為。

目標序列為:

01100110

要求最後四次按鍵恰為 01100110 時,輸出 U=1U=1。


(a) 最少狀態 Moore FSM

狀態定義

令各狀態代表目前輸入序列與 01100110 的最長前綴匹配結果:

狀態意義Moore 輸出
AA沒有匹配到有效前綴00
BB最近輸入為 0000
CC最近輸入為 010100
DD最近輸入為 01101100
EE最近四次輸入為 0110011011

狀態轉移推導

  • AA:

    • 輸入 00:形成前綴 00,到 BB
    • 輸入 11:沒有任何有效前綴,留在 AA
  • BB:

    • 輸入 00:最近仍可視為前綴 00,留在 BB
    • 輸入 11:形成 0101,到 CC
  • CC:

    • 輸入 00:序列為 010010,尾端仍有前綴 00,到 BB
    • 輸入 11:形成 011011,到 DD
  • DD:

    • 輸入 00:形成 01100110,到 EE
    • 輸入 11:序列尾端沒有有效前綴,回到 AA
  • EE:

    • 輸入 00:序列為 0110001100,尾端的有效前綴為 00,到 BB
    • 輸入 11:序列為 0110101101,尾端的有效前綴為 0101,到 CC

狀態轉移表如下:

目前狀態輸入 00輸入 11輸出
AABBAA00
BBBBCC00
CCBBDD00
DDEEAA00
EEBBCC11

文字狀態圖可表示為:

  • A→0B, A→1AA \xrightarrow{0} B,\ A \xrightarrow{1} A
  • B→0B, B→1CB \xrightarrow{0} B,\ B \xrightarrow{1} C
  • C→0B, C→1DC \xrightarrow{0} B,\ C \xrightarrow{1} D
  • D→0E, D→1AD \xrightarrow{0} E,\ D \xrightarrow{1} A
  • E→0B, E→1CE \xrightarrow{0} B,\ E \xrightarrow{1} C

其中 EE 的輸出為 11,其餘狀態輸出皆為 00。

此設計可以正確處理重疊序列。例如輸入 01101100110110 時,第二次出現的 01100110 仍能被偵測。


(b) 是否可能少於 5 個狀態?

不可能。

五個狀態分別代表:

∅,0,01,011,0110\varnothing,\quad 0,\quad 01,\quad 011,\quad 0110

這些狀態兩兩皆可由某段後續輸入區分。例如:

  • AA 與 BB:輸入 110110 時,BB 可到達解鎖狀態,而 AA 不會。
  • BB 與 CC:輸入 1010 時,CC 可到達 EE,而 BB 不會。
  • CC 與 DD:輸入 00 時,DD 到 EE,而 CC 到 BB。
  • DD 與 EE:空輸入即可區分,因為 EE 的輸出為 11,DD 的輸出為 00。
  • 其他狀態間也可利用適當後續輸入,使其中一個到達 EE 而另一個不到達 EE。

根據有限狀態機最小化原理,若兩個狀態存在某段輸入序列會產生不同輸出,兩者便不可合併。因此最少需要:

5 個狀態\boxed{5\text{ 個狀態}}

(c) 未使用狀態的處理

五個狀態至少需要 33 個 D 觸發器,因為:

22<5≤232^2<5\leq 2^3

三個 D 觸發器共有 88 種狀態,其中有三種未使用狀態。

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 6 題20 分

Let C1C_1 and C2C_2 be two sequential circuits with states {S0,S1,S2,S3}\{S_0, S_1, S_2, S_3\} and {T0,T1,T2,T3}\{T_0, T_1, T_2, T_3\}, respectively, whose transitions are shown in the figure below.

🖼️【此處有附圖,請對照原卷】

(a) (5%) How many non-equivalent states are there in C1C_1? Which states are equivalent in C1C_1?
(b) (5%) How many non-equivalent states are there in C2C_2? Which states are equivalent in C2C_2?
(c) (5%) If C1C_1 and C2C_2 start from states S0S_0 and T0T_0, respectively, are these two circuits equivalent (in terms of input-output behavior)? If yes, briefly explain why. Otherwise, identify an input sequence that distinguishes C1C_1 and C2C_2.
(d) (5%) Redo (b) for C1C_1 and C2C_2 starting from states S0S_0 and T1T_1, respectively.

🖼️ 本題含圖表,以下為原卷對應頁面:
原卷第 2 頁

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考的是 Moore 狀態機的狀態等價與電路等價。圖中圓圈內的「狀態/數字」表示狀態名稱與該狀態的輸出,箭線上的數字表示輸入。

兩個狀態等價,必須滿足:

  1. 目前輸出相同。
  2. 對每一種輸入,其後繼狀態仍然等價。

因此,可以先依輸出分組,再依後繼狀態反覆細分,直到分組不再改變。若某個輸入序列使兩電路的輸出不同,該序列就是區分序列。

解題方法:讀圖與轉移表

原圖中,C1C_1 只有 S3S_3 的輸出為 11,C2C_2 只有 T2T_2 的輸出為 11。但 T1T_1 的自迴圈與 T1→T2T_1\to T_2 向下箭線都標示為 00,因此 T1T_1 在輸入 00 時有兩個後繼狀態,不符合確定性 Moore 狀態機的定義。

原題缺少的是 T1T_1 在輸入 00 時唯一的正確轉移。以下採用明確的修正假設:保留向下箭線 T1→0T2T_1\xrightarrow{0}T_2,將 T1T_1 的自迴圈視為多畫的箭線。此假設下的轉移表如下:

電路現態輸出輸入 00 的次態輸入 11 的次態
C1C_1S0S_000S2S_2S1S_1
C1C_1S1S_100S0S_0S3S_3
C1C_1S2S_200S0S_0S1S_1
C1C_1S3S_311S3S_3S2S_2
C2C_2T0T_000T0T_0T3T_3
C2C_2T1T_100T2T_2T0T_0
C2C_2T2T_211T2T_2T0T_0
C2C_2T3T_300T0T_0T2T_2

(a) C1C_1 的等價狀態

先依輸出分組:

P0={{S0,S1,S2},{S3}}.P_0=\bigl\{\{S_0,S_1,S_2\},\{S_3\}\bigr\}.

輸入 11 時,S1S_1 進入輸出為 11 的 S3S_3;S0S_0 與 S2S_2 都進入輸出為 00 的 S1S_1,所以 S1S_1 必須獨立成組:

P1={{S0,S2},{S1},{S3}}.P_1=\bigl\{\{S_0,S_2\},\{S_1\},\{S_3\}\bigr\}.

對 S0S_0 與 S2S_2:

  • 輸入 00:兩者的次態都落在 {S0,S2}\{S_0,S_2\}。
  • 輸入 11:兩者的次態都是 S1S_1。

分組不再改變,故

S0≡S2.S_0\equiv S_2.

因此,C1C_1 有 33 個非等價狀態類別。

(b) C2C_2 的等價狀態

在上述修正假設下,初始分組為

P0={{T0,T1,T3},{T2}}.P_0=\bigl\{\{T_0,T_1,T_3\},\{T_2\}\bigr\}.

比較輸出為 00 的三個狀態:

  • T1T_1 與 T0T_0:輸入 00 後,分別到達 T2T_2 與 T0T_0,輸出為 11 與 00。
  • T1T_1 與 T3T_3:輸入 00 後,分別到達 T2T_2 與 T0T_0,輸出為 11 與 00。
  • T0T_0 與 T3T_3:輸入 11 後,分別到達 T3T_3 與 T2T_2,輸出為 00 與 11。

三者彼此都不等價;T2T_2 的目前輸出又與三者不同。因此,C2C_2 有 44 個非等價狀態,沒有等價狀態對。

(c) 從 S0S_0 與 T0T_0 出發是否等價?

等價。 從 T0T_0 出發只能到達 T0,T3,T2T_0,T_3,T_2,不會到達 T1T_1,所以本小題不受 T1T_1 的圖面歧義影響。

將 C1C_1 的等價狀態合併,定義

A={S0,S2},B={S1},C={S3}.A=\{S_0,S_2\},\qquad B=\{S_1\},\qquad C=\{S_3\}.

其轉移與 C2C_2 的對應如下:

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

其他考古題