Email: bknpk@hotmail.com Phone: +972-54-7649119


V

 

This page shows how to generate a random number within range. It is implemented as part of a c++ series of exercises , that I did.


    1. #include <stdio.h>
    2. #include <stdlib.h>
    3. #include <time.h>
    4. using namespace std;
    5. #include "ecc_calc.h"
    6. int main() {
    7.   int i;
    8.   unsigned char a_data[ARRAY_SZ];
    9.   srand ( time(NULL) );
    10.   //for(i=0; i < ARRAY_SZ; i++) a_data[i]=(i > 0) ? 0 : 4;
    11.   for(i=0; i < ARRAY_SZ; i++) a_data[i]=rand() % 256;
    12.   c_ecc *ecc;
    13.   ecc = new c_ecc(a_data);
    14.   delete ecc;
    15.   return 0;
    16. }

  ...



Home

some memory VHDL models


A simple c-code program to read a memory array from verilog RTL, using VPI.



Download Area







Search This Site


Feedback This Site




new pages on this site