PDA

View Full Version : سوال: پیاده سازی فلیپ فلاپ ها در زبان vhdl



hercool
دوشنبه 27 آذر 1391, 16:37 عصر
سلام خدمت دوستان
من یه مشکل در پیاده سازی فلیپ فلاپ ها دارم اویلین بار می خوام از process در زبان vhdl استفاده کنم برای همین گیچ شدم
می خوام فلیپ فلاپ ها رو بر اساس فلیپ فلاپ d پیاده سازی کنم اما درست نمیشه کد ها رو می زارم یکیش رو راهنمایی کنید چه sr چه jk چه t ممنون میشم
با نرم افزار modelsim کار می کنم
entity dff is
port(d,clk:in bit;q:out bit);
end entity;
architecture behavioral of dff is
begin
process (clk,d)
begin
if clk'event and clk='1'
then
q<=d;
end if;
end process;
end architecture;


این dff که درست کار می کنه
حالا برای sr که مشکل دارم
entity sr is
port(d,s,r,clk:in bit;q:out bit);
end entity;
architecture behavioral of sr is
component dff is
port(d,clk:in bit;q:out bit);
end component;
begin
srrr:process (clk,d)
begin
if clk'event and clk='1'

then q<=r;else q<=s;

end if;
end process;
end behavioral;

و
entity srdff is
port(clk,s,r:in bit;q:out bit);
end entity;
architecture behavioral of srdff is
component dff is
port(d,clk:in bit;q:out bit);
end component;
begin
alt1:process (clk,r)
begin
if clk'event and clk='1'
then
q<=r;
end if;
end process;
alt2:process (clk,s)
begin
if clk'event and clk='1'
then
q<=s;
end if;
end process;
end architecture;


منتظر راهنماییتون هستم نمی دونم کجا مشکل هست

hercool
جمعه 01 دی 1391, 20:15 عصر
کسی از دوستان اطلاعی نداره یه جا خوندم با active hdl میشه کدش رو گرفت و در برنامه های دیگه نوشت ولی من نرم افزار رو ندارم ؟
process ها رو هم نمیشه به صورت تو در تو استفاده کرد موازی کار می کنن نمی دونم چجوری باید پیاده سازیش کنم
کسی نمیتونه کمک کنه؟
خود tff رو اینجور پیاده سازی می کنیم اما با d نمی دونم
مشکلم استفاده از یه process به صورت تودرتو هست فقط می دونم که موازی کار می کنن ولی نمی دونم چجوری ارتباطشون بدم به هم
entity tff is
port(t,clk:in bit;q:out bit);
end entity;
architecture bihavioral of tff is
signal s:bit;
begin
q<=s;
process (clk,t)
begin
if clk'event and clk='1' then
s<=s xor t;
end if;
end process;
end architecture;