Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
273 views

Just bought a windows laptop sporting the Snapdragon Elite processor and trying to get acquainted with the ARM instruction set via some C-code. First attempt is to read from the cycle counter register ...
user1478005's user avatar
1 vote
0 answers
103 views

I'm trying to record the number of cpu cycles for running a C program on a M1. I know there are x86 instructions rdtsc and rdtscp that can be used to time intervals within a program. (In wall-clock ...
user23447276's user avatar
0 votes
1 answer
2k views

How can we get an Stm32f103c8 running 72MHz with Arduino IDE (STM32duino)? We have custom designed a PCB using the chip from the question. We are able to get it running at 72MHz using STM32CubeIDE. ...
Burgger Big's user avatar
3 votes
1 answer
3k views

Currently I'm working on measuring the time of code execution. I can measure how much time took to execute function (using tracepoints) but I also need to measure how many cpu cycles the execution of ...
MateoFerenc's user avatar
4 votes
1 answer
1k views

On recent x86, RDTSC returns some pseudo-counter that measures time instead of clock cycles. Given this, how do I measure actual clock cycles for the current thread/program? Platform-wise, I prefer ...
user541686's user avatar
  • 213k
1 vote
1 answer
110 views

Let's suppose I change one single bit in a word and add two other words. Does changing one bit in a word consume less CPU cycles than changing an entire word? If it consumes less CPU cycles, how much ...
phantomcraft's user avatar
0 votes
1 answer
908 views

The aim of this exercise is to check the presence of a number in an array. Specifications: The items are integers arranged in ascending order. The array can contain up to 1 million items. The array ...
Beginner developer's user avatar
1 vote
2 answers
786 views

What is the number of instruction cycles for EastLoop block? I have the following code: #include __config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF) cblock 0x20 Delay1 Delay2 ...
RichsnipSpam25's user avatar
0 votes
0 answers
299 views

I have measured cycles and dTLB_load_misses.walk_active for an application using perf tool. I executed the application two times. First time in isolation and the second with a single thread memory-...
Mohammad Siavashi's user avatar
0 votes
0 answers
52 views

This question is related to cryptography, but I believe I'm asking in right place (not in Crypto Stackexchange). Kuznyechik block cipher splits a 64-bit word into 16 nibbles (4-bits) and use them as ...
phantomcraft's user avatar
2 votes
1 answer
2k views

I'd like to know how'd you measure the amount of clock cycles per instruction say copy int from one place to another? I know you can time it down to nano seconds but with today's cpu's that resolution ...
Pongo's user avatar
  • 151
1 vote
1 answer
222 views

I am looking to measure total clock cycles used by a program. I am hoping to measure this from another process. clock_t can be used to measure a block of code but doesn't work for me because I want ...
Erick Arce's user avatar
0 votes
0 answers
23 views

Code 1 #include <stdio.h> //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 ...
F.C. Akhi's user avatar
  • 191
0 votes
0 answers
5k views

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 ...
Kasun Sampath Weligamage's user avatar
6 votes
3 answers
1k views

What's the relationship between the real CPU frequency and the clock_t (the unit is clock tick) in C? Let's say I have the below piece of C code which measures the time that CPU consumed for running a ...
Jason Yu's user avatar
  • 2,098
1 vote
1 answer
1k views

perf stat <command> prints several stats associated with <command>. Most of the stats are easily understandable. But what does it mean by the frequency associated with the cycle stat (...
user3862410's user avatar
0 votes
1 answer
75 views

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.
asdpoi's user avatar
  • 1
0 votes
1 answer
822 views

many related questions says, for example, some instructions can be excuted in one clock cycle. however, as far as I know(from the book of Computer Systems: A Programmer's Perspective), there are many ...
choxsword's user avatar
  • 3,387
2 votes
2 answers
819 views

I need a very precise timing, so I wrote some assembly code (for ARM M0+). However, the timing is not what I expected when measuring on an oscilliscope. #define LOOP_INSTRS_CNT 4 // ...
SupAl's user avatar
  • 1,131
1 vote
0 answers
342 views

I am trying to run SPEC17 benchmark using Pintool. While doing so I need to log CPU cycle and memory address accessed. Pintool have pinatrace tool to log memory addresses but I can not find anything ...
Komal's user avatar
  • 11
2 votes
1 answer
808 views

I was trying to measure the time for a snippet of code and noticed that the timings were about 50ns faster when I ran the program from inside my editor, QtCreator, compared to when I ran it from a ...
Daniel Näslund's user avatar
0 votes
0 answers
33 views

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 ...
DTR's user avatar
  • 372
2 votes
1 answer
217 views

image width = 4000 image height = 2000 number of iterations = width * height / 64 = 125 000 asm volatile( "1: \n\t" "prfm pldl1keep,...
RanL's user avatar
  • 142
1 vote
1 answer
1k views

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)...
mentalmushroom's user avatar
0 votes
2 answers
223 views

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 ...
Kevin Tan's user avatar
0 votes
2 answers
183 views

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 ...
liwuen's user avatar
  • 330
0 votes
1 answer
8k views

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 ...
Zakenmaru's user avatar
1 vote
1 answer
3k views

I wrote a basic code to find out the amount of clock cycles taken by nop. We know nop takes one clock cycle. #include <stdio.h> #include <string.h> #include <stdint.h> int main(void)...
md.jamal's user avatar
  • 4,717
1 vote
0 answers
179 views

The command rdtsc should be reliable source of time if the "TscInvariant" CPUID feature is enabled (see for example this link). On a dynamic frequency rescaling context, a reliable source of time ...
diegor's user avatar
  • 572
0 votes
0 answers
90 views

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 "...
Said Quqa's user avatar
1 vote
2 answers
239 views

I just have a simple question, a bit silly, but I just need some clarification for an upcoming exam so I don't make a stupid mistake. I am currently taking a class in computer organization and design ...
Janeson00's user avatar
  • 113
-1 votes
1 answer
407 views

Is it possible for a 8bit CPU to read memory in less than 3 clock cycles? I know that the 6502 works with an asynchronous memory but what about other 8bit CPUs with clocked memories? Do I need a clock ...
Pierco's user avatar
  • 79
-1 votes
1 answer
284 views

I am measuring the cycle count of different C functions which I try to make constant time in order to mitigate side channel attacks (crypto). I am working with a microcontroller (aurix from infineon) ...
jonnyx's user avatar
  • 357
5 votes
3 answers
771 views

Specifically is: mov %eax, %ds Slower than mov %eax, %ebx Or are they the same speed. I've researched online, but have been unable to find a definitive answer. I'm not sure if this is a silly ...
Others's user avatar
  • 3,061
0 votes
1 answer
696 views

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 ...
Andrew's user avatar
  • 82
1 vote
0 answers
19 views

I have a single-threaded, computationally intensive program and I would like to know if there is a way (such as a tool/profiler) that I can use to determine the number of CPU cycles my program ...
E-O's user avatar
  • 43
0 votes
1 answer
209 views

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 ...
Rehin's user avatar
  • 1
0 votes
0 answers
110 views

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 ...
Blobixx's user avatar
  • 11
5 votes
0 answers
9k views

I was trying to figure out if there is any easy method to convert the CPU cycles obtained in C using rdtsc() function into time in seconds. ex:- unsigned long long start, stop; start = rdtsc(); ...
nk134's user avatar
  • 53
3 votes
1 answer
957 views

I’m trying to understand STM8 pipelining to be able to predict how much cycles my code will need. I have this example, where I toggle a GPIO pin for 4 cycles each. Iff loop is aligned at 4byte-...
rumpel's user avatar
  • 8,358
0 votes
1 answer
82 views

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 ...
Shivakumar's user avatar
3 votes
1 answer
2k views

I try to count the CPU cycles of a single process via a short C code snippet. A MWE is the cpucycles.c. cpucycles.c (heavily based on the man page example) #include <stdlib.h> #include <...
Chickenmarkus's user avatar
68 votes
2 answers
103k views

I have been reading a book about the Computer's Processor. And I came across some of the terms like clock Ticks, clock Cycle and clock Speed that I am finding very difficult to understand. I will be ...
user avatar
1 vote
1 answer
713 views

I use this ALU block diagram as a learning material : http://www.righto.com/2013/09/the-z-80-has-4-bit-alu-heres-how-it.html I am not familiar with electronics. I am currently believing that a clock ...
Demeter Purjon's user avatar
3 votes
3 answers
3k views

I'm trying to count number of HB100 microwave sensor pulses in 200ms time quanta. Here is the code: #include <SoftwareSerial.h> #include <elapsedMillis.h> elapsedMillis ElapsedTime; #...
Mehran's user avatar
  • 317
4 votes
1 answer
7k views

Memory instructions such as ldr, str or b take 4 cycles each in ARM assembly. Is it because each memory location is 4 bytes long?
kyczawon's user avatar
  • 535
0 votes
2 answers
2k views

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 ...
user avatar
0 votes
1 answer
372 views

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.
Vaibhav Arora's user avatar
0 votes
0 answers
2k views

here i have written code to find number of cycles taken by a function but i am getting error at first MCR instruction can any one suggest me how to solve this problem.This code is written in XCODE and ...
ravi's user avatar
  • 63
-1 votes
1 answer
2k views

I want to calculate idle CPU cycles. I have tried to find out answer of this question on the internet. But the answers were not satisfactory. I queried for calculating idle CPU cycles but answers were ...
Yunis Khan's user avatar