tags:

views:

21

answers:

1

the text file is something like this:

// Signals:
// ac_mode
// ac_test
// active_mode
// adden
// analog_test_enable
// apf_user_control
// arce
// arclr
// arin
// aux_msel[1]
// auxmsel_ctl
// ....
// ....

PI="XXXXXXXXX0XXXXX01XXXXXXXXXXXX0XXX0XXXXXX0XX0X00XXXXXXXXXXXXX00XX00XXXXX

*the ac_mode correspond to X ( x means Out), ac_test correspond to the second x , the third 1 active mode correspond to the third at PI which is X also, means Out as well. Then sorting by In 1st then follow by Out. the output should be: Signals { "aux_msel[1]" In; "aux_msel[0]" In; "clkusr" In; "condonei" In; "datai[7]" In; "analog_test_enable" Out; "apf_user_control" Out; "arce" Out; "arclr" Out; "arin" Out; where X is represent Out and 0 or 1 represent IN."

A: 

I think you just want to read one character at a time, not even in a loop. Read the first character, it means your ac_mode. Print out something about what you've discovered. Then read the next character, and so on.

Have you tried anything? What are you stuck on?

Kate Gregory