Hi,
I wish to read this file content using random addressing.
5 lines of 24 bits.
000000000000000000000000
111111111111111111111111
101010101010110101010101
110011001100110011001100
111011101110111011101110
I used fseek for moving file pointer . The given offset for reading each line correctly is confusing.
for example , if
fseek = 26 , 111111111111111111111111
fseek = 51 , 101010101010110101010101
fseek = 76 , 110011001100110011001100
fseek = 102, 111011101110111011101110
What is the logic behind the offset addressing?
please comment
My code is
if(dut_pkt.fontbit_read == 1'b1)
begin
if(read_flag == 0)
begin
$fseek(input_file,103,0);
file_position = $ftell(input_file);
$fscanf(input_file,"%b",data_byte[0]);
$display("filepointer location = ", file_position);
$display("data_byte[0] = %b",data_byte[0]);
read_flag = 1;
end
end