JPH03164842A - Memory controller - Google Patents

Memory controller

Info

Publication number
JPH03164842A
JPH03164842A JP30417189A JP30417189A JPH03164842A JP H03164842 A JPH03164842 A JP H03164842A JP 30417189 A JP30417189 A JP 30417189A JP 30417189 A JP30417189 A JP 30417189A JP H03164842 A JPH03164842 A JP H03164842A
Authority
JP
Japan
Prior art keywords
memory
bank
address
output
flip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP30417189A
Other languages
Japanese (ja)
Inventor
Yoshihisa Tashimo
田下 吉久
Satoshi Nakatani
聡志 中谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Furuno Electric Co Ltd
Original Assignee
Furuno Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Furuno Electric Co Ltd filed Critical Furuno Electric Co Ltd
Priority to JP30417189A priority Critical patent/JPH03164842A/en
Publication of JPH03164842A publication Critical patent/JPH03164842A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To efficiently use a memory space in accordance with contents to be processed by generating the address of an extended memory in accordance with the number of the bank constituted on the extended memory, the capacity of the bank address space, and an address signal outputted from a CPU. CONSTITUTION:When the address of the address signal outputted from the CPU is in the bank address space and bank switching is selected, a memory switching control means 16 switches the memory from a main memory 2 to an extended memory 3. An upper address generating means 17 generates the upper address of the extended memory in accordance with the number of the bank constituted on the extended memory, the capacity of the bank address space, and the upper address signal of the address signal outputted from the CPU. Thus, the memory space is efficiently used in accordance with processing contents.

Description

【発明の詳細な説明】 (al産業上の利用分野 この発明はマイクロコンピュータにおけるメモリのバン
ク切換制御を行うメモリ制御装置に関する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention This invention relates to a memory control device for controlling memory bank switching in a microcomputer.

<tel従来の技術 マイクロコンピュータにおいてCPUが直接アクセスす
ることのできるメモリ空間は、CPUから出力されるア
ドレス信号のビット数によ’/l定まり、例えば8ビツ
トマイクロプロセツサは一般にアドレス信号が16ビツ
トであり、最大64KBのアドレス空間がメモリ空間と
して用いられる。
<telConventional Technology In a microcomputer, the memory space that can be directly accessed by the CPU is determined by the number of bits of the address signal output from the CPU.For example, an 8-bit microprocessor generally uses a 16-bit address signal. Yes, and a maximum address space of 64 KB is used as memory space.

また、CPUから出力されるアドレス信号によるアドレ
ス空間より広い空間でメモリをアクセスする場合には、
メインメモリとは別に設けた拡張メモリをメインメモリ
と切り換えて用いるか、メインメモリの特定アドレス範
囲を介して拡張メモリをアクセスする所謂バンク切換制
御が行われている。
Also, when accessing memory in a space wider than the address space provided by the address signal output from the CPU,
So-called bank switching control is performed in which an extended memory provided separately from the main memory is used in place of the main memory, or the extended memory is accessed via a specific address range of the main memory.

第8図に従来のバンク切換制御を行う回路の例を示す。FIG. 8 shows an example of a circuit for performing conventional bank switching control.

この例はメインメモリのアドレス空間のうち拡張メモリ
のバンクを開くバンクアドレス空間が$E000〜$E
FFFに設定されている例である。同図においてAND
ゲート5〜7、N。
In this example, the bank address space to open the extended memory bank in the main memory address space is $E000 to $E.
In this example, it is set to FFF. In the same figure, AND
Gates 5-7, N.

Rゲート8およびANDゲート9はcpuが出力するア
ドレス信号の上記4ビツトA15〜A12が1110す
なわち指定アドレスが$E×××である状態を検出する
論理回路である。また、13はCPU1が出力するWR
*信号(アクティブローのライト信号)のタイミングで
1ビツトデータを記憶するフリップフロップであり、バ
ンク切換が行われるときセフ)され、バンク切換が行わ
れないときリセットされる。従ってフリップフロップ1
3がセット状態で且つEOOO〜$EFFFがアドレス
指定されたときNANDゲート10の出力が“L”レベ
ルとなって拡張メモリ3が選択される。一方、このとき
ORゲート12の出力が′H″レベルとなってメインメ
モ・す2は選択されない、ここでC8*はアクティブロ
ーのチップセレクト信号である。フリップフロップ13
がリセット状態であるとき、または$E000〜$EF
FFF以外の空間がアドレス指定されたときはNORゲ
ート10の出力が“H”レベルとなって拡張メモリ3が
選択されない。また、この状態でアドレスデコーダ4が
メインメモリ2のメモリ空間がアドレス指定されている
ことを検出すれば、その出力を“L”レベルにするため
、ORゲート12の出力が“L3となってメインメモリ
2が選択されることになる。
The R gate 8 and the AND gate 9 are logic circuits that detect a state in which the four bits A15 to A12 of the address signal output by the CPU are 1110, that is, the designated address is $Exxx. In addition, 13 is the WR output by CPU1
*This is a flip-flop that stores 1-bit data at the timing of a signal (active low write signal), and is cleared when banks are switched, and reset when banks are not switched. Therefore flip-flop 1
3 is in the set state and when EOOO to $EFFF are addressed, the output of the NAND gate 10 goes to the "L" level and the extended memory 3 is selected. On the other hand, at this time, the output of the OR gate 12 becomes 'H' level, and the main memory 2 is not selected.Here, C8* is an active low chip select signal.Flip-flop 13
is in the reset state, or $E000~$EF
When a space other than FFF is addressed, the output of the NOR gate 10 becomes "H" level and the extended memory 3 is not selected. Furthermore, if the address decoder 4 detects that the memory space of the main memory 2 is addressed in this state, the output of the OR gate 12 becomes "L3" and the output of the OR gate 12 becomes "L3", and the main Memory 2 will be selected.

(e)発明が解決しようとする課題 ところが、このような従来のバンク切換を行うメモリ制
御装置においては、メインメモリのアドレス空間のうち
拡張メモリのバンクを開くバンクアドレスおよびバンク
サイズ(容量)が予め設計された回路によって固定され
ていてプログラムによって変更することは出来なかった
。そのためメモリのマツピングの自由度が低く、取り扱
うデータの種類やデータ量によってはプログラムの負担
が大きくなるという問題があった。
(e) Problem to be Solved by the Invention However, in such a conventional memory control device that performs bank switching, the bank address and bank size (capacity) for opening the extended memory bank in the address space of the main memory are determined in advance. It was fixed by the designed circuit and could not be changed by the program. Therefore, there is a problem that the degree of freedom in memory mapping is low, and the burden on the program increases depending on the type and amount of data to be handled.

この発明の目的は、メインメモリのアドレス空間のうち
拡張メモリのバンクを開くバンクアドレス空間を自由に
設定できるようにして、前述の問題を解消したメモリ制
御装置を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a memory control device that solves the above-mentioned problem by allowing a bank address space for opening a bank of an extended memory to be freely set in the address space of a main memory.

(d)課題を解決するための手段 この発明のメモリ制御装置は、CPUと、このCPUの
バスに接続されているメインメモリおよび拡張メモリを
備えたマイクロコンピュータにおいて、 メインメモリのアドレス空間のうち拡張メモリのバンク
を開くバンクアドレス空間を記憶するバンクアドレス空
間記憶手段と、 バンク切換の選択有無を記憶するバンク切換選択記憶手
段と、 CPUの出力するアドレス信号が上記バンクアドレス空
間にあり、且つバンク切換が選択されているときメモリ
選択をメインメモリから拡張メモリへ切り換えるメモリ
切換制御手段と、拡張メモリ上に構成するバンクの番号
と上記バンクアドレス空間の容量およびCPUの出力す
るアドレス信号から拡張メモリのアドレスを生成するア
ドレス生成手段とからなる。
(d) Means for Solving the Problems The memory control device of the present invention provides an expansion of the address space of the main memory in a microcomputer equipped with a CPU, a main memory and an expansion memory connected to a bus of the CPU. bank address space storage means for storing a bank address space for opening a memory bank; bank switching selection storage means for storing whether or not bank switching is selected; A memory switching control means that switches the memory selection from the main memory to the extended memory when is selected, and the address of the extended memory is determined from the number of the bank configured on the extended memory, the capacity of the bank address space, and the address signal output from the CPU. and address generation means for generating the address.

(81作用 この発明のメモリ制御装置の構成を題1図に示す。また
バンクアドレス空間の例を第2図(A)(B)に示す。
(81 Action) The configuration of the memory control device of the present invention is shown in Figure 1. Examples of bank address spaces are shown in Figures 2 (A) and (B).

第1図に示すように、バンクアドレス空間記憶手段14
は指定されたバンクアドレス空間を記憶する。例えば第
2図(A)に示すように、$7000〜$ 7 FFF
の4KBの空間をバンクアドレス空間として記憶する。
As shown in FIG. 1, bank address space storage means 14
stores the specified bank address space. For example, as shown in Figure 2 (A), $7,000 to $7 FFF
A 4KB space is stored as a bank address space.

バンク切換選択記憶手段15はバンク切換を行うか否か
の選択状態を記憶する。メモリ切換制御手段16はCP
Uの出力するアドレス信号がバンクアドレス空間にあり
、且つバンク切換が選択されているとき、メモリ選択を
メインメモリから拡張メモリへ切り換える。上位アドレ
ス生成手段17は拡張メモリ上に構成するバンクの番号
とバンクアドレス空間の容量およびCPUの出力するア
ドレス信号の上位アドレス信号から拡張メモリの上位ア
ドレスを生成する。
Bank switching selection storage means 15 stores the selection state of whether or not to perform bank switching. The memory switching control means 16 is a CP
When the address signal output by U is in the bank address space and bank switching is selected, the memory selection is switched from the main memory to the extended memory. The upper address generation means 17 generates the upper address of the extended memory from the number of the bank configured on the extended memory, the capacity of the bank address space, and the upper address signal of the address signal output from the CPU.

このようにバンクアドレス空間を任意に設定できるよう
にしたため、例えば第2図(A)に示したバンクアドレ
ス空間を$EOOO〜$EFFFの4KBに移動させる
ことや、同図(B)に示すように$7000〜$8FF
Fの8KBをバンクアドレス空間にするなどバンクサイ
ズを変更することも可能となる。
Since the bank address space can be set arbitrarily in this way, for example, the bank address space shown in Figure 2 (A) can be moved to 4KB from $EOOO to $EFFF, or the bank address space shown in Figure 2 (B) can be moved to 4 KB from $EOOO to $EFFF. from $7000 to $8FF
It is also possible to change the bank size, such as making 8KB of F the bank address space.

(f)実施例 この発明の実施例であるメモリ制御装置のブロック図を
第3図に示す、CPUIのデータバスD7〜DOにはメ
モリ制御装置18、メインメモリ2および拡張メモリ3
を接続している。またCPU1のアドレスバスA15〜
AOをメインメモリ2のアドレス信号として与え、その
うち上位4ピツ)A15〜A12をメモリ制御装置18
へ与え、下位12ビットA11−AOを拡張メモリ3の
下位アドレスMAII〜MAOに与えている。メモリ制
御装置18はメインメモリ2を選択すべきときC31*
をアクティブにし、拡張メモリ3を選択すべきときには
C32*をアクティブにする。また拡張メモリ3に対し
てその上位アドレス信号MA22〜MA12を与える。
(f) Embodiment A block diagram of a memory control device according to an embodiment of the present invention is shown in FIG.
are connected. Also, the address bus A15 of CPU1
AO is given as an address signal for the main memory 2, and the upper 4 bits (A15 to A12) are given to the memory control device 18.
The lower 12 bits A11-AO are applied to the lower addresses MAII-MAO of the extended memory 3. When the memory control device 18 should select the main memory 2, it selects C31*.
C32* is activated when expansion memory 3 is to be selected. Further, the upper address signals MA22 to MA12 are applied to the extended memory 3.

次に上記メモリ制御装置18の構成を第4図および第5
図に示す。
Next, the configuration of the memory control device 18 is shown in FIGS. 4 and 5.
As shown in the figure.

第4図は第3図に示したメモリ制御装置18のうち、こ
の発明に係るバンクアドレス空間記憶手段、バンク切換
選択記憶手段およびメモリ切換制御手段に相当する回路
を含む論理回路である。この例ではバンクアドレス空間
として、その位置を4KB単位すなわちCPUが出力す
るアドレス信号の上位4ビツトA15〜A12によって
設定し、バンクアドレス空間の容量(バンクサイズ)を
4KB、8KB、16KB、32KBまたは64KBの
何れかに設定することができる。第4図において21〜
24は上記バンクアドレス空間の位置を記憶する4ビツ
ト分のフリップフロップ、29〜32は上記バンクサイ
ズを記憶する4ビツト分のフリップフロップであり、こ
れらがこの発明に係るバンクアドレス空間記憶手段に相
当する。
FIG. 4 shows a logic circuit of the memory control device 18 shown in FIG. 3, which includes circuits corresponding to bank address space storage means, bank switching selection storage means, and memory switching control means according to the present invention. In this example, the location of the bank address space is set in 4KB units, that is, the upper 4 bits A15 to A12 of the address signal output by the CPU, and the capacity (bank size) of the bank address space is set to 4KB, 8KB, 16KB, 32KB, or 64KB. It can be set to either. 21~ in Figure 4
24 is a 4-bit flip-flop for storing the position of the bank address space, and 29 to 32 are 4-bit flip-flops for storing the bank size, which correspond to the bank address space storage means according to the present invention. do.

フリップフロップ21〜24は後述するORゲート38
の出力が“L”レベルとなったときデータ信号のD7〜
D4の4ビツトのデータを記憶する、またフリップフロ
ップ29〜32は後述するORゲート39の出力力< 
−t、 mレベルになったときD7〜D4の4ビツトの
データを記憶する。また41はこの発明のバンク切換選
択記憶手段に相当するフリップフロップであり、ORゲ
ート40の出力が“L”レベルになったときデータ信号
のDOの状態を記憶する。バンク切換を選択する際には
このフリップフロップ41をセントする。
The flip-flops 21 to 24 are OR gates 38, which will be described later.
When the output of the data signal becomes “L” level, the data signal D7~
Flip-flops 29 to 32 store the 4-bit data of D4, and the output output of an OR gate 39, which will be described later, is
- When the level reaches t, m, 4-bit data of D7 to D4 is stored. A flip-flop 41 corresponds to the bank switching selection storage means of the present invention, and stores the DO state of the data signal when the output of the OR gate 40 becomes "L" level. When selecting bank switching, this flip-flop 41 is used.

EX−NORゲート25〜28はそれぞれアドレス信号
の上位4ビツトA15〜A12とフリップフロップ21
〜24に記憶されている状態とが一致するとき“H”レ
ベルを出力する。一方、フリップフロップ29〜32の
内容を4ビツトのデータで表せば、バンクサイズが4K
Bであるとき0000.8KBであるとき0001.1
6KBであるとき0011.32KBであるとき011
1さらに64KBであるとき1111が記憶される。従
ってバンクサイズが4KBであるときアドレス信号のA
15〜A12がフリップフロップ21〜24の状態に全
て一致したときのみORゲート33〜36の出力が全て
H”となってANDゲート9の出力が“H”となる。ま
たバンクサイズが8KBに設定されいてるときにはEX
−N。
EX-NOR gates 25 to 28 correspond to the upper 4 bits A15 to A12 of the address signal and the flip-flop 21, respectively.
When the state stored in .about.24 matches, an "H" level is output. On the other hand, if the contents of flip-flops 29 to 32 are expressed as 4-bit data, the bank size is 4K.
B, 0000.8KB, 0001.1
0011 when it is 6KB.011 when it is 32KB
1 and 64 KB, 1111 is stored. Therefore, when the bank size is 4KB, the address signal A
Only when the states of the flip-flops 15 to A12 all match the states of the flip-flops 21 to 24, the outputs of the OR gates 33 to 36 all become "H", and the output of the AND gate 9 becomes "H". Also, the bank size is set to 8KB. EX when it is
-N.

Rゲート28の出力に係わらずORゲート36の出力が
“H”となるため、アドレスの上位3ビツトA15〜A
13とフリップフロップ21〜23が一致すればAND
ゲート23の出力が“Hoとなる。同様にバンクサイズ
が16KBに設定されていればORゲート35および3
6の出力が常に“H”であるため、アドレス信号の上位
2ビットA15.A14とフリップフロップ21.22
のみ一致すればANDゲート9の出力が“H”となる。
Since the output of the OR gate 36 is "H" regardless of the output of the R gate 28, the upper three bits of the address A15 to A
13 and flip-flops 21 to 23 match, AND
The output of gate 23 becomes “Ho”.Similarly, if the bank size is set to 16KB, OR gates 35 and 3
Since the output of A15.6 is always "H", the upper two bits of the address signal A15. A14 and flip-flop 21.22
If only the two match, the output of the AND gate 9 becomes "H".

さらにバンクサイズ64KBに設定されていれば、アド
レス信号に係わらず常にANDゲートの出力が“H”と
なる。例えばフリップフロップ21〜24の4ビツトの
データが1100であり、フリップフロップ29〜32
の4ビツトのデータが0001すなわちバンクサイズ8
KBに設定されているときCPUのアドレス信号が$C
×××または$DXXXであるときすなわち$C000
〜$DFFFのアドレスが選択されるときANDゲート
9の出力が“H”になる。
Furthermore, if the bank size is set to 64 KB, the output of the AND gate will always be "H" regardless of the address signal. For example, the 4-bit data of flip-flops 21-24 is 1100, and the data of flip-flops 29-32 is 1100.
The 4-bit data is 0001, that is, bank size 8.
When set to KB, the CPU address signal is $C.
When it is XXX or $DXXX, that is, $C000
When the address of ~$DFFF is selected, the output of the AND gate 9 becomes "H".

バンク切換が選択されているとき上記フリップフロップ
41の出力が“H”であるため、ANDゲート9の出力
が“H”になるときNANDゲートlOの出力がL”と
なって拡張メモリ3が選択される。またこのときインバ
ータ11の出力が“H”となってORゲート12の出力
が“Hlとなるためメインメモリ2は選択されない。
When bank switching is selected, the output of the flip-flop 41 is "H", so when the output of the AND gate 9 becomes "H", the output of the NAND gate 1O becomes "L", and the expansion memory 3 is selected. At this time, the output of the inverter 11 becomes "H" and the output of the OR gate 12 becomes "Hl", so the main memory 2 is not selected.

第4図においてアドレスデコーダ20はメインメモリ2
に割当られているアドレス信号が選択されたとき選択信
号を出力する回路であり、例えばメインメモリの空間が
$1000〜$FFFFであれば、アドレス信号の上位
4ビツトA15〜A12が0001〜1111であると
き出力を“L”レベルにする。従ってメインメモリ2は
$1000〜$FFFFの範囲で且つ拡張メモリが選択
されていないときに選択される。
In FIG. 4, the address decoder 20 is the main memory 2.
This is a circuit that outputs a selection signal when the address signal assigned to the At some point, the output is set to "L" level. Therefore, main memory 2 is selected in the range of $1000 to $FFFF and when no extended memory is selected.

アドレスデコーダ37は上記フリップフロップ21〜2
4.29〜32.41および後述する他のフリップフロ
ップに対してデータを書き込む際、その書込アドレスを
検出する回路である。例えばアドレス信号が5otoo
であるときADHを*を“L″レベルアクティブ)にし
、アドレス信号が$0101であるときSIZ*をL”
レベルにし、さらにアドレス信号が$0102であると
きC33*を“Lルベルにする。従って$0100番地
にデータ1100xxxxを書き込む命令を実行したと
き、ADR*信号およびWR*信号が“L”レベルにな
るため、ORゲート38の出力が“L″となってフリッ
プフロップ21〜24に1100が書き込まれる。また
$0101番地に0O01xxxxを書き込む命令を実
行したとき、信号SIZ*およびWR*が“L″レベル
なるため、ORゲート39の出力がL”となってフリッ
プフロップ29〜32に0001が書き込まれる。さら
に$0102番地に×××xxxx 1を書き込む命令
を実行したとき、信号C33*およびWR本が“L”レ
ベルとなってORゲート40の出力がL”レベルとなる
ためフリップフロップ41がセットされる。
The address decoder 37 includes the flip-flops 21 to 2.
This circuit detects the write address when writing data to 4.29 to 32.41 and other flip-flops to be described later. For example, the address signal is 5otoo
When the address signal is $0101, the ADH is set to "L" level (active), and when the address signal is $0101, the SIZ* is set to "L"
level, and when the address signal is $0102, C33* is set to "L" level. Therefore, when an instruction to write data 1100xxxx to address $0100 is executed, the ADR* signal and WR* signal become "L" level. Therefore, the output of the OR gate 38 becomes "L" and 1100 is written to the flip-flops 21 to 24. Also, when the instruction to write 0O01xxxx to address $0101 is executed, the signals SIZ* and WR* go to "L" level. Therefore, the output of the OR gate 39 becomes L'' and 0001 is written into the flip-flops 29-32. Furthermore, when the instruction to write XXXXX 1 to address $0102 is executed, the signal C33* and the WR signal go to "L" level, and the output of OR gate 40 goes to "L" level, so flip-flop 41 is set. Ru.

第5図は第3図に示したメモリ制御装置18のうち、こ
の発明に係る上位アドレス生成手段に相当する論理回路
である0図において信号sIz。
FIG. 5 shows a signal sIz in FIG. 0, which is a logic circuit corresponding to the upper address generation means according to the present invention in the memory control device 18 shown in FIG.

〜5IZ3は第4図に示したフリップフロップ29〜3
2から出力されるバンクサイズデータの信号である。ま
た第5図の信号NUM1*およびNUM2*は第4図に
示したアドレスデコーダ37より出力される信号である
。また、同図において66〜76はそれぞれフリップフ
ロップであり、ORゲート77の出力が“L”になった
ときフリップフロップ69〜76はデータ信号D7〜D
Oの内容を記憶する。またORゲート78の出力が″L
″レベルになったときフリップフロップ66〜68はD
2〜DOの内容を記憶する。例えばNUM1*およびN
UM2*がそれぞれ$0103および$0104番地が
アクセスされたとき出力されるように第4図に示したア
ドレスデコーダ37が構成されていれば、$0103番
地にデータを書き込めばそのデータD7〜DOがフリッ
プフロップ69〜76に設定される。また$0104番
地にデータを書き込めばD2〜DOの内容がフリップフ
ロップ66〜68に設定される。
~5IZ3 is the flip-flop 29~3 shown in FIG.
This is a bank size data signal output from 2. Further, signals NUM1* and NUM2* in FIG. 5 are signals output from the address decoder 37 shown in FIG. Further, in the figure, 66 to 76 are flip-flops, respectively, and when the output of the OR gate 77 becomes "L", the flip-flops 69 to 76 switch to the data signals D7 to D.
Store the contents of O. Also, the output of the OR gate 78 is “L”
'' level, flip-flops 66 to 68 are D
2-Memorize the contents of DO. For example NUM1* and N
If the address decoder 37 shown in FIG. 4 is configured so that UM2* is output when addresses $0103 and $0104 are accessed, then if data is written to address $0103, the data D7 to DO will be output. It is set in flip-flops 69-76. Furthermore, if data is written to address $0104, the contents of D2-DO are set in flip-flops 66-68.

