Presentation is loading. Please wait.

Presentation is loading. Please wait.

Agenda 目標與概述 (purpose) 架構 (structure) 流程 (procedure) 成果 (result)

Similar presentations


Presentation on theme: "Agenda 目標與概述 (purpose) 架構 (structure) 流程 (procedure) 成果 (result)"— Presentation transcript:

1

2 Agenda 目標與概述 (purpose) 架構 (structure) 流程 (procedure) 成果 (result)

3 Purpose 學習目標: 學習 VHDL 標準規格與語法,以及相關輔助工具 Xilinx ISE ,並參與教育部大專院校積體電路設計 FPGA 組之比 賽。 專題概述: 此專題為直角三角形之直角座標轉譯系統,可將直角三 角形的三個頂點座標 (x1,y1),(x2,y2),(x3,y3) 轉譯,依續 輸出涵蓋於直角三角形平面內的所有座標點。

4 Structure 虛擬碼:

5 Procedure 轉譯流程: (1) 設定直角三角形座標 。 (2) 基準點從左下角開始,由左至右依序 trace 每個座標點 。 (3) 檢查是否超過右邊界,若尚未超過,則將該座標點儲 存,若超過則基準點往上 shift 一個單位 。 (4) 檢查是否超過上邊界,若尚未超過則持續往右 trace , 若超過則結束 trace ,即完成轉譯。 (5) 依序輸出每個座標點 。

6 State Diagram

7 Code (input/output) entity triangle is Port ( reset : in STD_LOGIC; clk : in STD_LOGIC; xi : in STD_LOGIC_VECTOR (2 downto 0); yi : in STD_LOGIC_VECTOR (2 downto 0); nt : in STD_LOGIC; busy : out STD_LOGIC; po : out STD_LOGIC; xo : out STD_LOGIC_VECTOR (2 downto 0); yo : out STD_LOGIC_VECTOR (2 downto 0)); end triangle;

8 Code when mvr => xo <= xc; yo <= yc; po <= '1'; xc <= xc + 1; side <= (x2-xc)*(y3-y2)- (yc-y2)*(x2-x3); if side(7)='1' then xc <= x1; yc <= yc + 1; state_next <= mvu; end if;

9 Code (cont.) when mvu => xo <= xc; yo <= yc; xc <= xc + 1; side <= (x2-xc)*(y3-y2)- (yc-y2)*(x2-x3); if yc=y3 then state_next <= stop; elsif side(7)='1' then xc <= x1; yc <= yc + 1; state_next <= mvu; else state_next <= mvr; end if;

10 Result RTL Schematic Diagram (1) 系統方塊:

11 Result RTL Schematic Diagram (2) :

12 Result RTL Schematic Diagram (3) :


Download ppt "Agenda 目標與概述 (purpose) 架構 (structure) 流程 (procedure) 成果 (result)"

Similar presentations


Ads by Google