Splitting the address space
Splitting the address space
Hello, on my first 6502 project i have to divide the address space between 3 RAM chips, 3 ROM chips and a VIA. I know how this works, but i was just wondering if there is any tool available or formula of some kind to help me do this the most efficient way possible? I plan on using some 3 to 8 memory decoders.
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: Splitting the address space
yvibod wrote:
Hello, on my first 6502 project i have to divide the address space between 3 RAM chips, 3 ROM chips and a VIA. I know how this works, but i was just wondering if there is any tool available or formula of some kind to help me do this the most efficient way possible? I plan on using some 3 to 8 memory decoders.
http://wilsonminesco.com/6502primer/addr_decoding.html
Mike B.
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Splitting the address space
yvibod wrote:
Hello, on my first 6502 project i have to divide the address space between 3 RAM chips, 3 ROM chips and a VIA. I know how this works, but i was just wondering if there is any tool available or formula of some kind to help me do this the most efficient way possible? I plan on using some 3 to 8 memory decoders.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Splitting the address space
Welcome, yvibod! With a single 3 to 8 decoder you can split the 64k address space into 8 sections of 8k each. You have 7 devices to fit in, so if all the devices are 8k or smaller, you're already finished!
As BDD notes, more information is needed to solve the problem. But to answer your question, I don't know of any tool or formula: understanding what's happening and knowing what you want to do leads relatively directly to a solution: you are splitting or merging blocks of memory which have a power-of-two size. An efficient design will not decode any more finely than necessary: having a single VIA mapped over an entire 16k is a viable solution for some cases. For other cases, you'd want to map the VIA all the way down to a 16-address window. And there are many intermediate cases.
I second Mike's recommendation to read Garth's primer.
Cheers
Ed
As BDD notes, more information is needed to solve the problem. But to answer your question, I don't know of any tool or formula: understanding what's happening and knowing what you want to do leads relatively directly to a solution: you are splitting or merging blocks of memory which have a power-of-two size. An efficient design will not decode any more finely than necessary: having a single VIA mapped over an entire 16k is a viable solution for some cases. For other cases, you'd want to map the VIA all the way down to a 16-address window. And there are many intermediate cases.
I second Mike's recommendation to read Garth's primer.
Cheers
Ed
Re: Splitting the address space
Thank you for the suggestions, the chips are 3 RAMs of 3K each at the beginning of address space, 3 ROMs of 3K each at the end and a VIA at the beginning of the second 32K bank. Before I made the question I was looking for at tool that would do this sort of work but now I tried doing it by hand it isn't that hard really.
Re: Splitting the address space
BigEd wrote:
Welcome, yvibod! With a single 3 to 8 decoder you can split the 64k address space into 8 sections of 8k each. You have 7 devices to fit in, so if all the devices are 8k or smaller, you're already finished!
As BDD notes, more information is needed to solve the problem. But to answer your question, I don't know of any tool or formula: understanding what's happening and knowing what you want to do leads relatively directly to a solution: you are splitting or merging blocks of memory which have a power-of-two size. An efficient design will not decode any more finely than necessary: having a single VIA mapped over an entire 16k is a viable solution for some cases. For other cases, you'd want to map the VIA all the way down to a 16-address window. And there are many intermediate cases.
I second Mike's recommendation to read Garth's primer.
Cheers
Ed
As BDD notes, more information is needed to solve the problem. But to answer your question, I don't know of any tool or formula: understanding what's happening and knowing what you want to do leads relatively directly to a solution: you are splitting or merging blocks of memory which have a power-of-two size. An efficient design will not decode any more finely than necessary: having a single VIA mapped over an entire 16k is a viable solution for some cases. For other cases, you'd want to map the VIA all the way down to a 16-address window. And there are many intermediate cases.
I second Mike's recommendation to read Garth's primer.
Cheers
Ed
I was trying to organize it in a way that all the ram would form a single 6k block.
Re: Splitting the address space
yvibod wrote:
BigEd wrote:
Welcome, yvibod! With a single 3 to 8 decoder you can split the 64k address space into 8 sections of 8k each. You have 7 devices to fit in, so if all the devices are 8k or smaller, you're already finished!
As BDD notes, more information is needed to solve the problem. But to answer your question, I don't know of any tool or formula: understanding what's happening and knowing what you want to do leads relatively directly to a solution: you are splitting or merging blocks of memory which have a power-of-two size. An efficient design will not decode any more finely than necessary: having a single VIA mapped over an entire 16k is a viable solution for some cases. For other cases, you'd want to map the VIA all the way down to a 16-address window. And there are many intermediate cases.
I second Mike's recommendation to read Garth's primer.
Cheers
Ed
As BDD notes, more information is needed to solve the problem. But to answer your question, I don't know of any tool or formula: understanding what's happening and knowing what you want to do leads relatively directly to a solution: you are splitting or merging blocks of memory which have a power-of-two size. An efficient design will not decode any more finely than necessary: having a single VIA mapped over an entire 16k is a viable solution for some cases. For other cases, you'd want to map the VIA all the way down to a 16-address window. And there are many intermediate cases.
I second Mike's recommendation to read Garth's primer.
Cheers
Ed
I was trying to organize it in a way that all the ram would form a single 6k block.
The 74LS138 is an example of an 8-way decoder, while the 74LS139 has two 4-way decoders in a single package. Note: depending on what technology your other components use, you will probably want to use a different chip family than 74LS.
Re: Splitting the address space
rwiker wrote:
yvibod wrote:
BigEd wrote:
Welcome, yvibod! With a single 3 to 8 decoder you can split the 64k address space into 8 sections of 8k each. You have 7 devices to fit in, so if all the devices are 8k or smaller, you're already finished!
As BDD notes, more information is needed to solve the problem. But to answer your question, I don't know of any tool or formula: understanding what's happening and knowing what you want to do leads relatively directly to a solution: you are splitting or merging blocks of memory which have a power-of-two size. An efficient design will not decode any more finely than necessary: having a single VIA mapped over an entire 16k is a viable solution for some cases. For other cases, you'd want to map the VIA all the way down to a 16-address window. And there are many intermediate cases.
I second Mike's recommendation to read Garth's primer.
Cheers
Ed
As BDD notes, more information is needed to solve the problem. But to answer your question, I don't know of any tool or formula: understanding what's happening and knowing what you want to do leads relatively directly to a solution: you are splitting or merging blocks of memory which have a power-of-two size. An efficient design will not decode any more finely than necessary: having a single VIA mapped over an entire 16k is a viable solution for some cases. For other cases, you'd want to map the VIA all the way down to a 16-address window. And there are many intermediate cases.
I second Mike's recommendation to read Garth's primer.
Cheers
Ed
I was trying to organize it in a way that all the ram would form a single 6k block.
The 74LS138 is an example of an 8-way decoder, while the 74LS139 has two 4-way decoders in a single package. Note: depending on what technology your other components use, you will probably want to use a different chip family than 74LS.
Re: Splitting the address space
3k RAM seems a really unusual size to me - what part are you using?
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Splitting the address space
You'll want the RAM contiguous so programs don't don't have to jump over dead or mirrored spaces, and so you can have contiguous data arrays. Why not just spend a few dollars on a 32Kx8 SRAM? It will pay for itself in the reduced number of sockets required, the labor to wire-wrap it all, and in board space.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Splitting the address space
GARTHWILSON wrote:
You'll want the RAM contiguous so programs don't don't have to jump over dead or mirrored spaces, and so you can have contiguous data arrays. Why not just spend a few dollars on a 32Kx8 SRAM? It will pay for itself in the reduced number of sockets required, the labor to wire-wrap it all, and in board space.
Re: Splitting the address space
BigEd wrote:
3k RAM seems a really unusual size to me - what part are you using?
Re: Splitting the address space
Ah, that's more like it! So, indeed, having decoded down to 8k blocks, you need to decode two more address bits to get to a 2k size. There is such a thing as a 2-to-4 decoder, or you could use some NAND or NOR gates probably.
Edit: or indeed use another 3 to 8 decoder, if that's what you have, and tie off an input.
Edit: or indeed use another 3 to 8 decoder, if that's what you have, and tie off an input.
Re: Splitting the address space
BigEd wrote:
Ah, that's more like it! So, indeed, having decoded down to 8k blocks, you need to decode two more address bits to get to a 2k size. There is such a thing as a 2-to-4 decoder, or you could use some NAND or NOR gates probably.
Edit: or indeed use another 3 to 8 decoder, if that's what you have, and tie off an input.
Edit: or indeed use another 3 to 8 decoder, if that's what you have, and tie off an input.
Not sure about that last part.
Re: Splitting the address space
You need to decode A12 and A11 to decide which 2k block is active.