Write verilog code describing a group of four 8bit registers
Write verilog code describing a group of four 8-bit registers. On an incoming clock, you should be able to move the contents of any one of the registers to any of the others, or take an 8-bit input to any one of them, based on a 4-bit selection code.
-behavioral verilog
-gate-level verilog
Solution
reg [3:0] count;
wire cnt_done;
assign cnt_done = ~| count;
assign Q = count;
always @(posedge Clock)
if (Clear)
count <= 0;
else if (Enable)
if (Load | cnt_done)
count <= 4\'b1010; // decimal 10
else
count <= count - 1;
This might help you.
comment your mail id if you get any error
