I want to create an input file with random 8 bit binary number for VHDL testbench using Matlab.
%create random 10 decimal number
a = randi ( [0 255], 10 , 1 );
display(a);
%convert to 8bit binary
a=dec2bin(a,8);
display(a);
%write to textfile
fid=fopen('eventsIn.txt','wt');
fprintf(fid,'%s\n',a);
fclose(fid);
how i want to make sure that the output become
1010100
1100100
0010100
0111101
0000110
instead of this format?
10101001100100001010001111010000110010011110111000101011101101101110100100100010