Problem 2 In Part 1, you have encountered this circuit, where the serial output So of a 5- bit load/shift register is us

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Problem 2 In Part 1, you have encountered this circuit, where the serial output So of a 5- bit load/shift register is us

Post by answerhappygod »

Problem 2
In Part 1, you have encountered this
circuit, where the serial output So of a 5-
bit load/shift register is used to enable a
mod-N counter. When Load = 1, the
register is loaded with the values on
D4..D0 while the counter is loaded with 0
(cleared).
a. Write the verilog code for the load/
shift register in HDLBits. (1 point)
b. Write the verilog code for the mod-N counter in HDLBits. c.
Write the verilog code for the top module in HDLBits, with one
instance of the load/shift
register and one instance of the mod-N counter.
d. Run the simulation, using the following testbench template to
help you start. Capture its
waveform.
Problem 2 In Part 1 You Have Encountered This Circuit Where The Serial Output So Of A 5 Bit Load Shift Register Is Us 1
Problem 2 In Part 1 You Have Encountered This Circuit Where The Serial Output So Of A 5 Bit Load Shift Register Is Us 1 (149.81 KiB) Viewed 16 times
module testbench ();
reg Clk=0;
always #5 Clk = ~Clk; // Create clock with period=10
initial `probe_start; // Start the timing diagram
`probe(Clk); // Probe signal "Clk"
// A testbench
reg Load = 1’b0;
reg [4:0] D;
wire [2:0] Q;
initial begin // follow the given timing diagram
#10 Load = 1’b1; D = 5’b10110; // apply a Load pulse
#10 Load = 1’b0;
#50; // run a few clock cycles
$display ("Hello world! The current time is (%0d ps)",
$time);
#10 $finish; // Quit the simulation
end
top DUT ( .Clk(Clk), .Load(Load), .D(D ), .Q(Q) ); // Sub-modules
work too.
endmodule
module top (input Clk, input Load, input [4:0] D, output [2:0]
Q);
// declare internal wires
// instantiate load/shift register

// instantiate mod-N counter
`probe(Load); // Sub-modules can also have `probe()
`probe(D);
`probe(Q);
endmodule // top
// module for load/shift register
// module for mod-N counter
All tied to os o D4D3D2D1Do 1 0 1 1 0 Load 5 bit load/shift register Load So Si mod-N counter Enable Qs Load Q outputs X ها ساده ابراه D4 Ds D3 CIK D2 Di Do CIK Clk 1
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply