Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Bank switching
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Technique == Bank switching can be considered as a way of extending the [[address space]] of processor instructions with some register. Examples: *The original [[CDC 160]] processor has 12-bit addresses; the follow-up CDC 160-A processor, a follow-on to the CDC 160, has a 15-bit address bus, but there is no way to directly specify the high three bits on the address bus. Internal bank registers can be used to provide those bits.<ref>{{cite book | title = Control Data 160-A Computer Programming Manual | id = 145e | section = Storage Control | page = 2-09 | date = March 1963 | url = https://bitsavers.org/pdf/cdc/160/CDC160A/145e_CDC160A_Programming_Manual_196303.pdf | publisher = CDC }} </ref> *The [[CDC 1604]] has 15-bit addresses; the follow-on [[CDC 3600]] system has an 18-bit address bus, but legacy instructions only have 15 address bits; internal bank registers can be used to provide those bits. Some new instructions can explicitly specify the bank.<ref>{{cite book | title = Control Data 3600 Computer System Reference Manual | id = 60021300E | url = http://bitsavers.org/pdf/cdc/3x00/48bit/3600/60021300E_3600_SysRef_Sep64.pdf | publisher = CDC }} </ref> <!-- Much of this text should be split off into a section on microprocessors. --> *A processor with a 16-bit external address bus can only address 2<sup>16</sup> = 65536 memory locations. If an external [[latch (electronics)|latch]] was added to the system, it could be used to control which of two sets of memory devices, each with [[65536]] addresses, could be accessed. The processor could change which set is in current use by setting or clearing the latch bit. <br>The latch can be set or cleared by the processor in several ways; a particular memory address may be decoded and used to control the latch, or, in processors with separately-decoded [[port-mapped I/O|I/O addresses]], an output address may be decoded. Several bank-switching control bits could be gathered into a register, approximately doubling the available memory spaces with each additional bit in the register. <br>Because the external bank-selecting latch (or register) is not directly connected with the [[program counter]] of the processor, it does not automatically change state when the program counter overflows; this cannot be detected by the external latch since the program counter is an internal register of the processor. The extra memory is not seamlessly available to programs. Internal registers of the processor remain at their original length, so the processor cannot directly span all of bank-switched memory by, for example, incrementing an internal register.<ref name="Heath_2003"/> Instead the processor must explicitly do a bank-switching operation to access large memory objects. There are other limitations. Generally{{cn|date=June 2020}} a bank-switching system will have one block of program memory that is common to all banks; no matter which bank is currently active, for part of the address space only one set of [[memory location]]s will be used. This area would be used to hold code that manages the transitions between banks, and also to process [[interrupt]]s. Often a single database spans several banks, and the need arises to move records between banks (as for sorting). If only one bank is accessible at a time, it would be necessary to move each byte twice: first into the common memory area, perform a bank switch to the destination bank, and then actually to move the byte into the destination bank. If the computer architecture has a [[Direct memory access|DMA]] engine or a second CPU, and its bank access restrictions differ, whichever subsystem can transfer data directly between banks should be used. Unlike a [[virtual memory]] scheme, bank-switching must be explicitly managed by the running program or operating system; the processor hardware cannot automatically detect that data not currently mapped into the active bank is required. The application program must keep track of which [[memory bank]] holds a required piece of data, and then call the bank-switching routine to make that bank active.<ref name="Mueller_1992"/> However, bank-switching can access data much faster than, for example, retrieving the data from disk storage.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)