Questions tagged [cpu-cycles]

90 questions
0
votes
0 answers

What is happening struct padding or packing in 64 bit computer

Code 1 #include //structure var struct var{ char a; }; int main() { struct var r; printf("%ld\n", sizeof(r)); return 0; } Output: 1 I know the concept of padding and packing. Padding happens when a 64-bit processor process 8byte…
F.C. Akhi
  • 181
  • 1
  • 10
0
votes
0 answers

What is the correct way of calculating MIPS?

I found below question about MIPS, A computer system has a CPU with a word length of 64 bits and a clock speed of 1.5GHz. For a certain task, the measured average CPI (cycles per instruction) of the processor is 0.6. What is the MIPS rate of…
0
votes
1 answer

How to represent burst times in CPU scheduling with a variable

Instructions:implement Burst-times are assigned at random (10x10^6 cycles - 50x10^12 cycles). How would I convert this to ms the measurement of burst times.
0
votes
0 answers

Is it possible to alter the CPU's cycle count through software?

In a typical computer system, is it possible to manually change the CPU cycle counter to a specific value? The most obvious method would be to check the counter value and then run NOP or other redundant instructions until the value is as desired,…
DTR
  • 372
  • 6
  • 22
0
votes
1 answer

What determines CPU cycle time

I'd like to find out whether there is a relationship between CPU cycle time and pipeline depth. I have always thought that CPU cycle time is entirely determined by CPU frequency (opposite to frequency). This video, however, mentions that with a…
mentalmushroom
  • 2,261
  • 1
  • 26
  • 34
0
votes
2 answers

Clock Cycles for the invlpg instruction

I was reading some documentation about the invlpg instruction for Intel Pentium processors and it says that it takes 25 clock cycles. I thought that this depended on the implementation (the particular CPU) and not the actual instruction set…
0
votes
2 answers

CPU usage C Packed struct vs Unsigned Long Long operations

I need to do some operations with 48 bit variables, so I had two options: Create my own structure with 48 bit variables, or Use unsigned long long (64 bits). As the operations will not overflow 48 bits, I considered that using 64 bit variables…
liwuen
  • 330
  • 2
  • 17
0
votes
1 answer

Calculating Average Cycles per Instruction given Execution Time, Instruction Count, and Clock Rate

So I'm learning Computer Architecture where we have to take into account different processors and their clocks, and I can't help but feel that my calculations are off when calculating average CPI. For one such process, I am given: an Instruction…
Zakenmaru
  • 63
  • 2
  • 5
0
votes
0 answers

How can I estimate the execution time of convolution on PXA27x processor?

I am a civil engineering student, so please be gentle :) I have to give a rough estimate of the timing of an algorithm working on an Intel PXA271 processor, with XScale architecture. Basically, my "algorithm" does a filtering of the signal acquired…
Said Quqa
  • 13
  • 3
0
votes
1 answer

How many and what size cycles will be needed to perform longword transferred to the CPU

The task is for architecture ColdFire processor MCF5271: I don't understand how many and what size cycles will be needed to perform a longword transfer to the CPU, or word transfers. I'm reading the chart and I don't see what the connection is? Any…
Andrew
  • 42
  • 8
0
votes
1 answer

Same inputs and instructions but different delays, how?

For TI Tiva Launchpad, I wrote a C code that takes two numbers from GPIO as inputs and then it adds the two numbers and outputs the result. Then, I connected an FPGA board to the Tiva launchpad and gave two numbers so that it multiplies them and…
Rehin
  • 1
  • 1
0
votes
0 answers

Blender cycles, samples color

I am trying to collect from Cycles source code, the color of each sample during the rendering algorithm. However, after 2 months of research (...), I still don't understand how to get them. I've been looking at the device_cpu.cpp file and in…
Blobixx
  • 11
  • 4
0
votes
1 answer

Which one takes less cpu clock cycles to execute? Pythagoras formula or 16 comparisons among ints in "if" clause?

Aprox answer is sufficient. I am suppose to check if 2 rectangles of same size overlap or not 1) Existing code checks if all (x,y) of one rectangle is withing the all (x,y) of another. So making 16 comparisons in total 2) My improvement -…
0
votes
2 answers

Measuing CPU clock speed

I am trying to measure the speed of the CPU.I am not sure how much my method is accurate. Basicly, I tried an empty for loop with values like UINT_MAX but the program terminated quickly so I tried UINT_MAX * 3 and so on... Then I realized that the…
user6274708
0
votes
1 answer

Does one method call takes one CPU cycle?

Suppose we have following method private int add(int num_1, int num_2) { return num_1+num+2; } Does calling this method consumes one cpu cycle ? As there are 1 billion cycles in 1 ghz.
vabhi vab
  • 419
  • 4
  • 11