Home Verilog Digital Design Digital Basics Python RF Basics

Legal Disclaimer

Chip Designing for ASIC/ FPGA Design engineers and Students
FULLCHIPDESIGN
Digital-logic Design...  Dream for many students… start learning front-end…
Topics @TYH :- 4G LTE Tutorial, GVIM editor, Smart-Phone, Cloud Computing
FCD
Custom Search

Feedback ? Send it to admin@fullchipdesign.com or join me at fullchip@gmail.com

Legal Disclaimer

Previous.
Next.
Introduction Operators Initial stms Block vs. Non Blk IF-ELSE, CASE FORLOOP File Operations Read .bin format Function Call Testbench Random Numbers Shift Micro-ops Sync RAM Mem Generate Assertions Signed RTL
Verilog Tutorial.
Digital Basics Tutorial.
Verilog testbench to generate random numbers and use of $fdisplay to store it in a text file.
~\Desktop\FCD\downloads\fc_v\random_fc.v.html // Test Bench for generating random numbers
module random_tb ();

integer seed;
integer out;
integer i ;

initial begin
  out = $fopen("rand.vec","w");
  $fdisplay(out, "seed = %h, 1st random number in hexadecimal = 0x%h", seed, $random(seed));
  $fdisplay(out, "seed = %h, 2nd random number in hexadecimal = 0x%h", seed, $random(seed));
  $fdisplay(out, "seed = %h, 3rd random number in hexadecimal = 0x%h", seed, $random(seed));
  $fdisplay(out, "seed = %h, 4th random number in hexadecimal = 0x%h", seed, $random(seed));
  $fdisplay(out, "seed = %h, 5th random number in hexadecimal = 0x%h", seed, $random(seed));
end

endmodule
Contents of the output text ‘rand.vec’ is displayed below.
seed = 23980634, 1st random number in hexadecimal  = 0x12153524
seed = 92153206, 2nd random number in hexadecimal = 0xc0895e81
seed = 40895ccf,  3rd random number in hexadecimal  = 0x8484d609
seed = 0484d4c4, 4th random number in hexadecimal  = 0xb1f05663
seed = 31f054f5,  5th random number in hexadecimal  = 0x06b97b0d
Results are discussed below:-
Generating random numbers and $fdisplay in Verilog testbench.
Testbench.
Shift Micro-ops.
Previous             Next
Evolved Packet Core (EPC) system architecture for all IP.Mobility Management Entity (MME),
Serving System (S) Architecture (A) Evolution (E) Gateway or Serving Gateway SGW.
Packet Data Network (PDN) SAE Gateway
Enhanced Packet Data Gateway (ePDG)
Multiple antenna techniques - MIMO, Adaptive antenna systems - AAS and Antenna diversity - AD