I've heard the term tacts when referring to some hardware capability, e.g. "tacts on one frame" or "tacts per second". I tried Googling this but surprisingly did not find anything relevant. What is the meaning of this term when used in the aforementioned contexts?
Clock ticks as seen by the processor - e.g. a NOP instruction takes 4 tacts, or a frame takes 69888 tacts (on a 48K Spectrum). It's a fairly common usage of the term within computing circles (not just the Spectrum), being borrowed from the musical meaning.
-
15Could this be a British term? I'm an experienced American assembly language programmer, and have never heard of tacts. It sounds like you are describing what I have always heard called "clock cycles". – RichF Nov 19 '17 at 16:50
-
6Speaking as a British person, I'm not aware of its use in any modern context. It's probably either historical, or possibly descended from Sinclair's particular documentation. Much like Commodore programmers talking about the 'kernal'. – Tommy Nov 19 '17 at 17:10
-
6This term was fairly common in Russian-speaking computing circles in the eighties and nineties. It is obviously a borrowed (not-Russian) word, and I am unsure of the origin. – krokodil Nov 19 '17 at 19:17
-
4Don't think you could call it fairly common usage within computing circles, Phil. I've heard those called instruction cycles, with clock cycles being the pulses from the crystal oscillator. Never heard of tacts in my time – TonyM Nov 19 '17 at 21:18
-
4OK, seems like this wasn't as common as I thought it was; looks very much like I picked it up from the Russian scene in the late 90s / early 2000s. I'll edit at some point when I'm not at work ;-) – Philip Kendall Nov 20 '17 at 10:05
The word "такт" is routinely used in russian to denote exactly "clock cycle" in digital electronics.
It always was and still is heavily used in the russian ZX scene in the same meaning (e.g. counting clock cycles of Z80 CPU, etc.) and sometimes was (and is) leaking to the english texts written by native russian speakers.
So "tact" could be recognized as a semantic loan from russian.
-
According to google translate "такт = time/measure/beat," Sounds like an accurate answer to me! – LateralTerminal Nov 21 '17 at 17:26
-
1It's the same in German: "Takt" is the German expression for "clock cycle". The original meaning of "Takt" is "musical meter/beat", e.g. "3/4 Takt", from Latin tactum. So I doubt it's a calque from Russian, Russian probably also imported it from Latin. Given that English doesn't borrow at lot of words from Russian, but does borrow a lot of musical terms ("Leitmotif") from German, my guess is that the borrowing happened along those lines. – dirkt Nov 22 '17 at 7:35
-
Of course it existed as a word well before 90ies :) But was it ever used in the meaning of "clock cycle" before? – lvd Nov 22 '17 at 7:47
-
I've just fixed my answer with the new term instead of "calque", which fits better. – lvd Nov 22 '17 at 9:44
Tact
[T]
This term is equivalent for CPU clock period and it is the smallest time chunk in CPU based computer timings. One level higher are the MC machine cycles (each MC is 1 or more tacts depends on MC type and CPU architecture). So if you see something like
10T
that means it is time duration of10
periods of CPU clock.This way of timing notation is independent on CPU frequency so you can compute duration of code universally and apply CPU clock on the final time ... It is used mostly for individual instruction timings. Some instructions have 2 times like
8/10T
which means instruction can run in either8T
or10T
depending on something (like state of flags, condition, etc).Here some example instructions timing for Z80:
opc T0 T1 MC1 MC2 MC3 MC4 MC5 MC6 MC7 mnemonic B8 04 00 M1R 4 ... 0 ... 0 ... 0 ... 0 ... 0 ... 0 CP A,B B9 04 00 M1R 4 ... 0 ... 0 ... 0 ... 0 ... 0 ... 0 CP A,C BA 04 00 M1R 4 ... 0 ... 0 ... 0 ... 0 ... 0 ... 0 CP A,D BB 04 00 M1R 4 ... 0 ... 0 ... 0 ... 0 ... 0 ... 0 CP A,E BC 04 00 M1R 4 ... 0 ... 0 ... 0 ... 0 ... 0 ... 0 CP A,H BD 04 00 M1R 4 ... 0 ... 0 ... 0 ... 0 ... 0 ... 0 CP A,L BE 07 00 M1R 4 MRD 3 ... 0 ... 0 ... 0 ... 0 ... 0 CP A,(HL) BF 04 00 M1R 4 ... 0 ... 0 ... 0 ... 0 ... 0 ... 0 CP A,A C0 11 05 M1R 5 MRD 3 MRD 3 ... 0 ... 0 ... 0 ... 0 RET NZ C1 10 00 M1R 4 MRD 3 MRD 3 ... 0 ... 0 ... 0 ... 0 POP BC C2L2H2 10 10 M1R 4 MRD 3 MRD 3 ... 0 ... 0 ... 0 ... 0 JP NZ,U16 C3L1H1 10 00 M1R 4 MRD 3 MRD 3 ... 0 ... 0 ... 0 ... 0 JP U16 C4L2H2 17 10 M1R 4 MRD 3 MRD 4 MWR 3 MWR 3 ... 0 ... 0 CALL NZ,U16 C5 11 00 M1R 5 MWR 3 MWR 3 ... 0 ... 0 ... 0 ... 0 PUSH BC C6U2 07 00 M1R 4 MRD 3 ... 0 ... 0 ... 0 ... 0 ... 0 ADD A,U8 C7 11 00 M1R 5 MWR 3 MWR 3 ... 0 ... 0 ... 0 ... 0 RST 00H C8 11 05 M1R 5 MRD 3 MRD 3 ... 0 ... 0 ... 0 ... 0 RET Z C9 10 00 M1R 4 MRD 3 MRD 3 ... 0 ... 0 ... 0 ... 0 RET CAL2H2 10 10 M1R 4 MRD 3 MRD 3 ... 0 ... 0 ... 0 ... 0 JP Z,U16 opc: operation code [hex] L1,H1,U1,S1 means first operand direct number or address L2,H2,U2,S2 means second operand direct number or address L3,H3,U3,S3 means third operand direct number or address H,L ... U16 high and low byte U ... U8 unsigned byte S ... S8 signed byte T0 normal instruction duration [T] always 2 decimal digits T1 instruction duration if condition not met [T] always 2 decimal digits MC1++ Machine cycle first is type,second is duration [T] always 1 decimal digit ... unused M1R M1 cycle MRD memory read MWR memory write IOR IO read IOW IO write NON no external operation (internal computation) INT interrupt cycle mnem instruction text (mnemonic)
opc
is used for the address in an array of pointersmnemonic
is used to select the proper function pointer, and operands typeT0
andT1
are used for instructions timing (this is enough for rough emulations)MC1++
are used for correct MC timings (to implement correct hardware emulation and contentions timing)
As you can see all the times are in
[T]
tacts.Tacts per frame
On ZX computers the screen is outputted with 50 Hz frequency triggering interrupt each frame. The time between two interrupts in CPU clock tacts is referred as tacts per frame. This value is defined by model of ZX (type of ULA) and CPU clock frequency. It can be measured and used to determine type of ZX by reading IR register and approximation.
This value is very important as all the stuff your code is doing must fit into it. The frame timing itself is a bit more complicated and can be used to achieve border effects or even multitech techniques.
IIRC here are some actual values:
69888T ZXS 48k 70908T ZXS 128K 80384T Didaktik M,Didaktik Kompakt
-
1Do you have any official sources which use "tact"? At the moment, it seems this term was somewhat invented by the Russian / Eastern European scene rather than anything else. – Philip Kendall Nov 21 '17 at 9:35
-
1@PhilipKendall Well I am from Eastern Europe (not Russia however) and the term is here a common knowledge (but you might be right as we did not have any official Western docs accessible at that time). Here an example of use in book asm and ZX spectrum. In English speaking community is sometimes therm
tics
used instead. – Spektre Nov 21 '17 at 15:34 -
1Another common term for the same meaning in "T-states" (which IIRC comes from the official Z80 literature). I've always assumed when I see "T" in documents like the one you quote above that this is what it referred to. – Jules Nov 22 '17 at 9:22
-
@Jules I just was going to mention "T-states" too. I'd never heard of either "tacts" or "tics". I programmed machine code on a Spectrum in about 1983 when I was 15. I wasn't party of any "scene". I had an American Z80 book and a few British Spectrum programming books in Australia. – hippietrail Apr 22 '20 at 18:39
-
@hippietrail I am 100% sure I saw tics in english written stuff but it might have been for x86 platform instead of Z80 ... and not written by English authors ... – Spektre Apr 22 '20 at 20:16
The much more commonly used term for the same thing outside Eastern Europe might be T-State, which is (without the hyphen) used by the original Zilog manuals - Another term is Instruction Cycle, which commonly notes the minimal instruction timing of a Z80, which consists of four T-states.
Takt is also used in German, but here we commonly use it as a synonym for "clock".