Skip to content
Get App

Memory Interfacing in 8086 Microprocessor | 8086

Step-by-step guide to interfacing 64 KB EPROM and 128 KB RAM with the 8086 microprocessor, covering address, data, control lines, memory mapping, and chip select logic.

Key Takeaways

  • A 64 KB EPROM requires two 32 KB chips arranged as even and odd banks to match 8086 byte addressing.
  • The number of address lines equals log2 of the memory size, e.g. 16 lines for 64 KB and 17 lines for 128 KB.
  • EPROM is read-only so it needs only a read control signal, while RAM needs both read and write control signals.
  • Correct memory mapping and chip select decoding (using A0, BHE, and unused address lines) are the core of 8086 memory interfacing.

What the video covers

  • Problem setup: design an 8086 system in minimum mode at 8 MHz with 64 KB EPROM built from two 32 KB chips and 128 KB RAM built from two 64 KB chips.
  • The four things to determine for any memory interface: address lines, data lines, control lines, and chip select logic.
  • 8086 memory is organized in pairs: one chip holds even addresses (lower byte, A0=0) and another holds odd addresses (higher byte, A0=1).
  • EPROM needs 16 address lines for 64 KB and 8 data lines; only the memory read control signal is required.
  • RAM needs 17 address lines for 128 KB and 8 data lines; both memory read and memory write control signals are required.
  • Memory mapping rule: RAM starts at 00000H, while ROM/EPROM ends at FFFFFH because the 8086 begins execution at FFFF0H after reset.
  • Starting and ending addresses are derived by holding unused high-order address lines fixed and varying the address lines that span the memory size.
  • Chip select is generated using A0, BHE, and the unused high-order address lines, typically decoded with a 3-to-8 decoder and NAND/inverter logic.
  • The memory-read and memory-write signals are combined with the chip-select outputs to enable each of the four memory chips correctly.

Answers

Questions about this video

Why are two chips used for each memory block in an 8086 system?

The 8086 has a 16-bit data bus and accesses memory in byte pairs, so memory is split into an even bank (lower byte, A0=0) and an odd bank (higher byte, A0=1). Each bank is a separate chip, so 64 KB EPROM uses two 32 KB chips and 128 KB RAM uses two 64 KB chips.

How do you determine the starting and ending addresses for EPROM and RAM?

The address lines that vary within the memory size (A0 to A15 for 64 KB EPROM, A0 to A16 for 128 KB RAM) are set to all zeros for the starting address and all ones for the ending address, while the higher unused lines stay fixed. RAM starts at 00000H and ROM ends at FFFFFH because the 8086 resets to FFFF0H.

What role does A0 play in selecting memory banks?

A0 distinguishes even and odd addresses: for the lower-byte (even) bank A0 is 0, and for the higher-byte (odd) bank A0 is 1. This is combined with BHE and the unused address lines to generate the correct chip select for each chip.

Full Transcript — Download SRT & Markdown

