GATE CSE COA Formula Sheet: Cache, Pipelining, IEEE 754, Addressing
Computer Organization and Architecture is the most numerical core subject in GATE CSE, and most of its marks come from four formula families: cache mapping, memory access time, pipelining and number formats. This sheet goes deeper than the general GATE CSE formula sheet. Each formula is shown with a one-line worked example and the trap that costs marks.
In this guide
Key takeaways
- Cache mapping is three logs and a subtraction: offset from block size, index from the number of sets, and the tag takes the rest.
- Hierarchical AMAT adds a lower level's time only on a miss at the level above.
- A -stage pipeline runs instructions in cycles, and the cycle includes the latch delay.
- IEEE 754 single precision splits 32 bits as 1, 8 and 23, with bias 127 and an implicit leading 1.
- A PC-relative offset is measured from the next instruction, in the units the question states.
- Byte versus word addressing causes more wrong answers in this subject than any formula.
The terms this sheet uses
- A block (or line) is the unit a cache moves to and from memory. A set is a group of lines, and is the associativity.
- An address splits into tag, index and offset. The offset picks a byte in the block, the index picks the set, and the tag tells blocks in the same set apart.
- The local miss rate of a level is its misses divided by the accesses that reach it. The global miss rate is its misses divided by all CPU accesses.
- A pipeline stage does one part of an instruction. A latch (pipeline register) sits between stages and adds its own delay to every cycle.
- CPI is cycles per instruction. A stall is a cycle in which an instruction cannot move forward.
- The effective address (EA) is the memory address an operand is finally read from.
Here means , and KB means bytes.
Cache mapping: tag, index and offset
Work from the block outwards. The offset must address every byte of a block, the index must address every set, and the tag covers what is left.
| Formula | One-line example | Watch out for |
|---|---|---|
| 32 B blocks: 5 bits | Counts words if the memory is word-addressable | |
| 64 KB, 4-way, 32 B: | Fully associative has one set; direct-mapped has | |
| bits | Fully associative: index | |
| 32-bit address: bits | Use the address width, not the memory size in bytes | |
| Block goes to set | Block 1000 to set | Mod the number of sets, not lines |
| Tag directory lines (tag valid dirty LRU) | bits KB | Dirty bit only for write-back |
Remember: Doubling the associativity with the size and block fixed halves the sets, so the index loses one bit and the tag gains one. The offset never changes. The cache memory question guide traces hits and misses with these splits.
Average memory access time across levels
The time you always pay is the L1 time. You add the L2 time only when L1 misses, and the memory time only when L2 misses as well:
Here is the access time of level and is its local miss rate.
Worked example. With ns, , ns, and ns for two levels:
The global miss rate of L2 is .
| Formula | One-line example | Watch out for |
|---|---|---|
| Global miss rate | A local rate is per access reaching that level | |
| Misses per instruction miss rate accesses per instruction | Accesses include the instruction fetch | |
| Parallel model: | Use only when the question says so | "Miss penalty" may already include the check time |
Trap: Adding the L2 hit time on every access treats a hierarchical cache as if L2 were always checked. In the hierarchical model the lower level is reached only on a miss.
Pipelining: cycle time, total time and speedup
The clock must wait for the slowest stage and the latch after it. The first instruction then takes cycles and each later one adds a single cycle:
Worked example. Stages of 4, 6, 9 and 5 ns with a 1 ns latch give ns. For 100 instructions, ns and ns. The speedup is .
| Formula | One-line example | Watch out for |
|---|---|---|
| Speedup ; limit | Limit | Equals only for equal stages and zero latch |
| Split the slowest stage: new | Split 9 into 4.5 and 4.5: ns | rises by one, which matters for finite |
| Total cycles | 5 stages, 6 instructions, 2 stalls: 12 | Load-use leaves 1 stall even with forwarding |
| Penalty is resolution stage minus 1 | ||
| s | GHz versus ns |
Trap: The non-pipelined time has no latch delay, and the pipelined time is never cycles. The pipelining question guide works through hazard timing diagrams.
The book's last-minute revision sheet carries the complete table for this subject, including DMA, microprogrammed control, memory interfacing and DRAM refresh, each with symbols, when it applies and its trap. It is part of the GATE CSE 2027 book.
IEEE 754: decoding and the special values
A single-precision number stores a sign bit , an 8-bit exponent field and a 23-bit fraction . For a normalised value the hardware adds an implicit leading 1:
Worked example. Decode 0x40A00000. In binary the first bits are 0 10000001 0100..., so , and . The value is .
| Case | Rule | Watch out for |
|---|---|---|
| , | Two zeros exist | |
| , | Denormal: | No implicit 1, exponent not |
| if , NaN otherwise | All-ones exponent is reserved | |
| Extremes | Smallest normal ; smallest denormal ; largest | Largest is about |
| Integers | Every integer up to is exact ( in double) | Double is 1, 11, 52 bits with bias 1023 |
For a custom format with exponent bits, fraction bits and bias , the largest value is when the all-ones exponent is reserved.
Trap: Split a hex pattern into 1, 8 and 23 bits before reading it, because hex digits straddle the field boundaries. Using bias 128 is the classic wrong answer. The number-representation side is covered in the digital logic important topics guide.
Addressing modes and instruction encoding
The addressing mode says where an operand lives. Count memory accesses by asking how many times the hardware must read memory to reach it.
| Mode | Effective address | Operand memory accesses |
|---|---|---|
| Immediate | Operand is in the instruction | 0 |
| Register / register indirect | Operand in / | 0 / 1 |
| Direct / memory indirect | / | 1 / 2 |
| Indexed or displacement | 1 | |
| PC-relative | 1 |
| Formula | One-line example | Watch out for |
|---|---|---|
| Target | Branch at 2000, 4 B instructions, offset : | Offset is from the next instruction |
| Address lines | 4 GB with 2-byte words: | Not 32 for word-addressable memory |
| Chips | from : | Width ratio as well as depth ratio |
| Signed immediate of bits: to | : to | Unsigned is to |
The COA important topics guide explains which of these families past papers have asked most.
More formula sheets: all of GATE CSE · Computer Networks · Engineering Mathematics · Operating Systems
Quick revision
- , , .
- Block maps to set .
- with local miss rates.
- ; ; non-pipelined time has no latch.
- Branch .
- IEEE 754 single: 1, 8, 23 bits, bias 127, implicit 1; double: 1, 11, 52 bits, bias 1023.
- PC-relative target .
Frequently asked questions
How do I calculate tag, index and offset bits for a cache?
Offset bits are the base-2 log of the block size in bytes. The number of sets is cache size divided by associativity times block size, and index bits are the log of the number of sets. Tag bits are whatever is left of the address. A fully associative cache has no index bits, and a direct-mapped cache has associativity one.
What is the formula for pipeline execution time in GATE?
The cycle time is the largest stage delay plus the latch delay. A k-stage pipeline runs n instructions in , never cycles. The non-pipelined time is n times the sum of the stage delays, with no latch delay. Stall cycles from hazards are added on top of .
What is the bias in IEEE 754 single precision?
The bias is 127 for single precision, which has 1 sign bit, 8 exponent bits and 23 fraction bits. Double precision has 11 exponent bits, 52 fraction bits and bias 1023. A normalised value is the implicit 1 followed by the fraction, times 2 raised to the stored exponent minus the bias. Using 128 as the bias is a common mistake.
How is AMAT calculated for a two-level cache?
In the hierarchical model you always pay the L1 time, add the L2 time only on an L1 miss, and add the memory time only on an L2 miss. With local miss rates, AMAT equals t1 plus m1 times (t2 plus m2 times the memory time). GATE questions usually intend this model unless they state that the levels are searched in parallel.
Where is a PC-relative branch offset measured from?
From the address of the next instruction, because the program counter has already been incremented when the branch executes. The target is the next-instruction address plus the offset times the instruction size, unless the question says the offset is already in bytes. Measuring from the branch instruction itself is a common trap in past papers.
Sources
Dates, fees and the syllabus are set by the GATE 2027 organising institute and can change. Always confirm at gate2027.iitm.ac.in.