CONTACT | TEL : 02-728-3440, EMAIL : SALES@ASTRONLOGIC.COM
ASTRON LOGIC RESEARCH AND DEVELOPMENT CO.,LTD.

» WEBBOARD

ช่วยแก้ปัญหาให้ผมด้วยครับ

ผมทดลองออกแบบวงจร mux 2:1แบบstruct แต่ไม่ Work ครับช่วยแก้ไขข้อมูลให้ด้วยนะครับ
library ieee;
use ieee.std_logic_1164.all ;
entity mux is
port (in0,in1,sel:in std_logic;
output :out std_logic);
end mux;

architecture struct of mux is
component inv
port(i1 :in std_logic;
o1:out std_logic);
end component ;

component and2
port(i1,i2:in std_logic;
o1:out std_logic);
end component ;

component or2
port(i1,i2:in std_logic;
o1:out std_logic);
end component ;

signal int0,int1,int2:std_logic;
begin
go:inv
port map (i1 => sel, o1 => int0);
g1:and2
port map (i1 => in0,i2 => int0 ,o1 => int1);
g2:and2
port map ( i1 => sel,i2 => in1 ,o1 => int2);
g3: or2
port map (i1 => int1,i2 => int2,o1 => output);
end struct;


คือ ผมลองทำตามที่คุณได้ให้แนวคิดที่ว่า ให้นำโค็ดของ component ของอุปกรณ์ต่างๆที่เป็นส่วนประกอบของโปรแกรมข้างบนนี้ไว้ในห้องเดียวกันแล้ว โปรแกรมมันก็ยัง error เหมือนเดิมครับ โปรแกรมของอุปกรณ์ต่างๆมีดังนี้ครับ

โค็ดของ and2

library ieee ;
use ieee.std_logic_1164.all ;

entity and2 is
port (i1,i2:in std_logic;
o1 :out std_logic);
end and2;

architecture struct of and2 is
begin

o1 <= (i1 and i2);
end struct;




โค็ดของ inv
library ieee ;
use ieee.std_logic_1164.all ;
entity inv is
port (i1:in std_logic;
o1 :out std_logic);
end inv;
architecture struct of inv is
begin
o1 <= not(i1 );
end struct;
โค็ดของ or2
library ieee ;
use ieee.std_logic_1164.all ;
entity or2 is
port (i1,i2:in std_logic;
o1 :out std_logic);
end or2;
architecture struct of or2 is
begin
o1 <= (i1 or i2);
end struct;

ผมลองนำโค็ดของอุปกรณ์ทั้ง 3 ตัวนี้เก็บไว้ในห้องเดียวกันแล้วปรากฏว่ามัน error ขึ้นที่หน้าจอดังนี้ครับ

เกิดการ error 9
symbolic name “ i1” is not a port of “ and2 “ in a vhdl design file
symbolic name “ i2” is not a port of “ and2“ in a vhdl design file
symbolic name “ o1” is not a port of “ and2 “ in a vhdl design file
symbolic name “ i1” is not a port of “ and2 “ in a vhdl design file
symbolic name “ i2” is not a port of “ and2 “ in a vhdl design file
symbolic name “ o1” is not a port of “ and2 “ in a vhdl design file
symbolic name “ i1” is not a port of “ or2 “ in a vhdl design file
symbolic name “ i2” is not a port of “ or2 “ in a vhdl design file
symbolic name “ o1” is not a port of “ or2 “ in a vhdl design file


ผมขอรบกวนคุณช่วยแก้ไขรูปแบบของการทำงานแบบ structure นี้ให้ผมเพื่อเป็นวิทยาทานนะครับเพราะผมติดปัญหาในหัวข้อนี้ครับ

แต่ในตัวอย่างที่คุณส่งมาให้นั้น รันผ่านครับ ขอบคุณมากนะครับ



จากคุณ : ดิเรก ยาวิชัย ตั้งกระทู้นี้เมื่อ 13:58 [17/06/2003]

ความคิดเห็นที่1

ผมแนะนำว่าหากใช้วิธี Structure แล้วไม่ work ก็ลองเปลียนเป็นวิธีแบบอื่นดูนะครับ

จากคุณ : support@astronlogic.com 10:21 [18/06/2003]
ร่วมด้วยช่วยกันตอบครับ
ชื่อ :
E-Mail :
คำตอบ :







คลิกเพื่อแทรกรูป