hercool
دوشنبه 27 آذر 1391, 17: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;
منتظر راهنماییتون هستم نمی دونم کجا مشکل هست
من یه مشکل در پیاده سازی فلیپ فلاپ ها دارم اویلین بار می خوام از 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;
منتظر راهنماییتون هستم نمی دونم کجا مشکل هست