Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

module TestBench ( ) ; reg clk _ enable, reset, preset _ 0 2 3 , CLK; wire [ 1 5 : 0 ] Rand

module TestBench();
reg clk_enable, reset, preset_023, CLK;
wire [15:0] Rand_out;
Main DUT0(Rand_out, CLK, clk_enable, reset, preset_023);
Lsfr DUT1();
always begin
#10
CLK =0;
#10
CLK =1;
end
initial begin
clk_enable =0;
reset =0;
preset_023=0;
#15
$display("Rand_out =%b", Rand_out);
#10
$display("Rand_out =%b", Rand_out);
$finish;
end
endmodulemodule Main(Rand_out, CLK, clk_enable, reset, preset_023);
output [15:0] Rand_out;
input clk_enable, reset, preset_023, CLK;
wire and_0_out, \1_Q ,\2_Q ,\3_Q ,\4_Q ,\5_Q ,\6_Q ,\7_Q ,\8_Q ,\9_Q ,\10_Q ,\11_Q ,\12_Q ,\13_Q ,\14_Q ,\15_Q , xor_0_out, xor_1_out, xor_2_out, \0_Q ;
wire [15:0] Splitter_0_cmb;
assign and_0_out = clk_enable & CLK;
DflipFlop \1(\1_Q ,, and_0_out, \0_Q , reset, ,);
DflipFlop \2(\2_Q ,, and_0_out, \1_Q , reset, preset_023,);
DflipFlop \3(\3_Q ,, and_0_out, \2_Q , reset, preset_023,);
DflipFlop \4(\4_Q ,, and_0_out, \3_Q , reset, ,);
DflipFlop \5(\5_Q ,, and_0_out, \4_Q , reset, ,);
DflipFlop \6(\6_Q ,, and_0_out, \5_Q , reset, ,);
DflipFlop \7(\7_Q ,, and_0_out, \6_Q , reset, ,);
DflipFlop \8(\8_Q ,, and_0_out, \7_Q , reset, ,);
DflipFlop \9(\9_Q ,, and_0_out, \8_Q , reset, ,);
DflipFlop \10(\10_Q ,, and_0_out, \9_Q , reset, ,);
DflipFlop \11(\11_Q ,, and_0_out, \10_Q , reset, ,);
DflipFlop \12(\12_Q ,, and_0_out, \11_Q , reset, ,);
DflipFlop \13(\13_Q ,, and_0_out, \12_Q , reset, ,);
DflipFlop \14(\14_Q ,, and_0_out, \13_Q , reset, ,);
DflipFlop \15(\15_Q ,, and_0_out, \14_Q , reset, ,);
assign Splitter_0_cmb ={\15_Q ,\14_Q ,\13_Q ,\12_Q ,\11_Q ,\10_Q ,\9_Q ,\8_Q ,\7_Q ,\6_Q ,\5_Q ,\4_Q ,\3_Q ,\2_Q ,\1_Q ,\0_Q };
assign Rand_out = Splitter_0_cmb;
assign xor_0_out =\13_Q ^\15_Q ;
assign xor_1_out =\12_Q ^ xor_0_out;
assign xor_2_out =\10_Q ^ xor_1_out;
DflipFlop \0(\0_Q ,, and_0_out, xor_2_out, reset, preset_023,);
endmodule
module Lsfr();
endmodule
module DflipFlop(q, q_inv, clk, d, a_rst, pre, en);
parameter WIDTH =1;
output reg [WIDTH-1:0] q, q_inv;
input clk, a_rst, pre, en;
input [WIDTH-1:0] d;
always @ (posedge clk or posedge a_rst)
if (a_rst) begin
q <='b0;
q_inv <='b1;
end else if (en ==0) ;
else begin
q <= dYou will need to edit the design file so that the DD flipflop works the same as it does in
(code to use the preset_023 signal must be integrated into the reset if
statement).
e. Run a simulation to generate 10 numbers
f. Hand in your list of numbers in both binary and hexadecimal format.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions