云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 11年全志科技数字IC笔试题解答(只有最后两题) - 图文

11年全志科技数字IC笔试题解答(只有最后两题) - 图文

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 6:41:38

8位数逻辑左移,位数由shift[2:0]决定 代码:

module Verilog1(inp,outp,shift); input [7:0] inp; input [2:0] shift; output reg [7:0] outp;

always

begin

outp=inp<

module Verilog1(da,wra_n,clka,clkb,rst_n,wrb,db); input da,wra_n,clka,clkb,rst_n; output reg wrb; output reg [7:0] db; reg [7:0] full=8'b00000000; reg [7:0] out=8'b00000000; always @(posedge clka) begin if(full==8'b11111111) full=8'b00000000; if(wra_n==1'b0) begin case(full) 8'b00000000:begin out[7]=da;full=8'b10000000;end 8'b10000000:begin out[6]=da;full=8'b11000000;end 8'b11000000:begin out[5]=da;full=8'b11100000;end 8'b11100000:begin out[4]=da;full=8'b11110000;end 8'b11110000:begin out[3]=da;full=8'b11111000;end 8'b11111000:begin out[2]=da;full=8'b11111100;end 8'b11111100:begin out[1]=da;full=8'b11111110;end 8'b11111110:begin out[0]=da;full=8'b11111111;end default:full=8'b01010101; endcase end end

always @(posedge clkb) begin if(!rst_n) begin wrb=1'b0;db=8'b00000000;end else begin db=8'bxxxxxxxx; if(full==8'b11111111) begin db=out;wrb=1'b1;end else begin wrb=1'b0;db=8'bxxxxxxxx;end end end

endmodule

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

8位数逻辑左移,位数由shift[2:0]决定 代码: module Verilog1(inp,outp,shift); input [7:0] inp; input [2:0] shift; output reg [7:0] outp; always begin outp=inp<

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com