同図において、NANDゲー)50〜53はバンクサイ
ズデータ5IZ3〜5rzoに応じてアドレス信号の上
位4ビツトA15〜A12を選択的に拡張メモリのアド
レス信号MA15〜MAI2として出力する。またNA
NDゲート58〜61はバンクサイズデータ5rZ3〜
5rzoに応じてフリップフロン173〜76の内容を
拡張メモリのアドレスMA15〜MA12として出力す
る。例えば5IZ3〜5IZOが0000 (バンクサ
イズ4KB)であるとき、インバータ54〜57の出力
が“H”レベルとなってNANDゲート58〜61から
はフリップフロップ73〜76の反転信号が出力される
。一方NANDゲート50〜53の出力はすべてH”レ
ベルであるため、結局NANDゲート62〜65にはフ
リップフロッゾ73〜76の内容がそのまま出力される
In the figure, NAND gates 50-53 selectively output the upper 4 bits A15-A12 of the address signal as expansion memory address signals MA15-MAI2 in accordance with bank size data 5IZ3-5rzo. Also NA
ND gates 58 to 61 receive bank size data 5rZ3 to
5rzo, the contents of flip-flops 173-76 are output as addresses MA15-MA12 of the extended memory. For example, when 5IZ3-5IZO is 0000 (bank size 4 KB), the outputs of inverters 54-57 go to "H" level, and the inverted signals of flip-flops 73-76 are output from NAND gates 58-61. On the other hand, since the outputs of NAND gates 50-53 are all at H'' level, the contents of flip-flops 73-76 are output as they are to NAND gates 62-65.

また例えば5IZ3〜5IZOが0001  (バンク
サイズ8KBであるとき)NANDゲート63〜65に
はフリップフロップ74〜76の内容がそのまま出力さ
れるがインバータ57の出力は“L”レベルとなるため
NORゲート61の出力が常に“H”レベルになる。一
方NANDゲート53からはA12の反転信号が出力さ
れるためNANDゲート65の出力にはA12が出力さ
れる。
Also, for example, when 5IZ3 to 5IZO are 0001 (when the bank size is 8 KB), the contents of the flip-flops 74 to 76 are output as they are to the NAND gates 63 to 65, but the output of the inverter 57 is at "L" level, so the NOR gate 61 The output is always at "H" level. On the other hand, since the NAND gate 53 outputs an inverted signal of A12, the NAND gate 65 outputs A12.

このときフリップフロップ76は無効となるので、フリ
ップフロップ66〜75に設定された10ビットバイナ
リ−コードのバンク隘が拡張メモリのアドレスMA22
〜MA13として与えられる。また例えば信号5IZ3
〜5IZOが0011(バンクサイズ16KB)である
ときフリップフロップ75および76の出力が無効とさ
れアドレス信号A13およびA12が有効となる。すな
わち拡張メモリのアドレス信号MA13.MA12には
CPUのアドレス信号A13.A12が出力され、MA
22〜MA14にはフリップフロップ66〜74に設定
されたバンク隘を表す9ビツトのバイナリ−コードが出
力される。
At this time, the flip-flop 76 is disabled, so the bank address of the 10-bit binary code set in the flip-flops 66 to 75 is the address MA22 of the extended memory.
~MA13. For example, signal 5IZ3
~5 When IZO is 0011 (bank size 16 KB), the outputs of flip-flops 75 and 76 are disabled and address signals A13 and A12 are enabled. That is, the extended memory address signal MA13. MA12 receives the CPU address signal A13. A12 is output and MA
A 9-bit binary code representing the bank position set in the flip-flops 66-74 is outputted to 22-MA14.

次に拡張メモリを用いた具体的な処理プログラムを簡単
な例で示す。
Next, we will show a simple example of a specific processing program using expanded memory.

第7図はCPUの処理手順を表すフローチャート、第6
図はメモリマツプを表す図である。
Fig. 7 is a flowchart showing the processing procedure of the CPU;
The figure shows a memory map.

第6図に示すようにメインメモリの$2000からプロ
グラムが書き込まれていて、$C00O〜$DFFFま
での8KBがバンクアドレス空間として設定される。拡
張メモリはこの8KB単位でバンク隘が割当られる。
As shown in FIG. 6, a program is written from $2000 in the main memory, and 8 KB from $C000 to $DFFF is set as a bank address space. Banks are allocated to the extended memory in units of 8 KB.

