- 博客(25)
- 收藏
- 关注
原创 HQL典型题目总结--日期间隔以及去重问题
HQL典型题目–日期间隔以及去重问题这些问题仅用于记录自己学习情况,如有雷同,纯属巧合数据准备create table good_promotion( brand string, stt string, edt string)row format delimitedfields terminated
2022-05-22 10:42:43
397
原创 SystemVerilog 接口之采样竞争
看一下race代码`timescale 1ns/1nsmodule race1;bit clk1, clk2;bit rstn;logic[7:0] d1;initial begin forever #5 clk1 <= !clk1; //5ns一翻转,所以时钟周期是10nsendalways @(clk1) clk2 <= clk1; //当clk1上升沿到来时,赋值给clk2,利用组合逻辑使得clk2跟着clk1一起跳转initial begin #10
2022-02-13 10:58:27
508
转载 SystemVerilog Gvim高亮设置
操作步骤:1、vimrc文件中加入au BufRead,BufNewFile *.sv set filetype=systemverilog2、在vim74文件夹下面的syntax加入systemverlilog.vimsystemverlilog.vim文件内容" Vim syntax file" Language: SystemVerilog" Maintainer: Stephen Hobbs <stephenh@cadence.com>" Last Update: W.
2022-02-12 17:14:31
1953
原创 01-Module-模块调用传参
Verilog HDL(HDLBits)Verilog Language Basic01-Module-模块调用传参module top_module ( input a, input b, output out ); //调用模块mod_a进行实例化,并且传入参数,如下写法可以不用考虑位置,但是冗余 mod_a mod_a_instance1(.in1(a),.in2(b),.out(out)); endmodule...
2022-01-28 21:15:36
515
原创 09-Vector-向量拼接后异或操作
Verilog HDL(HDLBits)Verilog Language Basic09-Vector-向量拼接后异或操作module top_module ( input a, b, c, d, e, output [24:0] out );// // assign out = ~{ ... } ^ { ... }; //拼接时若有倍数,必须用要用大括号括起来再拼, assign out = ~{{5{a}},{5{b}},{5{c}},{
2022-01-28 20:20:06
529
原创 08-Vector-向量内索引翻倍
Verilog HDL(HDLBits)Verilog Language Basic08-Vector-向量内索引翻倍创建一个32位的输出电路进行接收。输出电路接收的值:将8位的输入电路中的符号位复制24次,剩余8个位宽放原来的输入值,由于符号位位于in[7]这个索引,将该索引的符号位复制24次,(可能描述有点小问题,但是不影响理解)代码如下module top_module ( input [7:0] in, output [31:0] out );// // assi
2022-01-28 19:48:47
371
原创 07-Vector-向量翻转
Verilog HDL(HDLBits)Verilog Language Basic07-Vector-向量翻转Given an 8-bit input vector [7:0], reverse its bit ordering.(将该向量翻转,第一位变最后一位,倒数第二变第二,以此类推)module top_module( input [7:0] in, output [7:0] out); integer i;//引入一个整型变量 always@(*)
2022-01-27 22:24:11
966
原创 06-Vector-向量拼接
Verilog HDL(HDLBits)Verilog Language Basic06-Vector-向量拼接module top_module ( input [4:0] a, b, c, d, e, f, output [7:0] w, x, y, z );// // assign { ... } = { ... } 将input的6条5位宽的wire线拼接在一起一条30个位宽的线,并且输出到由4条8个位宽拼接成一条32位的线 assign {w[7:0]
2022-01-27 22:03:06
664
原创 05-Vector-向量内的逻辑运算
Verilog HDL(HDLBits)Verilog Language Basic05-Vector-向量内的逻辑运算module top_module( input [3:0] in, output out_and, output out_or, output out_xor ); //assign out_and = in[3] & in[2] & in[1] & in[0]; assign out_and = &a
2022-01-27 21:37:11
890
原创 04-Vector-向量内逻辑运算
Verilog HDL(HDLBits)Verilog Language Basic04-Vector-向量内逻辑运算构建一个电路,该电路具有两个3位输入,用于计算两个向量的按位OR、两个向量的逻辑OR和两个向量的逆(NOT)。将b的逆放在out_no的上半部分(即位[5:3]),在下半部分放置a的逆。module top_module( input [2:0] a, input [2:0] b, output [2:0] out_or_bitwise, outp
2022-01-27 21:02:55
1580
原创 03-Vector-逆转字节
Verilog HDL(HDLBits)Verilog Language Basic03-Vector-逆转字节A 32-bit vector can be viewed as containing 4 bytes (bits [31:24], [23:16], etc.). Build a circuit that will reverse the byte ordering of the 4-byte word.将32位向量视为包含4个字节(位[31:24],[23:16]等)。建立一个电路,该
2022-01-27 20:24:35
428
原创 02-Vectors
Verilog HDL(HDLBits)Verilog Language Basic02-Vectors建立一个组合电路,将输入半字(16位,[15:0])分成低[7:0]和高[15:8]module top_module( input wire [15:0] in, output wire [7:0] out_hi, output wire [7:0] out_lo ); //故意写错索引方向 /* assign out_lo = in[0
2022-01-27 20:15:17
112
原创 01-Vector
Verilog HDL(HDLBits)Verilog Language Basic01-Vectormodule top_module ( input wire [2:0] vec, output wire [2:0] outv, output wire o2, output wire o1, output wire o0 ); // Module body starts after module declaration //未切换位置
2022-01-27 19:45:31
174
原创 08-Module Declaration
Verilog HDL(HDLBits)Verilog Language Basic08-Module Declarationmodule top_module ( input p1a, p1b, p1c, p1d, p1e, p1f, output p1y, input p2a, p2b, p2c, p2d, output p2y ); /*自己写的太冗余 wire temp_2ab,temp_2cd,temp_2abcd; //lef
2022-01-25 21:46:38
439
原创 06-Xnorgate
Verilog HDL(HDLBits)Verilog Language Basic06-Xnorgatemodule top_module( input a, input b, output out ); assign out = ~(a^b); endmodule
2022-01-25 20:56:38
225
原创 07-Declaring wires
Verilog HDL(HDLBits)Verilog Language Basic07-Declaring wires`default_nettype nonemodule top_module( input a, input b, input c, input d, output out, output out_n ); wire temp_1; wire temp_2; wire temp_3;
2022-01-25 20:54:10
132
原创 05-Norgate
Verilog HDL(HDLBits)Verilog Language Basic05-Norgatemodule top_module( input a, input b, output out ); assign out = ~(a|b); endmodule
2022-01-25 20:24:20
157
原创 04-Andgate
Verilog HDL(HDLBits)Verilog Language Basic03-Notgatemodule top_module( input a, input b, output out ); assign out = a&b; endmodule
2022-01-25 20:19:08
87
原创 03-Notgate
Verilog HDL(HDLBits)Verilog Language Basic03-Notgatemodule top_module( input in, output out ); assign out = ~in;endmodule
2022-01-25 20:04:06
107
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人