ขั้นตอนที่ 1
เราจะสร้าง VHDL Module 3 Module ประกอบด้วย :
- Arithmetic_Unit
- Logic_Unit
- Mux
Arithmetic_Unit
Logic_Unit
Mux
ทุกๆ Module ต้อง Create Schematic Symbol ด้วยเหมือนที่เคยทำใน Lab ก่อนๆ
ขั้นตอนที่ 2
สร้าง Schematic File ตั้งชื่อไฟล์ว่า combine แล้วต่อวงจรตามที่เราสร้าง Module
มาแล้วตั้งชื่อ I/O (Pin )
ขั้นตอนที่ 3
เราจะทำการ Simulation ในโปรแกรม Xilinx เลย เพราะเนื่องจากใช้ Pin ค่อนข้างเยอะ
ทำการ New Source -> ครั้งนี้จะเลือก VHDL Test Bench ตั้งชื่อ อะไรก็ได้
ต่อมาเลือกไฟล์ Schematic ที่เรา New source หรือสร้างมาก่อนหน้าในที่นี้ผมตั้งชื่อ Schematic ว่า combine
ต่อมาเลือกไฟล์ Schematic ที่เรา New source หรือสร้างมาก่อนหน้าในที่นี้ผมตั้งชื่อ Schematic ว่า combine
ขั้นตอนที่ 4
เราจะทำการเขียน Code Simulation ดั้งนี้ ในไฟล์ VHDL Test Bench : T_combine
กรณีหาไฟล์ VHDL Test Bench : T_combine ไฟล์เจอะ ให้ Switch Mode ตรง view ไปที่ Simulation
กรณีหาไฟล์ VHDL Test Bench : T_combine ไฟล์เจอะ ให้ Switch Mode ตรง view ไปที่ Simulation
ขั้นตอนที่ 5
ทำการ Run : Behavioral Check Syntax แล้ว Simulate Behavioral Mode
ขั้นตอนที่ 6 ทำการตรวจสอบ Input / Output ที่ป้อนให้กลับวงจรว่าถูกต้องรึไม่ โดยใน Code ทดสอบ Arithmetic Input A = 1000 และ B = 0001 ตรวจสอบ S Mode(arith_s) และ Ci(Carry In) ด้วย S_Mode(arith_s) 00 = A + B + Carry In S_Mode(arith_s) 01 = A - B + Carry In S_Mode(arith_s) 10 = A - 1 + Carry In S_Mode(arith_s) 11 = A + 1 + Carry In Logic Input A = 1000 และ B = 0111 S_Mode(and) 00 = 0000 S_Mode(or) 01 = 1111 S_Mode(not a) 10 = 0111 S_Mode(xor) 11 = 1111
ขั้นตอนที่ 6 ทำการตรวจสอบ Input / Output ที่ป้อนให้กลับวงจรว่าถูกต้องรึไม่ โดยใน Code ทดสอบ Arithmetic Input A = 1000 และ B = 0001 ตรวจสอบ S Mode(arith_s) และ Ci(Carry In) ด้วย S_Mode(arith_s) 00 = A + B + Carry In S_Mode(arith_s) 01 = A - B + Carry In S_Mode(arith_s) 10 = A - 1 + Carry In S_Mode(arith_s) 11 = A + 1 + Carry In Logic Input A = 1000 และ B = 0111 S_Mode(and) 00 = 0000 S_Mode(or) 01 = 1111 S_Mode(not a) 10 = 0111 S_Mode(xor) 11 = 1111
ไม่มีความคิดเห็น:
แสดงความคิดเห็น