Oh! You closed up the window, so you cannot see raining

[Logic Design] Lec 01 - 數字系統與轉換

數位系統與開關電路 在現實世界中,資訊是以類比(Analog)的方式傳遞的,換言之,資訊是連續的 在電腦世界中,資訊是以數位(Digital)的方式傳遞的,也就是開與關或是0或1。 A/D <-> DSP(digital signal processor) <-> D/A Switching Circuit 可分為三個層級: System: 模組Modules、算術運算單元 ALU(Arithmetic logic unit)、記憶體 Memory Logic:邏輯閘(gates) Circuit:電晶體(transistors) 經由 switching network 的設計,可將輸入轉成合乎 spec 的輸出。其中 switching network 的種類包含: Combinational network 輸出是輸入的函數,且表達當下的值。 Sequential network 輸出是輸入的函數,可以表達當下的值或是過去的值。 具有記憶體的行為 Switches 由電晶體來實現 transistor level, gate level, module level… 數字系統與轉換 在現實世界中,最普遍使用的數字系統為十進制(Decimal) 然而在電腦世界中,因為只有代表開與關的 0 與 1,故使用的數字系統是以二進制(Binary)為基礎。 \(N=(a_2a_1a_0)_R=a_2\times R^2+a_1\times R^1+a_0\times R^0\) 負數 N 正數表示 -N 正數加負號 1的補數 2的補數 +0 0000 -0 1000 1111 N/A +1 0001 -1 1001 1110 1111 +2 0010 -2 1010 1101 1110 +3 0011 -3 1011 1100 1101 +4 0100 -4 1100 1011 1100 +5 0101 -5 1101 1010 1011 +6 0110 -6 1110 1001 1010 +7 0111 -7 1111 1000 1001 +8 N/A -8 N/A N/A 1000 二進制算數 當兩數相加或兩數相減時,超過可用bits數時會發生overflow, 例如-3+-4=-4是OK的 但-5+-6=-11會產生溢位 二進制的表達方式 Binary codes Decimal Digit 8421 Code(BCD) 6311 Code Excess-3 Code 2-out-of-5 Code Gray Code 0 0000 0000 0011 00011 0000 1 0001 0001 0100 00101 0001 2 0010 0011 0101 00110 0011 3 0011 0100 0110 01001 0010 4 0100 0101 0111 01010 0110 5 0101 0111 1000 01100 1110 6 0110 1000 1001 10001 1010 7 0111 1001 1010 10010 1011 8 1000 1011 1011 10100 1001 9 1001 1100 1100 11000 1000 Weighted Codes 8421 Code 與 6311 都是 Weighted Code,代表每4個bit,各自代表的數字, 例:1011 for 8421 = 8 + 0 + 2 + 1 = 11 例:1011 for 6311 = 6 + 0 + 1 + 1 = 8 Excess-3 Codes Excess-3 是以 8421 Code 為基礎下,額外加 3。 使得 i 與 10-i 互為 1 的補數, 0 與 9 為補數。(0011 與 1100) 1 與 8 為補數。(0100 與 1011) 2 與 7 為補數。(0101 與 1010) 3 與 6 為補數。(0110 與 1001) 4 與 5 為補數。(0111 與 1000) Gray Codes 兩相鄰的數只會相差一個 bit 又名 Reflected Binary Codes(RBC)、Unit distance code、Minimum error code 可以減少 switching operation 如何轉換 Gray Code?...

<span title='2021-09-18 03:11:35 +0800 +0800'>September 18, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;Rain Hu
Oh! You closed up the window, so you cannot see raining

[Logic Design] Lec 02 - 布林代數

基本邏輯運算 Logic Gates Not Gates Symbol Truth Table \( \def\arraystrecth{1.5}\begin{array}{|c|c|}\hline \text{X}&\overline{\text{X}}\text{or}\text{X’}\\\hline 0&1\\\hline 1&0\\\hline \end{array} \) And Gates Symbol Truth Table \( \def\arraystrecth{1.5}\begin{array}{|c|c|c|}\hline \text{X}&\text{Y}&\text{Z=X}\cdot\text{Y}\\\hline 0&0&0\\\hline 0&1&0\\\hline 1&0&0\\\hline 1&1&1\\\hline \end{array} \) Or Gates Symbol Truth Table \( \def\arraystrecth{1.5}\begin{array}{|c|c|c|}\hline \text{X}&\text{Y}&\text{Z=X+Y}\\\hline 0&0&0\\\hline 0&1&1\\\hline 1&0&1\\\hline 1&1&1\\\hline \end{array} \) 布林表達式與真值表(Boolean Expression and Truth Table) Boolean expression 用 ' 代表 NOT 用 + 代表 OR 用 . 代表 AND 將輸入用上面的運算子表示成算式,如:\((A+C)(B’+C)\) Truth Table \( \def\arraystrecth{1.5}\begin{array}{ccc|cccccc} A&B&C&B’&AB’&AB’+C&A+C&B’+C&(A+C)(B’+C)\\\hline 0&0&0&1&0&0&0&1&0\\ 0&0&1&1&0&1&1&1&1\\ 0&1&0&0&0&0&0&0&0\\ 0&1&1&0&0&1&1&1&1\\ 1&0&0&1&1&1&1&1&1\\ 1&0&1&1&1&1&1&1&1\\ 1&1&0&0&0&0&1&0&0\\ 1&1&1&0&0&1&1&1&1\\ \end{array} \) 基本運算定理 NOT gate 的基本運算定理 \( \boxed{ \def\arraystretch{1....

