- 博客(10)
- 资源 (3)
- 收藏
- 关注
原创 16位加法器Verilog设计
module adder(A,B,C); //output C=A+B C={1'b,13'b}={sign,value} input CLK; input RST; input signed [15:0] A,B;//input parameter A={1'b,12'b}={sign,value} //...
2019-03-04 16:24:34
12528
4
原创 海明码的实现过程
海明码的实现过程在《COMPUTER NETWORKS》第五版,作者Andrew S.Tanenbaum,David J.Wetherall。第3.2.1节提到使用海明码来作为纠错码的使用。这里将海明码的大致要点总结如下。设计公式(m+r+1)&lt;=2r(m+r+1)&lt;=2^{r}(m+r+1)<=2r公式中m为数据位数,r为校验位,即数据位与...
2019-01-16 18:19:51
1081
原创 骰子求和 c++
#include<iostream>#include<iomanip>#define MAXLENGTH 100using namespace std;void dict(int* result, int num, int sum){ if (num == 0) { //int b = result[sum]; result[sum] += 1;...
2018-09-19 22:59:51
850
原创 带重复元素的数组全排列问题。c++实现
#include <iostream>using namespace std;void swap(int &a, int &b){ int temp = a; a = b; b = temp;}void perm(int list[], int low, int high){ if (low == high) { for (int i ...
2018-09-18 20:25:54
2515
2
原创 数组全排-STL
输入:数字n输出:全排结果 #include<iostream>#include<algorithm>#define MAXLENGTH 100using namespace std;int main(){ int n; int num = 1; int a[MAXLENGTH]; cin >> n; cin.clear();...
2018-09-18 00:15:56
115
原创 带最小值操作的栈 c++实现
#include<iostream>using namespace std;class Stack{public: Stack(); ~Stack();private: typedef struct Node { struct Node *P; int x; }*BitNode,BitValue; BitNode Start; BitNode ...
2018-09-17 16:54:41
195
原创 c/c++程序总结——去除空格
#include<stdio.h>#include<stdlib.h>#include<string.h>void trimSpace(char *inbuf){ char* vector1 = inbuf; while (strlen(inbuf) != 0) { if (*inbuf == ' ') { ++vector1; ...
2018-06-21 18:28:40
2201
1
原创 python中两个使用库
一、tqdmtqdm用于产生进度条二、retryretry用于完成代码的重复书写def retry(exceptions=Exception, tries=-1, delay=0, max_delay=None, backoff=1, jitter=0, logger=logging_logger): """Return a retry decorator. :param exc...
2018-03-24 15:46:08
479
翻译 对数据分析重要的方式
一、得到满足条件的数组元素位置# Create an arrayimport numpy as nparr_rand = np.array([8, 8, 3, 7, 7, 0, 4, 2, 5, 2])print("Array: ", arr_rand)# Positions where value > 5index_gt5 = np.where(arr_rand > 5)...
2018-03-04 23:00:15
133
翻译 Numpy-数组知识点
一、数组的创建# Create an 1d array from a listimport numpy as nplist1 = [0,1,2,3,4]arr1d = np.array(list1)# Create an 2d array from a listimport numpy as nplist1 = [0,1,2,3,4]arr2d = np.array([list1])...
2018-03-04 16:37:24
426
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人