Search This Blog

Tuesday, October 27, 2009

CPU, How Fast? How Many Cycles?

CPU cycle.
A 1GH CPU, has a cycle 1x10^9 (1 billion) per second(time period of voltage from high to low)
Usually, a cpu needs 1 cpu cycle to run one instruction. (now cpu can run more instructions within 1 cycle)
Therefore, one instruction can take 1x10^-9 (1 nano sec) (十億(billion)分之一秒)

How fast is 1 nano sec? well, pinging on google can take 50 ms (milli sec, 1x10^-3).
so 1 instruction ( 1 nano sec), can be 1 million times faster than the internet ping (1x10^6)
http://norvig.com/21-days.html

The time to change the state to "on" and "off" takes time (charge and drain the current). The limit is the speed of light.
2x10^9 M/Sec
http://computer.howstuffworks.com/question307.htm

A process does not understand add(ax,bx), instead it understand the add instruction as "bit patterns" from memory. So, add(ax,bx) is converted to "machine code", or binary representation.
e.g 101 11 010 can be the result conversion of add(ax,bx). cpu understand the bit pattern (called opcode)

A byte (8 bits) is the smallest addressable data on many cpus nowdays. (e.g. cpu fetch 8 bits to work on at a time)
If a cpu can handle a 32bit address space (4bytes in register), the largest memory is 4GB (2^32 = 4 biillion = 4x10^9 different combinations)
http://www.codinghorror.com/blog/archives/000811.html

No comments: