WU-YANG Technology Co., Ltd. SIOC 實驗3:Timer 楊郁莉/陳慶瀚 MIAT實驗室.
陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.
-
Upload
derek-watkins -
Category
Documents
-
view
246 -
download
0
Transcript of 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.
![Page 1: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/1.jpg)
陳慶瀚國立中央大學資工系2014 年 4 月 16日
A2 VHDL Combinational Logic Design
![Page 2: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/2.jpg)
Decoder
![Page 3: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/3.jpg)
Decoder
![Page 4: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/4.jpg)
Encoder
![Page 5: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/5.jpg)
Priority Encoder
![Page 6: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/6.jpg)
8-3 Priority EncoderENTITY ENCODER8_3 ISPORT ( ENABLE: IN STD_LOGIC;
D_IN: IN STD_LOGIC_VECTOR(7 DOWNTO 0); D_OUT: OUT STD_LOGIC_VECTOR(2 DOWNTO 0) );
END ENCODER8_3;ARCHITECTURE ENCODER_ARCH OF ENCODER8_3 ISBEGIN
PROCESS(ENABLE,D_IN)BEGIN
IF ( ENABLE = '1') THEND_OUT <= "000";
ELSECASE D_IN ISWHEN "00000001" => D_OUT <= "000";WHEN "0000001X " => D_OUT <= "001";WHEN "000001XX " => D_OUT <= "010";WHEN "00001XXX " => D_OUT <= "011";WHEN "0001XXXX " => D_OUT <= "100";WHEN "001XXXXX " => D_OUT <= "101";WHEN "01XXXXXX" => D_OUT <= "110";WHEN "1XXXXXXX" => D_OUT <= "111";WHEN OTHERS => NULL;END CASE;END IF;
END PROCESS;END ENCODER_ARCH;
![Page 7: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/7.jpg)
Multiplexer
![Page 8: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/8.jpg)
8-to-1 Multiplexer Implementation
3-to-8 decoder + AND/OR gate
![Page 9: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/9.jpg)
VHDL: 8-to-1 Multiplexer
![Page 10: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/10.jpg)
Tri-state Buffer
![Page 11: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/11.jpg)
1-bit full adder
![Page 12: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/12.jpg)
1-bit full adder
![Page 13: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/13.jpg)
VHDL : 4-bit ripple-carry adder
![Page 14: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/14.jpg)
VHDL : 4-bit ripple-carry adder(cont.)
![Page 15: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/15.jpg)
ex : 8-bit ripple-carry adder
![Page 16: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/16.jpg)
Carry-Lookahead Adder
![Page 17: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/17.jpg)
Carry-Lookahead Adder
![Page 18: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/18.jpg)
VHDL: 8-bit Carry-Lookahead AdderENTITY c_l_addr IS PORT ( x_in : IN STD_LOGIC_VECTOR(7 DOWNTO 0); y_in : IN STD_LOGIC_VECTOR(7 DOWNTO 0); carry_in : IN STD_LOGIC; sum : OUT STD_LOGIC_VECTOR(7 DOWNTO 0); carry_out : OUT STD_LOGIC );END c_l_addr;
ARCHITECTURE behavioral OF c_l_addr IS
SIGNAL h_sum : STD_LOGIC_VECTOR(7 DOWNTO 0);SIGNAL carry_generate : STD_LOGIC_VECTOR(7 DOWNTO 0);SIGNAL carry_propagate : STD_LOGIC_VECTOR(7 DOWNTO 0);SIGNAL carry_in_internal : STD_LOGIC_VECTOR(7 DOWNTO 1);
BEGIN h_sum <= x_in XOR y_in; carry_generate <= x_in AND y_in; carry_propagate <= x_in OR y_in; PROCESS (carry_generate,carry_propagate,carry_in_internal) BEGIN carry_in_internal(1) <= carry_generate(0) OR (carry_propagate(0) AND carry_in); inst: FOR i IN 1 TO 6 LOOP carry_in_internal(i+1) <= carry_generate(i) OR (carry_propagate(i) AND carry_in_internal(i)); END LOOP; carry_out <= carry_generate(7) OR (carry_propagate(7) AND carry_in_internal(7)); END PROCESS;
sum(0) <= h_sum(0) XOR carry_in; sum(7 DOWNTO 1) <= h_sum(7 DOWNTO 1) XOR carry_in_internal(7 DOWNTO 1);END behavioral;
![Page 19: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/19.jpg)
VHDL : 8-bit adder / subtractor
![Page 20: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/20.jpg)
VHDL : 8-bit adder / subtractor
![Page 21: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/21.jpg)
VHDL : 8-bit adder / subtractor
![Page 22: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/22.jpg)
4-bit ALU提示:--使用 process--使用 CASE-WHEN語法請模擬出以下波形:
![Page 23: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/23.jpg)
4-bit ALU提示:--使用 process--使用 CASE-WHEN語法請模擬出以下波形:
![Page 24: 陳慶瀚 國立中央大學資工系 2014 年 4 月 16 日 A2 VHDL Combinational Logic Design.](https://reader033.fdocuments.net/reader033/viewer/2022061605/5697c0191a28abf838cce5df/html5/thumbnails/24.jpg)
VHDL : 4-bit ALU