大学EDA and verilog考试复习题
if(reset) begin q<=0; qn<=1;
end //同步清零,高电平有效
else if(set) begin q<=1; qn<=0; end //同步置数,高电平有效
else begin q<=d; qn<=~d; end end endmodule 六. 异步清0,异步置1的D触发器(异步敏感信号有多个) module jy(q,qn,d,set,reset,clk); input d,set,reset,clk; output q,qn; reg q,qn; always @(posedge clk or negedge set or negedge reset) begin if(!reset) begin q<=0; qn<=1; end //异步清零,低电平有效
else if(!set) begin q<=1; qn<=0; end //异步置数,低电平有效
else begin q<=d; qn<=~d; end end endmodule 七. 求累加

和

++……

+(n<20)
(1+2+3+……+n同理)
module add(n,sum,clk); input [4:0] n; input clk; output [31:0] sum; reg [31:0] sum; integer [4:0] i; always @(posedge clk) //除毛刺
begin sum=0; for(i=0;i<=20;i=i+1) if(i<=n) sum=sum+i*i; end endmodule 八. Case语句的应用 ,用case语句实现
基本的门电路
module alu(out,opcode,a,b); input [2:0] opcode; input [7:0] a,b; output [7:0] out;
reg [7:0] out; always @(opcode or a or b) begin case(opcode) 0: out=a+b; //加 1: out=a-b; //减
2: out=a&b; //按位与 3: out=a|b; //按位或 4: out=~a; //按位取反 default: out=8’bx; //未收到指令时,输出任意值 endcase end endmodule
九.并行输入串行输出
module test1(clk,shift_en,load,d_in,shift_out);
input clk, shift_en, load; input[9:0]d_in; output shift_out; wire clk;
wire shift_en;
wire load; wire [9:0]d_in; wire shift_out; reg [9:0] shift_reg; always @(posedge clk) begin if(load == 1'b 1) begin
shift_reg <= d_in; end
else if(shift_en == 1'b 1) begin shift_reg[9:1] <= shift_reg[8:0]; shift_reg[0] <= 1'b 0;
end
end
assign shift_out = shift_reg[9]; endmodule 十.串行输入并行输出
Verilog复习题_从业资格考试_资格考试/认证_教育专区。Verilog 复习题一、填空题 1. 用 EDA 技术进行电子系统设计的目标是最终完成 ASIC 的设计与实现。 2. 可...
Verilog 复习题一、填空题 1. 用 EDA 技术进行电子系统设计的目标是最终完成_ ASIC 的设计与实现。 2. 可编程器件分为 _CPLD_和__FPGA__。 3. 随着 EDA ...
EDA技术与verilog语言练习题_IT/计算机_专业资料。关于EDA技术与verilog语言一些简单的练习题,有助于对verilog语言编程的了解。设计示范和上机习题练习一.简单的组合...
EDA期末考试题A卷 5页 免费 Verilog复习题 暂无评价 6页 免费 EDA技术实用... and(m1,a,b), (m2,b,cin),(m3,a,cin); xor(s1,a,b),(sum,s...
Verilog复习题_电子/电路_工程科技_专业资料。Verilog 复习题一、填空题 1. 用 EDA 技术进行电子系统设计的目标是最终完成___的设计与实现。 2. 可编程器件...
EDA复习提纲 Verilog 隐藏>> 1.8 选 1 数据选择器 module MUX81a(a,b,c,d,e,f,g,h,s2,s1,s0,y); input a,b,c,d,e,f,g,h,s2,s1,s0;...
Verilog 复习题一、填空题 1. 用 EDA 技术进行电子系统设计的目标是最终完成_...aibi 由输入输出逻辑表达式,采用与门 and 和异或门 xor 进行结构描述的程序如下...
eda_Verilog技术复习内容_理学_高等教育_教育专区。可编程逻辑器件及EDA技术总...module AND_G2(a,b,f); //模块名 input a,b; //端口说明 output f; ...
EDA技术实用教程-Verilog(... 22页 免费 数字电路EDA技术复习资料 10页 免费...(a OR b)AND(a NAND b); 4 END ARCHITECTURE fh1; 五、请按题中要求...
EDA技术与verilog语言练习... 17页 5财富值 《EDA技术与Verilog HDL》... ...(TP1,A,B); /*用门级电路可以*/ //and(TP2,C,D); assign TP1=A...
热门文档