<span title='2021-09-18 03:11:35 +0800 +0800'>September 18, 2021</span>&nbsp;·&nbsp;3 min&nbsp;·&nbsp;Rain Hu
Oh! You closed up the window, so you cannot see raining

[Logic Design] Lec 03 - Minterm 與 Maxterm 展開

布林表達式的轉換 將文字敘述轉換成布林表達式: \( \def\arraystrecth{1.5}\begin{array}{l} \underbrace{\text{The alarm will ring}}_ {Z} \text{ iff } \underbrace{\text{the power of alarm is on}} _{A} \text{ and } \underbrace{\text{the door is not closed}} _{B’} \\ \text{ or } \underbrace{\text{it is after 6 p.m.}} _{C} \text{ and } \underbrace{\text{the window is not closed}} _{D’} \end{array} \) \(Z=AB’+CD’\) 由真值表開始建構邏輯電路 Truth Table: \( \boxed{ \def\arraystretch{1}\begin{array}{ccc|c|c} A&B&C&f&f’\\\hline 0&0&0&0&1\\ 0&0&1&0&1\\ 0&1&0&0&1\\ 0&1&1&1&0\\ 1&0&0&1&0\\ 1&0&1&1&0\\ 1&1&0&1&0\\ 1&1&1&1&0 \end{array} } \) 利用 1’s 的函數...

<span title='2021-09-18 03:11:35 +0800 +0800'>September 18, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;Rain Hu
Oh! You closed up the window, so you cannot see raining

[Logic Design] Lec 04 - 卡諾圖 Karnaugh Maps

布林邏輯式的簡化 卡諾圖(Karnaugh Maps, K-maps)是一種簡單、快速的簡化布林邏輯的方法。 SOP 將布林邏輯化簡成最簡SOP(Minimum Sum of products) \(F=A’ B’ C’+A’ B’ C+A’ BC’+AB’ C+ABC’ +ABC\) \(F=A’ B’+B’ C+BC’+AB\) \(F=A’ B’+BC’+AC\) POS 將布林邏輯化簡成最簡POS(Minimum Product of Sums) \(F=(A+B’+C+D’)(A+B’+C’+D’)(A+B’+C’+D)(A’+B’+C’+D)(A+B+C’+D)(A’+B+C’+D)\) \(F=(A+B’+D’)(A+B’+C’)(B’+C’+D)(B+C’+D)\) \(F=(A+B’+D)(A+B’+C’)(C’+D)\) \(F=(A+B’+D’)(C’+D)\) 2或3個變數的卡諾圖 簡化2個變數的布林邏輯式 \(F=A’ B’+A’ B\) 布林代數: \(F=A’ B’+A’ B=A’(B’+B)=A’\) 卡諾圖: \( \boxed{ \def\arraystretch{1.4}\begin{array}{c|c|c} \downarrow B\rightarrow A&0&1&\\\hline 0&\text{A=0,B=0}&\text{A=1,B=0}\\\hline 1&\text{A=0,B=1}&\text{A=1,B=1}\\ \end{array} } \rightarrow \boxed{ \def\arraystretch{1.4}\begin{array}{c|c|c} &A’&A&\\\hline B’&1&0\\\hline B&1&0\\ \end{array} } \rightarrow A' \) 簡化3個變數的布林邏輯式 \(F=\sum m(2,3,6)=A’ BC’+A’ BC+ABC’\) 布林代數: \(F=A’ BC’+A’ BC+ABC’=A’ B+BC’\) 卡諾圖:*注意相鄰以grey code排列 \( \boxed{ \def\arraystretch{1....

<span title='2021-09-18 03:11:35 +0800 +0800'>September 18, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;Rain Hu
Oh! You closed up the window, so you cannot see raining

[Logic Design] Lec 05 - Quine-McClusky Method

概要 當變數愈來愈多時,很難依靠人眼判斷,所以必須計設系統化的簡化過程讓電腦運行。 系統化的簡化過程 輸入:minterm expansion 輸出:minimum SOP 步驟: 找出所有質函項,並試著將和項消除到不能再消,利用\(XY+XY’=X\) 利用質函項圖找出最小解 範例:\(F(a,b,c)=a’ b’ c’ + ab’ c’+ab’ c+ abc\) \( \boxed{ \def\arraystretch{1.4}\begin{array}{c|c|c|c|c} &a’ b’&a’ b&ab&ab’\\\hline c’&1&&&1\\\hline c&&&1&1 \end{array} } \) 所有蘊函項:\(a’ b’ c’, ab’ c’, ab’ c, abc, ab’, b’ c’, ac\) 質函項:\(ab’, b’ c’, ac\) 基本質函項:\(b’ c’, ac\) Min SOP:\(F(a,b,c)=b’ c’+ac\) 決定質函項(prime implicants) 找出所有質函項 將每個 minterm 以二進制表示。 統計每個項的1的數量作為 index 並分群。 將分完群的 minterm 以 index 排列。 從 index 最小開始,往 index + 1 的群,尋找可以用\(XY+XY’=X\)簡化的組合 檢查所有的項都合併成組合,留下來的項即為質函項。 重複步驟 4 到 步驟 5 直到沒有函項可以合併。...

<span title='2021-09-18 03:11:35 +0800 +0800'>September 18, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;Rain Hu