第7図に示すように、先ずバンクアドレス(バンクアド
レス空間の先頭アドレス)として$0000を設定する
(nl)。具体的には前述したように$0100番地に
1100××××を書き込むことによって第4図に示し
たフリップフロップ21〜24に1tooを設定する。
As shown in FIG. 7, first, $0000 is set as the bank address (starting address of the bank address space) (nl). Specifically, as described above, 1too is set in the flip-flops 21 to 24 shown in FIG. 4 by writing 1100XXXX to address $0100.

次にバンクサイズとして8KBを設定する(n2)。具
体的には前述したように$0101番地に0OOIXX
××を書き込むことによって第4図に示したフリップフ
ロップ29〜32に0001を設定する。
Next, set 8KB as the bank size (n2). Specifically, as mentioned above, 0OOIXX is located at address $0101.
By writing XX, 0001 is set in the flip-flops 29 to 32 shown in FIG.

続いてバンク魚としてBNに初期値0を入力し、BNで
示され−るバンク阻を設定する(n3→n4)。具体的
には前述したように$0103および$0104番地に
バンク隘のバイナリ−コードを書き込むことによって第
5図に示したフリップフロップ66〜76のうち66〜
75にバンク磁を設定する。続いてループカウンタとし
てCに初期値0を入力し、キー人力を待つ(n5−n6
)。
Next, the initial value 0 is input to BN as a bank fish, and the bank limit indicated by BN is set (n3→n4). Specifically, as described above, by writing bank-wide binary codes in addresses $0103 and $0104, flip-flops 66 to 66 of the flip-flops 66 to 76 shown in FIG.
Set the bank magnet to 75. Next, input the initial value 0 to C as a loop counter and wait for key input (n5-n6
).

キー人力があって、そのキーが終了キーでなければキー
人力されたデータを拡張メモリ内に記憶する(n7−n
8)。続いてカウンタCをインクリメントしてその値が
8192 (8KB)に達するまで上記処理を繰り返す
(n 9−=n 10−n 6・・・・)、8KB分の
データを書き込んだ後はバンクNaBNをインクリメン
トしてバンク磁を再設定する(nil→n4・・・)。
If there is a key input and the key is not the end key, the key input data is stored in the extended memory (n7-n
8). Next, increment the counter C and repeat the above process until the value reaches 8192 (8KB) (n 9-=n 10-n 6...). After writing 8KB worth of data, write bank NaBN. Increment and reset the bank magnetism (nil→n4...).

このようにして順次入力データを拡張メモリに書き込ん
でいくことができる。
In this way, input data can be sequentially written into the extended memory.

なお、以上に示した実施例では、メインメモリのアドレ
ス空間のうち拡張メモリのバンクを開くバンクアドレス
空間が1つであったが、拡張メモリのチャンネル数を増
やし、各チャンネル毎にメインメモリ上にバンクアドレ
ス空間を設定することも同様にして行うことができる。
In the embodiment shown above, there was one bank address space for opening the extended memory bank in the main memory address space, but the number of extended memory channels is increased and each channel is stored on the main memory. Setting the bank address space can be done in a similar manner.

また、実施例では、バンクアドレス空間の最少容量を4
KBとして、CPUアドレスの上位アドレスとバンク隘
とからメモリの上位アドレスを生成したが、本発明はこ
れに限られるものではない(g)発明の効果 この発明によれば、メインメモリのアドレス空間のうち
拡張メモリのバンクを開くバンクアドレス空間の位置お
よびサイズをプログラムにより自由に設定することがで
きるため、処理すべき内容に応じてメモリ空間を効率よ
く使用することができるようになる。
In addition, in the embodiment, the minimum capacity of the bank address space is set to 4.
Although the upper address of the memory is generated from the upper address of the CPU address and the bank address as the KB, the present invention is not limited to this. (g) Effect of the Invention According to this invention, the address space of the main memory can be Since the location and size of the bank address space for opening banks in the extended memory can be freely set by a program, the memory space can be used efficiently depending on the content to be processed.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図はこの発明の構成を示す図である。第2図(A)
、  (B)はこの発明のメモリ制御装置の作用説明図
である。第3図はこの発明の実施例であるメモリ制御装
置を用いたマイクロコンピュータの構成を表すブロック
図である。第4図および第5図は同メモリ制御装置の詳
細な論理回路図である。第6図および第7図は同装置の
メモリマツプの例およびCPUの処理手順を表すフロー
チャートである。第8図は従来のメモリ制御装置の論理
回路図である。
FIG. 1 is a diagram showing the configuration of the present invention. Figure 2 (A)
, (B) is an explanatory diagram of the operation of the memory control device of the present invention. FIG. 3 is a block diagram showing the configuration of a microcomputer using a memory control device according to an embodiment of the present invention. 4 and 5 are detailed logic circuit diagrams of the memory control device. FIGS. 6 and 7 are flowcharts showing an example of the memory map of the device and the processing procedure of the CPU. FIG. 8 is a logic circuit diagram of a conventional memory control device.

