COA Notes
COA Notes
• If address bus width = 10 bits => memory = 210 = 1024 bytes ≈ 1KB (kilobyte)
• Volatile Memories examples: RAM, Cache, Registers. (Loses data when power source turns off).
• Non-volatile Memories examples: ROM, SSD, HDD. (Retains data when power source turns off).
• Stored charge (bit) in DRAM might leak away even with power continuously applied.
• Cache memory is sometimes called CPU memory, because it is typically integrated directly into
the CPU chip or placed on a separate chip that has a separate bus interconnect with the CPU.
Chapter 2:
• Moore observed that the number of transistors that could be put on a single chip was
• doubling every year.
Where OET is time to execute on 1 Processor, while NET is time to execute on N parallel processors.
• CPI = (CPI1 x I1) + (CPI2 x I2) + … (CPIn x In) CPI: Cycle Per Instruction.
Ic In: number of executed instructions.
Ic: sum of all number of executed instructions.
• Ic = T × [(MIPS rate)/106 ]
• t= 1
f
• Arithmetic mean = 1/n x ( x1 + x2 +… xn) -OR- sum of values / total number of values (N).
• Harmonic mean = total number of values / (1/x1 + 1/x2 + … + 1/xn).
Chapter 3:
• Instruction Cycle: Fetch -> Decode -> (Load) -> Execute -> (Store).
• Instruction Format:
ASA
svdv
(ADD, JUMP, SUB…)
• If 4 bits for opcode => 12 bits for address => memory = 212.
• Possible states that define an instruction execution: Instruction Address Calculation (IAC) ->
Instruction Fetch (IF) -> Instruction Operation Decoding (IOD) -> Operand Address Calculation
(OAC) -> Operand Fetch (OF) -> Data Operation (DO) -> Operand Store (OS).
• 32-bit microprocessor -> 16-bit external data bus -> Data transferred per bus cycle = 32/16 = 2B.
• Maximum bus cycle rate = Bus Clock/Minimum Bus Cycle Duration.
• Data transfer rate (Bytes/sec) = bus cycle rate * data per bus cycle.
Chapter 4:
• Direct Mapping:
Direct mapping maps each block of main memory into only one possible cache line.
S W
Tag r
s-r
r: number of lines
w: word
Main memory size = ??? (Sometimes blocks x words/block) = 8K x 128 = 23 * 210 * 27 = 220.
Number of addressable units = 2 20.
Number of Sets in cache =
example: 128 lines divided into 2-line sets => 27/21 = 26 = 6 bits (if two-way set associative).
example: 128 lines divided into 4-line sets => 27/22 = 25 = 5 bits (if four-way set associative).
Number of blocks in main memory = 8K = 213 = 13.
We know that Sets + Tag = blocks => 6 + Tag = 13 => Tag = 7 bits.
Word = Number of addressable units – (Tag + Set) = 20 – (7+6) = 7 bits.
• Associative Mapping:
Associative mapping permits each main memory block to be loaded into any line of the cache.
Tag W
Very similar to set-associate, but with the absence of Set and Tag takes up most of the
addressable units.
Direct Mapping Equations Associative Mapping Set-Associative Mapping
Equations Equations
Address length = s+w bits Address length = s+w bits Address length = s+w bits
Number of addressable units Number of addressable units Number of addressable units
= 2s+w = 2s+w = 2s+w
Block size = line size = 2w Block size = line size = 2w Block size = line size = 2w
Number of blocks in main Number of blocks in main Number of blocks in main
memory = 2s+w/2w = 2s memory = 2s+w/2w = 2s memory = 2s+w/2w = 2s
Number of lines in cache = 2r Number of lines in cache = Number of lines in set = k
undetermined (can’t be
determined in address)
Size of Cache= 2r+w Size of tag = s Number of sets = v = 2d
Size of tag = s-r Number of lines in cache = m
= kv = k x 2d
Size of Cache = k x 2d+w
Size of tag = s-d