摘要: 4、More Circuits 4.1、Rule 90 规则 90是一个具有有趣特性的一维元胞自动机。 规则很简单。有一个一维的单元格数组(开或关)。在每个时间步,每个单元的下一个状态是单元的两个当前邻居的 XOR。下表是表达此规则的更详细的方式,其中单元格的下一个状态是其自身及其两个邻居的函数: 阅读全文
posted @ 2022-05-03 22:35 super_sweet 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 2、counters 2.1、Four-bit binary counter 构建一个从 0 到 15(含)计数的 4 位二进制计数器,周期为 16。复位输入是同步的,应将计数器复位为 0。 module top_module ( input clk, input reset, // Synchro 阅读全文
posted @ 2022-04-22 21:38 super_sweet 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Sequential Logic 1、Latches and Flip-Flops 1.1D flip-flop AD 触发器是一种在时钟信号的(通常)上升沿存储位并定期更新的电路。当使用时钟控制的always块时,逻辑合成器会创建 D 触发器。AD触发器是“组合逻辑块后接触发器”的最简单形式,其中 阅读全文
posted @ 2022-04-19 19:22 super_sweet 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 一、打开软件 二、输入下面代码 module top( input data_in, input clk, input rst, output reg [7:0] reg_vec, output reg [7:0] reg_loop, output reg data_out_vec, output 阅读全文
posted @ 2022-04-16 18:02 super_sweet 阅读(2996) 评论(0) 推荐(0) 编辑
摘要: 2、Multiplexers 2.1、2-to-1 multiplexer 创建一位宽的 2 对 1 多路复用器。当 sel=0 时,选择 a。当 sel=1 时,选择 b。 module top_module( input a, b, sel, output out ); assign out=s 阅读全文
posted @ 2022-04-14 16:23 super_sweet 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 三、Circuits Combinational Logic 1、Basic gates 1.1、Wire 实现以下电路: module top_module ( input in, output out); assign out = in; endmodule 1.2、GND 实现以下电路: mo 阅读全文
posted @ 2022-04-12 21:04 super_sweet 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 1、进入ubuntu的终端 鼠标右击,点击open in Terminal 2、安装iverilog和gtkwave 下面的命令用来确认iverilog和gtkwave是否安转成功 3、以一个简单的程序hello iverilog开始 可以参考iverilog官网使用网址:https://iveri 阅读全文
posted @ 2022-04-12 20:01 super_sweet 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 5、More Verilog Features 5.1、conditional ternary operator 给定四个无符号数,求最小值。无符号数可以与标准比较运算符(a < b)进行比较。使用条件运算符制作两路最小电路,然后将其中的一些组成一个四路最小电路。您可能需要一些线向量作为中间结果。 阅读全文
posted @ 2022-04-07 21:07 super_sweet 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 3、Module:Hierarchy 3.1、Modules 下图显示了一个带有子模块的非常简单的电路。在本练习中,创建一个module实例mod_a,然后将模块的三个引脚(in1、in2和out)连接到顶层模块的三个端口(电线a、b和out)。该模块mod_a是为您提供的——您必须实例化它。 模块 阅读全文
posted @ 2022-04-07 19:37 super_sweet 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 2、Vectors 2.1、Vectors 构建一个具有一个 3 位输入的电路,然后输出相同的向量,并将其拆分为三个单独的 1 位输出。将输出连接o0到输入向量的位置 0。 向量用于使用一个名称对相关信号进行分组,以便于操作。例如,wire [7:0] w;声明一个名为w的 8 位向量,它在功能上等 阅读全文
posted @ 2022-04-05 15:34 super_sweet 阅读(141) 评论(0) 推荐(0) 编辑