Computing.Net > Forums > Programming > I need ur help

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

I need ur help

Reply to Message Icon

Original Message
Name: moonnightingale
Date: November 3, 2001 at 07:51:31 Pacific
Subject: I need ur help
Comment:

I am an aeronautical engg. but i am interested in computer as well please solve my few queries.
What we mean by cache in computer.Every time when i read about cache it is mentioned that it has got two levels.Level 1 and level 2.What is fuction of these two levels and why their sizes are different.
Secondly I want to measure the time of execution of C program which will be in microseconds.I used time.h but it did not work.If you kindly make a small program and send me i will be thankful to you.
Thirdly I am having a C program which is used to take input data from data aqqusition card.If any one has used this card,Explain this program by writing comments in front of line where necesary.

//An example programme for A/D Convertor
//using sigma-2000 series data acquisition system
//This program converts the data 1000 points from
//the channel 0 and store the data in a column in
//voltage representtaion in filename ar.mat

#include
#include
#include
#include
#include

#define MAXPOINTS 1000 //Points to be acquired
#define CHANS 4
int stch=9, volt=5, maxpoints=50, chans=4, settle=775, convwait=1;

float volts[CHANS][MAXPOINTS]; //The floating point array that would contain the
//the converted voltage
ofstream outfile("ar.dat"); // Output file name.Provides an output stream
//to extract from a file using a filebuf.
short int value[CHANS][MAXPOINTS]; // the data array used to hold the binary intermediate
short int valuebyte1[CHANS][MAXPOINTS], valuebyte2[CHANS][MAXPOINTS],vac;
struct REGPACK reg; // reg struct used for calling software interrupts

#define BASE_ADDRESS 0x300


// The main starts here
void main(int argc, char* argv[])
{


int i;

if (argc==7)
{
stch=atoi(argv[1]);
chans=atoi(argv[2]);
maxpoints=atoi(argv[3]);
settle=atoi(argv[4]);
convwait=atoi(argv[5]);
volt=atoi(argv[6]);

if (maxpoints>MAXPOINTS) maxpoints=MAXPOINTS;
if (chans>CHANS) chans=CHANS;
}

// Control Word for the A/D PPI
// The mask is actually the channel used for the conversion
// the default is channel zero
int mask=0x90; //

outportb(BASE_ADDRESS+0x3,0x92);
outportb(BASE_ADDRESS+0x2,0x3|mask);//start a/d conversion/

for(int j=0;j2047)
{vac=4095-value[ch][q];volts[ch][q]=vac*(-1.0*(float)volt/2047.0); }
outfile< }

float v3, i3;
v3=-1*(volts[0][q]+volts[1][q]);
i3=-1*(volts[2][q]+volts[3][q]);
outfile< outfile< outfile<}


}
// END OF MAIN

If you are busy now,you can also drop a mail at moonnightingale@yahoo.com later.Your help will be appreciated.
thanks
Moon


Report Offensive Message For Removal


Response Number 1
Name: ~pixy~
Date: November 5, 2001 at 16:44:14 Pacific
Reply: (edit)

Cache is fast memory, the processor will check cache for the info it needs before checking RAM, level 1 is housed on the chip, level 2 outside the chip, level 1 is a bit faster than level 2.

I can't help you with the programing though, I'm just a first year student~~

Regards, pixy


Report Offensive Follow Up For Removal

Response Number 2
Name: moonnightingale
Date: November 6, 2001 at 15:42:57 Pacific
Reply: (edit)

Thanks pixy


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you own an iPhone?

Yes
No, but soon
No


View Results

Poll Finishes In 6 Days.
Discuss in The Lounge
Poll History




Data Recovery Software