Skip to content
GATEiit

GATE CSE Computer Organization and Architecture formula sheet

Key formulas and rules for GATE CSE Computer Organization and Architecture: instruction formats and addressing modes, ALU and IEEE 754 arithmetic, control unit design, cache and memory hierarchy, I/O and DMA, and instruction pipelining.

52 formulas · updated 2026-11-14 · reviewed 2026-11-14 · Spotted an error? Tell us

Instruction set and addressing modes

  • Opcode bits

    opcode bits=⌈log⁡2(number of distinct operations)⌉

    Similarly, a register field needs ⌈log⁡2R⌉ bits for R registers.

  • Address bits

    address bits=log⁡2(memory sizeaddressable unit size)

    For byte-addressable memory the unit is 1 byte; for word-addressable memory it is one word.

  • Expanding opcode

    N1=(2o−N2)⋅2a

    o = opcode bits of the 2-address format, N2 = 2-address instructions used, a = bits of the freed address field; N1 = max 1-address instructions.

  • Immediate and direct

    Immediate: operand=ADirect: EA=A

    Immediate needs no memory access for the operand; direct needs one.

  • Indirect

    EA=M[A]

    Two memory accesses to get the operand (one for the address, one for the data).

  • Register and register indirect

    Register: operand=RRegister indirect: EA=R

    Register indirect needs one memory access for the operand.

  • Indexed / base-register

    EA=A+RindexEA=Rbase+offset

    Indexed suits array access; base-register suits relocation.

  • PC-relative

    EA=PCupdated+offset

    PC normally already points to the next instruction when EA is formed; a common GATE trap. Used for branches, gives position-independent code.

  • Auto-increment / decrement

    Auto-inc: EA=R,  R←R+dAuto-dec: R←R−d,  EA=R

    d = operand size in addressable units; post-increment and pre-decrement are the usual forms (stack operations).

ALU and number representation

  • Two's complement range

    −2n−1  ≤  x  ≤  2n−1−1

    n-bit signed integer. Sign-magnitude and one's complement range is −(2n−1−1) to 2n−1−1 (two zeros).

  • Overflow detection

    V=Cn⊕Cn−1

    Carry into and out of the sign bit differ. Equivalently: adding two numbers of the same sign gives a result of the opposite sign.

  • Carry lookahead

    Gi=AiBi,Pi=Ai⊕Bi,Ci+1=Gi+PiCi

    Expanding gives every carry as a two-level AND–OR of G, P and C0: 2 gate delays after G, P (3 including G, P generation; sum adds an XOR level). Ripple-carry delay grows linearly with n.

  • Ripple-carry adder delay

    TRCA≈n⋅tcarry

    Each full adder waits for the previous carry; the last sum bit is ready after the carry reaches it.

  • Booth's recoding

    (Q0,Q−1):  00,11→shift;    01→A+M;    10→A−M

    Followed by an arithmetic right shift each step. Number of additions/subtractions = number of 01 and 10 transitions.

  • IEEE 754 single (normalised)

    x=(−1)S×1.M×2E−127,1≤E≤254

    1 sign, 8 exponent, 23 mantissa bits; bias 127.

  • IEEE 754 double (normalised)

    x=(−1)S×1.M×2E−1023,1≤E≤2046

    1 sign, 11 exponent, 52 mantissa bits; bias 1023.

  • Exponent bias

    bias=2k−1−1

    k = exponent field width. Stored exponent E = actual exponent + bias.

  • IEEE 754 special values

    Denormals (single) use exponent −126, not −127. For double use 2047 and −1022.

  • Single-precision limits

    min normal=2−126,max=(2−2−23)×2127

    Smallest positive denormal is 2−149.

Control unit design

  • Horizontal microcode

    control field width=number of control signals

    One bit per signal: fastest decoding, widest control word, high parallelism.

  • Vertical microcode

    control field width=∑g⌈log⁡2(ng+1)⌉

    Signals encoded in groups of mutually exclusive signals; the +1 allows a no-operation code in each group (drop it if the question says otherwise). Narrower but needs decoders.

  • Microinstruction format

    W=control bits+⌈log⁡2F⌉+⌈log⁡2N⌉

    F = number of branch conditions/flags to select from, N = number of microinstructions in control memory (next-address field).

  • Control memory size

    CM size=N×W bits

    N microinstructions of width W bits.

  • Hardwired vs microprogrammed

    hardwired: fast, inflexiblemicroprogrammed: slower, easy to modify

    RISC designs typically use hardwired control; CISC traditionally microprogrammed.

Memory hierarchy and cache

  • AMAT (hierarchical access)

    Tavg=tc+(1−h) tm

    Memory is accessed only after a cache miss. Equivalent to h tc+(1−h)(tc+tm).

  • AMAT (simultaneous access)

    Tavg=h tc+(1−h) tm

    Cache and memory accessed in parallel. Read the question to know which model applies.

  • Two-level cache

    Tavg=tL1+mL1(tL2+mL2 tm)

    mL2 here is the local miss rate of L2 (misses / L1 misses). Global L2 miss rate = mL1 mL2.

  • Miss penalty with block transfer

    tmiss=tlatency+block sizebus width×ttransfer

    When a block of several words must be fetched over a narrower bus.

  • CPI with memory stalls

    CPI=CPIbase+memory accessesinstruction×miss rate×miss penalty

    Penalty in cycles; count instruction fetches plus data accesses.

  • Direct-mapped address split

    A = address bits, L = cache lines, B = block size in addressable units. Block j goes to line j mod L.

  • Set-associative address split

    S=Lk,set bits=log⁡2S,tag=A−log⁡2S−log⁡2B

    k-way set associative; block j goes to set j mod S. Needs k comparators of tag width.

  • Fully associative

    tag=A−log⁡2B

    No index field; needs L comparators (one per line).

  • Tag directory size

    size=L×(tag+valid+dirty+replacement bits)

    Include only the extra bits the question states (dirty only for write-back).

  • Write policies

    write-through: memory updated on every writewrite-back: on eviction of dirty block

    Write-allocate usually pairs with write-back, no-write-allocate with write-through.

  • Memory chips needed

    #chips=total capacitychip capacity,2n×m chip: n address, m data lines

    Extra high-order address bits drive a decoder that selects the chip row.

  • Three Cs of misses

    compulsory+capacity+conflict

    Fully associative cache has no conflict misses; compulsory misses occur even with infinite cache.

I/O interface: interrupts and DMA

  • Word transfer time

    tword=word sizedevice data rate

    Time between successive words from the device.

  • Polling / interrupt overhead

    CPU fraction=events per second×cycles per eventclock rate

    Events = polls (polling) or interrupts (interrupt-driven I/O).

  • DMA burst mode

    fraction CPU blocked=yx+y

    x = time for the device to prepare a block, y = time to transfer the block on the bus. CPU is off the bus for the whole burst.

  • DMA cycle stealing

    fraction CPU blocked=ttransfer per wordtbetween words

    DMA takes the bus for one word at a time; interleaves with CPU.

  • Interrupt priority

    daisy chain: priority∝nearness to CPU

    Vectored interrupts give the ISR address directly; DMA requests are honoured at bus-cycle boundaries, interrupts at instruction boundaries.

Instruction pipelining and hazards

  • Pipeline clock

    τ=max⁡i(τi)+tlatch

    The slowest stage sets the clock; add the buffer/latch delay if given.

  • Time for n instructions

    Tpipe=(k+n−1) τ

    k stages, no stalls. First instruction takes k cycles, each later one adds 1.

  • Speedup

    tnp = time per instruction without pipelining. Equals k only when stages are balanced and latch delay is zero.

  • Efficiency and throughput

    E=Sk=nk+n−1,throughput=n(k+n−1) τ

    Efficiency formula assumes tnp=kτ (balanced stages).

  • Pipeline CPI with stalls

    CPI=1+stall cycles per instruction

    Ideal pipelined CPI is 1.

  • Speedup with stalls

    S=CPInp×Tnp(1+stalls/instr)×Tpipe

    With balanced stages and CPInp=1 at clock kτ: S=k/(1+stalls per instruction).

  • Branch penalty

    CPI=1+fbranch×ptaken×penalty

    Drop ptaken if every branch stalls (no prediction). Penalty = stages until the branch is resolved.

  • Data hazard types

    RAW (true),WAR (anti),WAW (output)

    In a simple in-order pipeline only RAW causes stalls; WAR/WAW matter with out-of-order or multi-cycle stages; removed by register renaming.

  • Forwarding in 5-stage pipeline

    ALU→ALU:0 stalls,load→use:1 stall

    Classic IF-ID-EX-MEM-WB. Without forwarding (write in first half, read in second half of a cycle) a back-to-back RAW needs 2 stalls.

  • CPU time

    TCPU=IC×CPI×tclk=IC×CPIf

    MIPS = f/(CPI×106).

  • Amdahl's law

    S=1(1−f)+fs

    f = fraction of time that is enhanced, s = speedup of that part. Max speedup 1/(1−f).

Where marks come fromTopic-wise PYQ analysis →Use the formulasPractise PYQs on this subject →For numerical answersGATE virtual calculator →