00:00
Speaker A
welcome to engineering funda family this video is a part of microprocessor 8086 video lecture series and in this video i'll be going to explain you memory interfacing with 8086 my dear students i know students are telling me many times
00:19
Speaker A
sir this is the most difficult topic but let me tell you one thing once you see this video this is just ice on the cake you just see this video till last i can give you guarantee that you will be having exact idea about how
00:35
Speaker A
to interface memory with eight zero eight six let us try to understand this step by step so my dear students here question is to design following system with eight zero eight six microprocessor here eight zero eight six is working
00:51
Speaker A
with minimum mode and frequency is eight megahertz and we are delivered to interface 64 kb of eprom using 32 kb of ep rom and we are delivered to interface 128 kb of ram using a chip of 64 kb of ram
01:12
Speaker A
now my dear students before i explain you how to interface this you should know how many things that you will have to learn see to interface this memory you should know how many different categories of lines that we need to interface
01:30
Speaker A
see first of all you should know how many address lines are there secondly you should know how many data lines are there then you should know how many control lines are there and then you should know how to do chip select
01:44
Speaker A
once you know these four operations you can easily interface this memory now i'll explain you how to identify all these answers so first of all you should know my dear students how many chips are required so let us
02:00
Speaker A
talk about ep rom first so my dear students here we are live to have 64 kb of ep rom using the chip of 32 kb of ep rom so obviously how many chips that you need to have two chips two chips of 32 kb of ep rom
02:18
Speaker A
will make 64 kb of ep rom dear students one more thing that you should know with 8086 we are having even an odd addressing so one chip will be having even address and second chip will be having odd
02:36
Speaker A
address that you must know right with 8086 memory interfacing one chip will be there with even address and second chip will be there with odd address right now let us try to understand how many data lines are there and address lines
02:52
Speaker A
are there for address lines of 64 kb of ep rom how many addresses will be there s per k 2 to the power 10 and 64 is having 2 to the power 6 so in total 2 to the power 16 so you can
03:10
Speaker A
say total 16 address lines are there so to have 64 kb of ep rom you should have 16 address lines and this is 64 kb b means byte so for byte you should have eight data lines right and my dear students for ep rom it is
03:33
Speaker A
erasable programmable rom you need to have memory read control signal only so you see three answers that we have already got address lines data lines and control lines right now let us calculate this for 128 kb of ram using 64 kb off ram
03:55
Speaker A
so 128 kb of ram that you need to have by having 64 kb of ram so how many chips that you need to have two chips of 64 kb of ram will make it to 128 kb of ram here also my dear
04:10
Speaker A
students you should know one chip is there for even address and second chip will be there for odd address with 8086 memory interfacing always there will be pair of chips of memory one chip will be there with even address and
04:27
Speaker A
second chip will be there with odd address how to have it that and i'll explain you don't worry about that it is very easy you just need to see this video till last let us calculate address lines again
04:40
Speaker A
so address lines for 128 kb you see with k 2 to the power 10 and 128 means 2 to the power 7 so in total 2 to the power 17 means how many address lines are required 17 address lines are required
04:57
Speaker A
right for data line here you have kb you see byte is there with byte how much data lines are there eight so eight data lines are there right now my dear students control lines with ram that you should know ram is random
05:14
Speaker A
access memory so memory read as well as memory write both are required as a control signals right now my dear students let us try to understand the heart of this video that is chip select and for that you will have to do memory
05:34
Speaker A
mapping now see in memory mapping how many chips are there you just mention it over here first how many chips are there two chips of 32 kb of eprom and two chips of 64 kb of ram so you see here i have
05:52
Speaker A
mentioned two chips of ep rom two chips of ram now whenever you interface memory with eight zero eight six remember this you will be writing lower byte of epirom higher byte of ep rom lower byte of ram higher byte of ram
06:07
Speaker A
like this or you can write it in this way ep rom of even address ep rom of odd address ram of even address ram of odd address you can prefer any of this name right the reason is there are some basics that you must know
06:25
Speaker A
that's why i'm telling you see lower byte that you can mention then higher bit or you can mention it in this way even address an odd address right so i have mentioned it like lower byte higher byte lower byte higher byte
06:40
Speaker A
now you see here i have written ep rom and here i am having ram now my dear students there are few basic things that you should know [Music] see this ram that is starting from 0 0 0 0 hex location
06:59
Speaker A
always remember this ram will always starts from 0 0 0 0 0 hex location so whenever you interface memory and in different types of memory ram is given then you will have to interface ram starts from zero zero zero zero hex
07:19
Speaker A
location and read-only memory that should have ending address that will be fff why the reason is when you restart 8086 at that time it will be having initiation with ffff0 location and it should be there with rom that's why rom will be there with final
07:46
Speaker A
address ffff hex so you see here i'm having ep rom so i'm considering final address of ep rom that is fff an initial address of ram that will be 0 000 hex so this is one thing that you should
08:04
Speaker A
know so whenever you have memory interfacing roms last address that you need to write first that is all f and rams first address that you need to write that is all 0 right now my dear students you will have to
08:21
Speaker A
see what is the size so you see if you talk about ep rom then with ep rom how many address lines are there 16 so as if you want to write starting address of ep rom what has to be that
08:35
Speaker A
starting address in its starting address from ending address how many lines are there 16 so a0 to a15 total 16 lines that will change from all 0 to all 1 right so here a 0 to a 15 that will be there
08:55
Speaker A
with change the data and this a19 18 817 and a16 that will remain as it is so you see now starting address of ep rom that i have identified as per size of address lines so that is this four lines are as it is a 0 to a 15
09:15
Speaker A
that we are storing inside right so here i'll be mentioning that as per all zeros over here and that will gives you 1 1 1 1 means f and then after all 0s are there means f 0 0 0 0 hex that is my
09:31
Speaker A
starting address now similarly with ram what will be my ending address so you see with ram we have 17 address lines right so a0 to a16 that will changes to all ones so you see this first three bits that is 0 and
09:53
Speaker A
a0 to a16 that is getting changed from 0 to 1 so that is my last address of ram 2 right that that gives you 1 you see 0 0 0 1 so that is 1 and then all f hacks are there right so that is
10:10
Speaker A
how starting an ending address that we can identify now very interesting thing that is coming in front of you my dear students you see this ep rom that is having even address or you can say lower byte so even address is having a 0 is equals
10:28
Speaker A
to 0 right an odd address which is there with eb rom 2 or you can say higher byte memory so that is having a 0 that will be always 1 right so here see this a0 that should be
10:42
Speaker A
your focus right with all memories so with lower byte or you can say with even address memory a0 will be 0 you can directly understand even means what a 0 should be 0 right and odd means what a 0 should have 1
11:04
Speaker A
so higher byte is having odd address lower byte is having e1 address you see over here also you will have to substitute 0 for lower byte and 1 4 higher byte right so that is how you just define
11:20
Speaker A
a0 now it is very simple my dear students ending address of ep rom in that these four ones are as it is and then all zero that will get changes to all one so this will be ffffe hex which is last address of ep
11:38
Speaker A
rom one and similarly with ep rom 2 here next you will be having 1 over here and this should be 0's it should start from f triple 0 1 2 it will end up to ffff similarly over here you see
11:56
Speaker A
we are having a 0 to a 16 location which is there with ram 1 so you see this is 0 with e1 address now a1 to a16 that should changes from 0 to 1 right so here ram 1 that is having 1 ff e that is
12:15
Speaker A
my location and now ram 2 is having starting location that will be as per you see now these all are 0 right so that will be starting from 0 0 0 0 0 1 hex so that is how starting an ending
12:31
Speaker A
address that we can identify and to have chip select you should see unused line so with this ep rom this a16 a17 a18 and a19 are unused and for ram a17 a18 and a19 that is unused you see
12:50
Speaker A
right now what we will be doing is we will be giving active low chip select so ep rom 1 and ep rom 2 that will be having this a16 to a19 line that is 1 so that we will be directly giving it to
13:07
Speaker A
nand gate and ram is having a 17 18 a 19 that is zero so after inversion we will give it to nand gate you see how do we provide memory interfacing and here chip select is very essential right other things are very easy
13:27
Speaker A
and you see here minimum mode that i have shown you should know my dear students minimum mode of 8086 by using minimum mode we can have a 0 to a 19 address lines and d0 to d15 data lines and bus high enable
13:45
Speaker A
these are the terminals that we will be using for address and data and here you should know control signals that will be using as memory read and memory right now let us try to understand chip select so here
14:00
Speaker A
with ep rom i have told you a16 a17 a18 and a19 those are constant those are one so directly i'm giving it to nand gate and for ram we've been having a 17 a 18 a 19 those are zero so after bubble i am
14:16
Speaker A
giving it to nand gate now my dear students you should know here we are having two ep rom chip and here we are having two ram chip one ram chip and one ep rom chip acquires e1 addressing and second
14:35
Speaker A
acquires odd addressing right so for that you should know see even select will happen when a 0 is equals to 0 and odd will get selected when bus high enable that is equals to 0.
14:52
Speaker A
so here after or gate i am providing even select and here this after r gate i am providing it with bus high enable so this terminal that will select odd ic address and this terminal that will select even
15:12
Speaker A
address of ic right even address of ic is having data from d0 to d7 and all address ic is having data from d8 to d15 now my dear students we have this even an odd select for ep rom
15:32
Speaker A
similarly we can have it for ram right so you see this unused line and a0 bhe that is generating our chip select now my dear students let us have ics here i am showing you ep rom with e1 ic ep rom with odd ic and here
15:54
Speaker A
we are having ram with e1 ic and ram with odd ic my dear students first of all you should know how to connect chip select so even that i need to connect it from here with chip select and this odd that i
16:10
Speaker A
need to connect it with chip select over here e1 will be connected with chip select and r will be connected with chip select now my dear students you should know control signals so ep rom is having only memory read
16:25
Speaker A
that we need to connect it with output enable bar o e bar output enable bar so by having this we can have memory read operation so you see output enable is connected with memory read right here also with ram we have output enable
16:44
Speaker A
for memory read but with ram we have memory write also so here i have connected memory write this is what we are generating by having this 3 cross 8 decoder right now my dear students let us try to understand how address
17:00
Speaker A
lines are there so i have already told you with ep rom how many address lines are there 16 a 0 to a 15 those address lines are there and with ram how many address lines were there 17 a 0 to a 16 we have
17:14
Speaker A
already calculated that that i am connecting it over here now my dear students for data with ep rom of e1 we will be connecting d0 to d7 data and with odd will be connecting d8 to d15 data so this is complete memory
17:33
Speaker A
interfacing with 8086 so this is all about memory interfacing my dear students here only few things that you need to know even an odd addressing right even memory that will get selected by a 0 is equals to 0 or will get selected by
17:49
Speaker A
bhe bar that's it right and few basic changes that you need to see in memory mapping and still if any confusion is there what i want is you just post that in comment box so that we can have proper
18:03
Speaker A
discussion thank you so much for watching this video
Topics:8086memory interfacingEPROMRAMchip selectmemory mappingmicroprocessoraddress lineseven and odd bank3-to-8 decoder

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries and speaker detection. 30 minutes free.

Or transcribe another YouTube video here →