[上課](https://hackmd.io/@k5rBU7VZTLajqBu9N1nr5g/BJ4qKb2hC)
# 可程式數位邏輯設計實習
### 0918
#### (1)電路圖

#### (2)波形模擬檔案

#### (3)晶片腳位規劃
腳位規劃||
-|-
A|1
B|8
F1|22
F2|23
F3|24
F4|27
#### (4)真值表、布林代數式
真值表
A|B|F1|F2|F3|F4
-|-|-|-|-|-
0|0|0|1|1|1
0|1|0|1|1|0
1|0|0|1|1|0
1|1|1|0|0|1
布林代數式||
-|-
F1|A×B
F2|barA+barB
F3|bar(A×B)
F4|bar(A⨁B)
#### (5)實際燒錄結果說明



#### (6)心得與反思
完全搞不懂這塊板子和Quartus II。我還是乖乖回去玩紅石電路好了。
### 0925
#### 題目一
1.電路圖

2.波形模擬檔案

3.
晶片腳位規劃|接腳編號
-|-
A|1
B|2
C|3
F1|22
F2|23
4.真值表、布林代數式
A|B|C|F1|F2
-|-|-|-|-
0|0|0|1|1
1|0|0|1|1
0|1|0|1|1
1|1|0|1|1
0|0|1|1|1
1|0|1|1|1
0|1|1|1|1
1|1|1|0|0
5.實際燒錄結果說明




6.問答題
(1)請說明單變數與多變數布林定理為何?
單變數布林代數針對一個變數的運算,多變數布林代數用多個變數
(2)請說明第摩根定理的應用為何?
簡化一切數位邏輯
#### 題目二
1.電路圖

2.波形模擬檔案

3.
晶片腳位規劃|接腳編號
-|-
A|1
B|2
C|3
F1|22
F2|23
4.
真值表(0低電位贊成,1高電位不贊成)
A|B|C|F1(贊成)|F2(不贊成)
-|-|-|-|-
0|0|0|0|1
1|0|0|0|1
0|1|0|0|1
1|1|0|1|0
0|0|1|0|1
1|0|1|1|0
0|1|1|1|0
1|1|1|1|0
布林代數式||
-|-
F1|AB+BC+AC
F2|bar(F1)
5.實際燒錄結果說明
### 1002
1.電路圖
HA

FA

2.波形模擬檔案
HA

FA

3.晶片腳位規劃

4.真值表、布林代數式
A|B|Cin|Cout|S
-|-|-|-|-
0|0|0|0|0
1|0|0|0|1
0|1|0|0|1
1|1|0|1|0
0|0|1|0|1
1|0|1|1|0
0|1|1|1|0
1|1|1|1|1
布林代數式||
-|-
C|A×B
S|A⨁B⨁C
5.實際燒錄結果說明
板子壞的不能燒
### 1113
#### 1.BCD加法器
```
--?
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_usigned.all;
use ieee.std_logic_arith.all;
--*****************************
--?
entity bcdadder is
port(--in
A :in std_logic_vector(3 downto 0);
B :in std_logic_vector(3 downto 0);
--out
S :out std_logic_vector(3 downto 0);
Co :out std_logic_vector
);
end bcdadder;
--*****************************
--?
architecture beh of bcdadder is
signal temp,sl :std_logic_vector(4 downto 0);
signal adj :std_logic_vector(4 downto 0);
begin
process(A,B)
begin
temp <= '0'&A + B;
if temp >9 then
adj <= 6;
else
adj <= 0;
end if;
s1 <= temp+ adj;
S <= s1;
Co <= s1(4);
end process;
end beh;
```
#### 3.多工器及解多工器
```
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity a02 is
port(
I:in std_logic_vector(3 downto 0);
S:in std_logic_vector(1 downto 0);
Y:out std_logic
);
end a02;
architecture beh of a02 is
begin
with S select
y <= I(0) when "00",
I(1) when "01",
I(2) when "10",
I(3) when others;
end beh;
```
### 12/4
```
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned;
use ieee.std_logic_arith;
entity w1204 is
port(
A :in std_logic;
B :in std_logic;
F1,F2,F3:out std_logic
);
end w1204;
architecture beh of w1204 is
begin
process(A,B)
begin
F1<='1';
F2<='1';
F3<='1';
if(A<B)then F1<='0';end if;
if(A=B)then F2<='0';end if;
if(A>B)then F3<='0';end if;
end process;
end beh;
```
```
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned;
use ieee.std_logic_arith;
entity w02 is
port(
i1 :in std_logic;
i2 :in std_logic;
i3 :in std_logic;
i4 :in std_logic;
i5 :in std_logic;
i6 :in std_logic;
i7 :in std_logic;
i8 :in std_logic;
i9 :in std_logic;
i0 :in std_logic;
a,b,c,d,e,f,g,Y1,Y0:out std_logic
);
end w02;
architecture beh of w02 is
begin
process(i1,i2,i3,i4,i5,i6,i7,i8,i9,i0)
begin
a<='0';b<='0';c<='0';d<='0';e<='0';f<='0';g<='1';
if(i0='1')then Y1<='1';Y0<='0';else Y1<='0';Y0<='1';end if;
if(i1='0')then a<='1';b<='0';c<='0';d<='1';e<='1';f<='1';g<='1';end if;
if(i2='0')then a<='0';b<='0';c<='1';d<='0';e<='0';f<='1';g<='0';end if;
if(i3='0')then a<='0';b<='0';c<='0';d<='0';e<='1';f<='1';g<='0';end if;
if(i4='0')then a<='1';b<='0';c<='0';d<='1';e<='1';f<='0';g<='0';end if;
if(i5='0')then a<='0';b<='1';c<='0';d<='0';e<='1';f<='0';g<='0';end if;
if(i6='0')then a<='0';b<='1';c<='0';d<='0';e<='0';f<='0';g<='0';end if;
if(i7='0')then a<='0';b<='0';c<='0';d<='1';e<='1';f<='1';g<='1';end if;
if(i8='0')then a<='0';b<='0';c<='0';d<='0';e<='0';f<='0';g<='0';end if;
if(i9='0')then a<='0';b<='0';c<='0';d<='0';e<='1';f<='0';g<='0';end if;
end process;
end beh;
```
------------------------輸入指撥開關--------------------------|----------------輸出------------------
-|-
--------------------------優先編碼器----------------------------|顯示控制|七段顯示器
-|-|-
9|8|7|6|5|4|3|2|1|------0------|十位|個位
-|-|-|-|-|-|-|-|-|-|-|-
1|0|0|0|1|0|0|0|0|1|9|
0|0|0|0|1|0|0|0|0|0||5
0|0|0|0|0|0|0|0|0|1|0|
0|0|1|0|0|0|0|0|1|1|7|
0|0|0|0|0|0|1|0|0|0||3
0|0|0|1|0|1|0|0|0|0||6
### 12/11
#### 評分題目一
1.電路圖
2.波形模擬檔案
3.真值表、特徵方程式
#### 評分題目二
1.電路圖
2.波形模擬檔案
3.真值表、特徵方程式
4.製作成電路符號(2)
### 12/18
```
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity CH7_5 is
port( GCKP18,RSTP61: in std_logic;
f1, f2: out std_logic);
end CH7_5;
architecture Nina of CH7_5 is
signal FD:std_logic_vector (25 downto 0);
constant Fs1:integer range 0 to 32:=6;
constant Fs2:integer range 0 to 32:=22;
begin
f1<=FD(Fs1);
f2<=FD(Fs2);
process (GCKP18, RSTP61)
begin
if RSTP61='0' then
FD<=(FD'range=>'0');
elsif rising_edge (GCKP18) then
FD<=FD+1;
end if;
end process;
end Nina;
```
### 12/25🎄
#### 評分題目二:MOD 16 T型非同步上數計數器
1.電路圖
2.波形模擬檔案
#### 評分題目三:7490設計MOD10上數計數器
1.電路圖
2.波形模擬檔案