09 2022 档案
摘要:2 Verilog语言 2.5 更多特点 2.5.1 三元运算符 (condition ? if_true : if_false) 判断a,b,c,d中的最小值 module top_module ( input [7:0] a, b, c, d, output [7:0] min); wire [
阅读全文
摘要:2 Verilog语言 2.4 程序 2.4.5 Always case 当可能的情况较多时,适合使用 case 语句而非 if-else 语句 case 语句以 case 开头,每个 case 项以冒号结束 case 项后的执行语句可以是单条,也可以是多条,但多条需要用 begin-end 进行说
阅读全文
摘要:2 Verilog语言 2.4 程序 2.4.1 Always 模块1 组合逻辑:always @(*) 时序逻辑:always @(posedge clk) 对于组合逻辑电路,一般会用 * 代替所有输入变量,防止出现错误 assign 用于对线性信号赋值,always模块用于定义reg型信号(寄存
阅读全文
摘要:2 Verilog语言 2.3 模块 2.3.6 加法器1 实例化一个由两个16位加法器组合成的32位加法器 module top_module( input [31:0] a, input [31:0] b, output [31:0] sum ); wire cout,cout1; add16
阅读全文