集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 10515|回复: 3

fpga程序

[复制链接]
ATA 发表于 2010-6-28 00:52:13 | 显示全部楼层 |阅读模式
module shifter(ce,din,clk,clr,load,sload,pdin,dout,sdout) ;
input din,clk,ce,clr;
input load,sload;
input[23:0] pdin;
output sdout;
reg sdout;
output[35:0] dout;
reg[35:0] dout,outreg;
reg[23:0] inreg,shiftreg;

//以下为24位的并串转换, load为输入锁存信号,上升沿有效。sload为移位寄存器数据置位信号,低有效,此时将输入寄存器中的数据
置入移位寄存器。为复位信号,低有效
always @(negedge clr or posedge load or posedge clk or negedge sload)
begin
  if(!clr)
   begin shiftreg<=24'h000;  dout<=1'b0; end  复位信号为低时,移位寄存器置0串出?
      else if (!sload)
     begin shiftreg<=inreg;  dout<=1'b1; end //   
   
   else if(load)
         begin inreg<=pdin;dout<=1'b0;     end   
        else
         begin
       shiftreg<=shiftreg>>1;
         sdout<=shiftreg[0];
     end
end



//以下为36位的串并转换, ce为输出锁存信号,低有效,此时将移位寄存器中的数据置入输出端。clr为复位信号,低有效。
always @(posedge clk or negedge clr or negedge ce)
begin
if(!clr)
   
   dout<=36'h0;
     else if (!ce)
      begin
         dout<=outreg;
   end
  else
     begin
     outreg<=outreg<<1;
       outreg[0]<=din;
     end
end

endmodule

Synplify Pro 7.6.1综合时有以下错误,无法继续
@E: CL123: myfile.v(12): The logic for shiftreg[23:0] does not match a standard flip-flop @E:"d:\mycpld\myfile.v":12:0:12:6

xilink ise9.1ixst综合时有以下错误,无法继续
ERROR:Xst:2089 - "myfile.v" line 12: This sensitivity list construct will match none of the supported FF or Latch templates.
ICE 发表于 2010-6-28 02:04:34 | 显示全部楼层
做成同步电路 看看
encounter 发表于 2010-6-28 03:14:03 | 显示全部楼层
不行啊,控制信号是异步的。原来是3个NJM3714和3个HC597。现在我想用一片95144实现
Sunlife 发表于 2015-7-5 21:03:51 | 显示全部楼层
做成同步电路 看看
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-5-6 13:02 , Processed in 0.062302 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表