奇偶校验位产生器有关问题
output even_bit,odd_bit;
input[7:0] input_bus;
assign odd_bit = ^ input_bus; //产生奇校验位
assign even_bit = ~odd_bit; //产生偶校验位
endmodule
odd_bit = ^ input_bus; 这句是谁跟input_bus异或呢?
还用这个模块写对了吗?谢谢!
是新手 求大神帮忙解答
odd_bit = ^ input_bus;这个我知道啦 是缩位运算符 但是程序是不是应该这样呢?
module parity(even_bit,odd_bit,input_bus);
output even_bit,odd_bit;
input[7:0] input_bus;
assign even_bit = ^ input_bus; //产生奇校验位
assign odd_bit = ~even_bit; //产生偶校验位
endmodule
看下是不是写错啦
The operator of "^" is the bit wise operator.
You can refer to the IEEE 1364 standard.
亲 我提的关键问题你没回答 那个符号的意思我已经明白
Do you know what is bit wise?
assing odd_bit = ^input_signal; //This statement meas is same as below
assign odd_bit = input_signal[0] ^ input_signal[1] ^ input_signal[2] ^ .........^ input_signal[7]
就是按位异或啦
虽然你们还是没明白我要问的问题 但还是非常感谢 我是想问程序中奇偶校验位的生产代码是不是写反啦 哎
好像是不对,odd_bit = ^input_signal;是偶校验
偶校验位与奇校验位。如果一组给定数据位中1的个数是奇数,那么偶校验位就置为1,从而使得总的1的个数是偶数。如果给定一组数据位中1的个数是偶数,那么奇校验位就置为1,使得总的1的个数是奇数。
1层的那个应该是写反了
谢谢各位热心的回答
