Question: Read the following Verilog module. Do not enter it into your computer. begin { verbatim } module lfsr ( R , Reset, Clock, Y
Read the following Verilog module. Do not enter it into your computer.
beginverbatim
module lfsrR Reset, Clock, Y;
input : R;
input Reset;
input Clock;
output : Y;
reg : Q;
assign Y Q;
always@ posedge Clock
if Reset
Q R;
else
Q Q Q Q Q;
endmodule
endverbatim
A comment on combinatorial vs sequential Verilog: in textbfcombinatorialalso known as continuous Verilog, we use textttassign statements to connect wires to gates and other components; the connections are permanent, so any change in the elements in the righthand side of an textttassign will be immediately reflected in the value of the lefthand side. In textbfsequential Verilog, operations are synchronized to the clock, and changes to registers happen only at a positive clock edge. In the above code, we can clearly see the difference: the statement textttassign Y Q tells us that the value of the register textttQ is continuously output on port textttY Conversely, operations within the textttalways block are executed on each positive clock edge, that is when a discrete new input is provided. Therefore, when we assign a new value to textttQ that change is also reflected in textttY
A comment on the syntax: the curlybrace notation textttQ Q Q Q is used here to construct a bit value from three constituent bits, from most to least significant: first textttQ then textttQ Q finally textttQ
In the above module, if we initialize the module by asserting textttReset and setting textttR to what sequence of values will be output on textttY over the next five clock cycles? Give your answer as a sequence of six binary values, starting with
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