Claims (1)

【特許請求の範囲】[Claims] (1)CPUと、このCPUのバスに接続されているメ
インメモリおよび拡張メモリを備えたマイクロコンピュ
ータにおいて、 メインメモリのアドレス空間のうち拡張メモリのバンク
を開くバンクアドレス空間を記憶するバンクアドレス空
間記憶手段と、 バンク切換の選択有無を記憶するバンク切換選択記憶手
段と、 CPUの出力するアドレス信号が上記バンクアドレス空
間にあり、且つバンク切換が選択されているときメモリ
選択をメインメモリから拡張メモリへ切り換えるメモリ
切換制御手段と、 拡張メモリ上に構成するバンクの番号と上記バンクアド
レス空間の容量およびCPUの出力するアドレス信号か
ら拡張メモリのアドレスを生成するアドレス生成手段と
からなるメモリ制御装置。
(1) In a microcomputer equipped with a CPU, a main memory, and an extended memory connected to the bus of this CPU, a bank address space memory that stores a bank address space for opening a bank of extended memory in the address space of the main memory. means for storing memory selection from the main memory to the expanded memory when the address signal output from the CPU is in the bank address space and the bank switching is selected; A memory control device comprising memory switching control means for switching, and address generation means for generating an address of the extended memory from the number of a bank configured on the extended memory, the capacity of the bank address space, and an address signal output from a CPU.
JP30417189A 1989-11-22 1989-11-22 Memory controller Pending JPH03164842A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30417189A JPH03164842A (en) 1989-11-22 1989-11-22 Memory controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30417189A JPH03164842A (en) 1989-11-22 1989-11-22 Memory controller

Publications (1)

Publication Number Publication Date
JPH03164842A true JPH03164842A (en) 1991-07-16

Family

ID=17929899

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30417189A Pending JPH03164842A (en) 1989-11-22 1989-11-22 Memory controller

Country Status (1)

Country Link
JP (1) JPH03164842A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58501972A (en) * 1981-11-17 1983-11-17 ヒュンダイ・エレクトロニクス・インダストリーズ・カンパニー・リミテッド memory mapping unit
JPS6095655A (en) * 1983-06-30 1985-05-29 Ricoh Co Ltd Memory subdividing and constituting method
JPS61216056A (en) * 1985-03-22 1986-09-25 Hitachi Ltd Memory control system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58501972A (en) * 1981-11-17 1983-11-17 ヒュンダイ・エレクトロニクス・インダストリーズ・カンパニー・リミテッド memory mapping unit
JPS6095655A (en) * 1983-06-30 1985-05-29 Ricoh Co Ltd Memory subdividing and constituting method
JPS61216056A (en) * 1985-03-22 1986-09-25 Hitachi Ltd Memory control system

Similar Documents

Publication Publication Date Title
JPS607301B2 (en) computer system
KR980004059A (en) Data processing apparatus and register address conversion method
US5339402A (en) System for connecting an IC memory card to a central processing unit of a computer
US20050182885A1 (en) Semiconductor integrated circuit
JPS5843832B2 (en) memory device
KR890016467A (en) Information processing apparatus and mapping switching method that can operate with direct mapping method and bank mapping method
JP2002222084A (en) Semiconductor storage device, sector address conversion circuit, address conversion method, and method for using semiconductor storage device
JP2010092261A (en) Memory module, and auxiliary module for memory
KR100618858B1 (en) Semiconductor memory device capable of changing number of banks for refreshing when conducting refresh banks and Method of refresh thereof
JPH03164842A (en) Memory controller
JPS5844263B2 (en) memory control circuit
KR200204909Y1 (en) A microcontroller including an divided internal code memory
JPH04115337A (en) Semiconductor integrated circuit
JPS6148174B2 (en)
KR100275958B1 (en) Microcomputer unit
JP2003196087A (en) Memory addressing system of microcontroller and page mapping device
JPH0251724A (en) Disk controller
JPS59144966A (en) Data processor
JP3755653B2 (en) Contact input / output program controller
JPH05289938A (en) Memory access device
JPS62209639A (en) Memory modification writing circuit
JPH04268936A (en) Memory device
JPS60225253A (en) Information processing device
JPS62256145A (en) Control method for memory space
JPH01219931A (en) Memory control system