Question

In: Computer Science

Write a Verilog code to implement 16 bit LFSR

Write a Verilog code to implement 16 bit LFSR

Solutions

Expert Solution

Your specs are not clear for linear feedback shift register but you can modify the code provided below as per your need.

Working verilog code to implement 16 bit LFSR:

module lfsr

(input clk,clr,

output y);

//clk->clock, clr->posedge clear,y=pne bit serial output

reg [15:0]q;

//q->16 bit intermediate line for shift register

//q0 is assigned to y ;right shift

assign y=q[0];

wire w1,w2,w3;

//w1,w2,w3 has xor operation between mentioned bits

assign w1=q[13]^q[15],

w2=w1^q[12],

w3=w2^q[10];

always@(posedge clk,posedge clr)

begin

//if clr=1, load the initial bits

if(clr)

q<=16'b1010110011100001;

//else right shift and load w3 as msb bit

else

q<={w3,q[15:1]};

end

endmodule

Code Screenshots:


Related Solutions

Write in verilog, code to implement a 6 bit multiplier. Cascade a 1 bit multiplier to...
Write in verilog, code to implement a 6 bit multiplier. Cascade a 1 bit multiplier to implement this.
code an 8 bit LFSR random number generator in system verilog. Write a test bench, load...
code an 8 bit LFSR random number generator in system verilog. Write a test bench, load the seed 11111111, and generate the first 10 random numbers.
Design and write a verilog code and testbench for a 16-bit RISC MIPS Processor on vivado...
Design and write a verilog code and testbench for a 16-bit RISC MIPS Processor on vivado and show waveform.
Design a circuit and write a verilog code description of the 16-bit right rotator using barrel...
Design a circuit and write a verilog code description of the 16-bit right rotator using barrel shift method
verilog code to implement 32 bit Floating Point Adder in Verilog using IEEE 754 floating point...
verilog code to implement 32 bit Floating Point Adder in Verilog using IEEE 754 floating point representation.
Design a 4-bit multiplier by using 4 bit full adder and write a verilog code.
Design a 4-bit multiplier by using 4 bit full adder and write a verilog code.
Please Create the Verilog/Vivado Code For: An LFSR Pseudonumber generator, and the testbench for test it,...
Please Create the Verilog/Vivado Code For: An LFSR Pseudonumber generator, and the testbench for test it, please comment and explain the answer as much as possible if possible, post Pic of the waveform simulation!
Please Create the Verilog/Vivado Code For: An LFSR Pseudonumber generator, and the testbench for test it,...
Please Create the Verilog/Vivado Code For: An LFSR Pseudonumber generator, and the testbench for test it, please comment and explain the answer as much as possible waveform simulation answer would be nice too!
Please Create the Verilog/Vivado Code For: An LFSR Pseudonumber generator, and the testbench for test it,...
Please Create the Verilog/Vivado Code For: An LFSR Pseudonumber generator, and the testbench for test it, please comment and explain the answer as much as possible!
Please Create the Verilog/Vivado Code For: An LFSR Pseudonumber generator, and the testbench for test it,...
Please Create the Verilog/Vivado Code For: An LFSR Pseudonumber generator, and the testbench for test it, please comment and explain the answer as much as possible,(Make your own code, even it is more simple, but do not copy from others sources on the internet) if possible, post Pic of the waveform simulation!
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT