Epson Apex 386/33 Canadian Product User Manual - Page 145

Cache Updating, Write-Back System

Page 145 highlights

The direct-mapped cache organization diagram above shows how data contained in cache are accessed. For example, if the 80386 requests data at the address FFFFF9h in the main memory, the procedure is as follows: The cache-controlled logic determines the cache location from the 14 least significant bits of the index field (FFF8h). The cache controlled logic compares the tag field (FFh) with the tag stored at location FFF8h in the tag RAM. If the tag matches, the processor reads the second byte of the 4-byte sub-block from the data in the cache RAM. If the tag does not match, the cache logic fetches the 4-byte sub-block at address FFFFF8h in the main memory and loads it into location FFF8h of the cache RAM, replacing the current sub-block. The logic also changes the tag stored at locations FFF8h to FFh. The processor then reads the second byte of the new four-byte sub-block. Cache Updating - Write-Back System In a write-back system, the tag field of each block in the cache includes a bit called the ALTERED bit. The bit is set if the block has been written with new data and therefore contains data that is more recent than the corresponding data in the main memory. Before writing any block in the cache, the cache-controlled logic checks the altered bit. If it is set, the cache controlled logic writes the block to the main memory before loading new data into the cache. The write-back system is faster than the write-through system because the number of times an altered block must be copied into the main memory is usually less than the number of write accesses. 26 Chapter 6: Appendix

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171

The direct-mapped cache organization diagram above shows how
data contained in cache are accessed.
For example, if the 80386 requests data at the address FFFFF9h in the
main memory, the procedure is as follows:
The cache-controlled logic determines the cache location
from the 14 least significant bits of the index field (FFF8h).
The cache controlled logic compares the tag field (FFh) with
the tag stored at location FFF8h in the tag RAM.
If the tag matches, the processor reads the second byte of
the 4-byte sub-block from the data in the cache RAM.
If the tag does not match, the cache logic fetches the 4-byte
sub-block at address FFFFF8h in the main memory and
loads it into location FFF8h of the cache RAM, replacing the
current sub-block. The logic also changes the tag stored at
locations FFF8h to FFh. The processor then reads the
second byte of the new four-byte sub-block.
Cache Updating -
Write-Back System
In a write-back system, the tag field of each block in the cache includes
a bit called the ALTERED bit. The bit is set if the block has been written
with new data and therefore contains data that is more recent than the
corresponding data in the main memory. Before writing any block in the
cache, the cache-controlled logic checks the altered bit. If it is set, the
cache controlled logic writes the block to the main memory before
loading new data into the cache.
The write-back system is faster than the write-through system because
the number of times an altered block must be copied into the main
memory is usually less than the number of write accesses.
26
Chapter 6: Appendix