- 博客(6)
- 收藏
- 关注
原创 Qt上添加serialport包
用Qt Windows编写的上位机软件在Linux系统的Qt上运行笔者遇到的问题是要将用Qt Windows编写的上位机软件在Linux系统的Qt上运行,//由于Linux的Qt上没有qtserialport包,下面这句报错,不能直接运行QT+=serialport搜了很多方法,看到最靠谱的步骤链接如下:从官方下载qtserialport包安装但是按照上面链接的步骤,仍然是有bug://下面两行报错,找不到对应文件#include <QtSerialPort/QSerialPort
2021-11-10 10:02:12
4927
原创 统计输入[7:0]data_in中1的个数,要求优化资源的使用
如题,Verilog实现,奉上拙见方法1:各位做加法module count_one_add( input clk, input rst_n, input [7:0] d_in, output [3:0] d_out ); assign d_out=d_in[0]+d_in[1]+d_in[2]+d_in[3]+d_in[4]+d_in[5]+d_in[6]+d_in[7];endmodule方法2:查找表module count_on
2021-10-09 09:27:10
1177
原创 对1bit的脉冲信号进行展宽,转为32bit位宽,并产生有效信号
如题,Verilog实现,奉上拙见//对1bit的脉冲信号进行展宽,转为32bit位宽,并产生有效信号;module zhankuan( input clk, input rst_n, input pulse_in, output reg pulse_out, output p_flag);//-------------------------------------
2021-09-26 14:33:37
1486
2
原创 generate for例化——Verilog语言练习
HDLBits题目Bcdadd4:You are provided with a BCD (binary-coded decimal) one-digit adder named bcd_fadd that adds two BCD digits and carry-in, and produces a sum and carry-out.module bcd_fadd {input [3:0] a,input [3:0] b,input cin,output cout,outpu
2021-07-12 19:03:54
889
原创 补码加法运算_溢出判断——Verilog实现
HDLBits题目Exams/ece241 2014 q1c:Assume that you have two 8-bit 2’s complement numbers, a[7:0] and b[7:0]. These numbers are added to produce s[7:0]. Also compute whether a (signed) overflow has occurred.假设您有两个 8 位 2 的补码,a[7:0] 和 b[7:0]。这些数字相加产生 s[7:0]。还要计算
2021-07-12 18:39:54
3754
原创 QT 串口Readall()数据读取不全
QT 串口Readall()数据读取不全在串口Readall()之前判断串口缓存区字节数if(serial->bytesAvailable()>= n ) // n为一次需要读取的字节数{ QByteArray array = serial->readAll(); ..... .....}注:字节数太多是不能一次性读取的,需要用buff缓存分次读取...
2020-09-11 15:54:31
7155
5
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人