资源简介
关于线性反馈移位寄存器的代码,模拟LFSR运行
代码片段和文件信息
#include
unsigned char fn_feedback(int n unsigned char c unsigned char curr_state)
{
unsigned char t = c & curr_state;
unsigned char s = t & (unsigned char)128;
for(int i =1; i< n; i++)
{
s = s ^ ( (t << i) & (unsigned char)128 );
}
return (unsigned char)((curr_state << 1) | (s >> 7));
}
void printuc(unsigned char p)
{
int t=128i;
for(i=7;i>=0;i--)
{
if((p&t)>>i == 1)
{
printf(“1“);
}
else
{
printf(“0“);
}
t=t>>1;
}
相关资源
- 漂亮的仪表盘(widget.cpp)
- 代码雨.cpp
- libevent(timeout.cpp)
- 密码学 重合指数计算(IC.cpp)
- 输出n的阶乘.cpp
- opencv2 3D标定.cpp
- c 操作sqlite数据库.cpp
- 扫雷游戏.cpp
- c++爱心表白(心.cpp)
- 算法表达式求值.cpp
- 银行家算法分配资源的模拟实现(m
- 常见排序算法比较.cpp
- 无向图M着色.cpp
- 客户消费积分管理系统.cpp
- 公司人员月薪级别信息管理系统.cpp
- 俄罗斯方块.cpp
- 跑跑卡丁车.cpp
- 扫雷游戏.cpp(较简单)
- 打飞机.cpp
- 吃豆人.cpp 代码
- opengl绘制汽车.cpp
- consts.cpp
- 银行管理系统.cpp
- BombGoldFlower.cpp
- 扫雷游戏.cpp C++ 课程设计
- 图书管理系统.cpp
- c++游戏歹徒逃亡.cpp
- 180912.cpp
- ZhajingHua.cpp
- puma560的运动学正解和逆解的C++源码
评论
共有 条评论