Interfacing Memory with 8086 Microprocessor – Microprocessor for Degree Engineering

Interfacing Memory with 8086 Microprocessor – Microprocessor for Degree Engineering


Do subscribe to Ekeeda channel and press bell icon to get updates about latest Engineering HSC and IIT-JEE Mains and Advanced videos. Hello Friends, In this video we are going to study about how the memory devices memory chips they are interfaced with the 8 0 8 6 Microprocessor So let us start with our topic. we know that memory it is an integral part of the microprocessor memory is used to store the program it is also used to store the data and all the important things they are stored in the memory so it is for the storage Of data or instructions or programmed for the microprocessor now this memory it can be of two types in the case of microprocessor it can be wrong or Ram that is random access memory or read-only memory you now this read-only memory it can only be read so for this room we have only the read signal available means read operation will be associated with it whereas this random access memory we can read and write this memory so we have both read and write signals for it so this read-only memory it is available for the reading purpose only and it stores the it is programs means at the time of manufacturing we store the main programs in the read-only memory those programs which do not need any alterations so programs that do not need changes they will be stored in the read-only memory and the random access memory it is used for the storage of temporary data and also for the storage of users program means the program which are made by the user now under the category of room we have different types of memory like p rome ii p rome and here on VE p room that is programmable read-only memory this is erasable programmable read-only memory then this is electrically erasable programmable read-only memory so we have different types of room available which can be used to store the system softwares and the system programs and data that will be present here in the read-only memory we can only read that data no write operation available so no morning modifications can be done in these programs whereas the random access memory because in this memory we can read and write it is you use to store that egg really data and the user’s program so we can say that this memory is the volatile memory ok modifications can be done in it so these are the two types of memory available for the micro processors now when the micro processor it wants to read or write the data from the memory it has to communicate with the memory okay so for micro processor we have a memory chip and here we have the micro processor so this micro processor it is either going to read the memory or it is going to write the memory it is going to read the data from the memory chip or it is going to write the data into the memory chip so first this micro processor it has to communicate with this memory chip now this communication it is also known as an interface so in this video we are going to study the interfacing techniques that how the memory is interfaced with the micro processors now for this interfacing we will need two signals one for the Reed and one for the right the micro processor it is going to initiate these signals read and write signals so that main data can be read or written into the memory chips so microprocessor needs to access the memory to get the instruction codes and the data instruction me codes means the programs are written in the memory so those programs if the microprocessor it wants to access the instruction fetch the instructions then that will be done from the memory and also the data that is stored in the memory so if we want to access the memory it will initiate the read and write signals you so according to the operation which the microprocessor wants to perform according to that operation it is going to initiate the reader right signals so for read it has the nem heart that is memory and for right it has mm w so we have memory read and memory right signals memory read signal will read the memory and memory right it is going to write the data into the memory now which may be because the memory chips there can be memory many number of memory chips connected to the microprocessor so which memory chip either wants to connect and from which memory chip it wants to read the data or write the data so there should be some logic which can select the chips that which memory chip it wants to communicate so if this is our microprocessor we will have different memory chips microprocessor can communicate with any of the memory chip suppose this is ship number one chip two chip number three so every chip will have this microprocessor will have the read and write signals and also every chip will have a chip select signal through which these chips can be selected so the microprocessor if it’s want to communicate with these memory chips and so for each memory chip it should have a chip select signal CSS the chip selects signal so that but whatever memory chip it wants to communicate it can select that chip and that chip if it wants to read the data then green signal should be there if it wants to write the data into that memory chip then write signal is there now for this type of communication of the microprocessor with different memory chips there is a need for a device or a circuit which can perform these chip select and the read and write signals which can provide these signals so this type of circuit or device is known as the memory interfacing divides so to do the above job it is necessary to have a device or a circuit which performs this task of reading and writing into the memory or selecting the memory chips and that device is known as the interfacing device now this device because it is linked with the memory that is what is also known as the memory interfacing device so this memory interfacing device is bit is this device basically interface the memory with the microprocessor so here we will have the microprocessor then we will have memory and the interface that is the path of the communication between this microprocessor and memory it is provided by the memory interfacing device now this memory interfacing it basically involves three different tasks these tasks are first so because the microprocessor whenever it wants to read or write into the memory then it will use the memory interfacing device now this device it performs three different tasks first it is going to select the required chip because the memory it will be available in the form of different memory chips are there so which memory chip is required that will be selected Superstars will be to select the required chip then to identify the required register now memory it is composed of various memory registers and this memory register they have different memory locations addresses are defined for each register so to it the next step will be to identify the required register which means first the memory chip will be selected and in that memory chip bits resistor be water from which memory register we want to read the data or to write the data that register will be identified third step will be to enable the appropriate buffers now when we want to the microprocessor want to read the data sorry signal has to be activated and if it wants to write the data then write signal has to be activated so appropriate buffers like data buffers address buffers read and write signal whichever signal is to be activated that will be the third step okay so in this way the interfacing is done between the micro processor and the memory okay now let us study a simple memory device that how a simple memory device will consist of what are its input and output lines address and data lights what is its configurations let us see [Music] so any memory device it will consist of address lines input output lines selection input and control input okay this is a simple memory device in which we have the address lines from a knot to a in then we have input/output lines from input/output zero to input/output in then we have the selection input that is the chip selects signal and control inputs other read and write inputs these inputs will enable the microprocessor to read or write the data into or from the memory device so let us study that how many address lines and input out of what is the function of these four conference of memory device first let us come to the address lines so the address lines are the address inputs which select the memory location within the memory device now in this memory device there are various registers and each register is capable of storing a bit okay so these registers how these registers will be selected this register will have a particular memory location and that memory location is specified by the address lines so these address lines they select the memory locations they provide the address of that memory location within the memory device now these address lines they are denoted from a node to a n and the number of address lines they define the total capacity of the memory that how make what is the storage capacity of this memory so the number of address lines so the number of address lines it will indicate the total memory capacity of the memory device suppose we are having a one kilobyte memory so this 1 kilobyte memory it will have 1 0 to 4 bytes will be there 1 kilobyte equals to 1 0 to 4 bytes okay so this will be equal to in address lines so to address this 1 kilobyte memory 10 address lines are required and suppose if we are having 1 megabyte of memory then 20 address lines are required so you can say that the number of the address lines it indicates the total memory capacity of the memory device if we are having 10 a dress lines means that the memory device it is having the storage capacity of 1 kilobyte if it is having 20 address line that means it can store 1 megabyte of the memory ok so this was about the address lines next we have the input/output lines so the memory device it may have separate input/output lines or a common bi-directional input/output lines now this memory it is used microprocessor it writes the data or reach the data from the memory so that data will be read that data will be available on these input/output lines now the memory device it can have separate input lines and separate output lines or it can also have a common bi-directional input/output lines so if it is having the bi-directional input/output lines so these lines can be used to transfer the data in any direction that is from microprocessor to the memory or from the memory to the microprocessor so a single line it can act as an input line also and as an output line also and these lines they are denoted as input/output 0 to input/output n so n is the number of the input/output lines because these lines input/output lines it is carrying the data so we can also denote this like D not till d n so we can say that these are the data lines because it is carrying the data from the memory device or to the memory device you now the data lines they are from D not to B n so we can say that there are n data lines now size of a memory location it is dependent upon the number of data bits like here if they are having the number of data lines as 8 that is from D naught to d7 then it is having 8 bits okay so eight bits can be stored at one memory location okay suppose this is our complete memory this memory is divided into different registers okay or we can say that these are different memory locations here 1 2 3 till the memory size of the memory device now each because here we are having the number of data lines as 8 it means 8 bits can be stored at a single memory location it can be stored in each location so 8 bits are stored here again 8 bits are stored at 2nd memory location then at third memory location also 8 bits are stored so in this way at each memory location 8 8 bits can be stored so we can say that size of a memory location it is dependent upon the number of data bits now suppose if the number of data lines are 16 that is from B naught to D 15 so it means that 16 bits can be stored here 16 bits or we can say 2 bytes okay so in this way the number of data lines it is deciding the size of the memory location and number of address lines it is deciding the size of the memory device so this thing you can keep in mind that number of address lines indicate size of memory device or we can say memory chip and number of data lines indicates the size of memory location so suppose that a memory chip it is defined like this we are giving the size to K into 8 if we have given a memory chip that it is of the size 2k into it so it means that the size of the memory device is 2 kilobytes and each memory location can store 8 bits okay so it is 8 bits can be stored and 2 kilobytes means 2 kilobyte is the size of the memory memory size we can say so we know that 1 kilobyte is equal to 1 0 to 4 so 2 kilobyte will be equal to 2 0 4 8 so we can say that there are 2 0 4 8 memory locations and each memory location can store it bits okay so this is how whenever we are given the memory chip whose specification is given like this we can determine the memory size also and the number of bits that can be stored at each memory location that can also be identified so this was about the address lines and the data lines next come the selection input now this selection input that is the chip selects signal it is used to select the memory chip okay so memory devices they may contain one or more inputs which are used to select the memory device or enable the memory device so if it is used to select the memory device it is known as the chip select signal that is CS bar and if it is used to enable we can denote it as chip enable signal C e bar so because we are having a bar over it means it’s an active low signal it will be active when its value will be zero okay so when we are having zero at this pin at this chip select pin it means that that memory device has been selected by the microprocessor so every time whenever we want to communicate with that memory chip this chip select signal has to be enabled it has to be at logic zero okay so if we are having logic zero chip is selected or we can say that it is enabled and if it is at logic one then chip is not selected or disabled now here I have written that the memory devices they may contain one or more inputs okay so these chip selects signal there can be a single line for the chip selects signal or it can be more than one okay so if there are more than one chip select lines then all the chip select lines has to be enabled they have to be activated to select the chip so all pins or if there are more than one chip select pins then all the pins have to be activated to select the chip so if we see in the diagram for the memory device we have the chip select signal which is used to select this memory device okay we have the address lines we have the input/output lines now next we have the control input so control input involves the signals read and write these signals are used to read the data from the memory or write the data into the memory device you so they can be one or more control inputs now if we have the wrong type of memory means read-only memory is there then we have one control input signal also which is known as Oh II bar that is output enable pin now this enable pin it also has to be activated if we want to communicate with the read-only memory this because this signal it allows the data to flow out of the output data pins so for the read-only memory both the output enable and the chip selects signal they have to be activated if we want to read the data from the read-only memory now these control inputs make however having as the read signal and the write signal so for read we are having our D bar and for write we are having WR ma okay so this signals because it is having birth so it means that they are activated when its value is 0 so when our D bar is is activated then the data will be read from the memory when right is activated it means that the data will be written into the memory now if we are having the read-only memory then for this we will be having only the read signal no write signal will be associated if we are having Ram type of memory that is a random access memory so for that we will have both the right and the read signal okay so it feels if we see this memory device it will have these components address lines input/output lines or the data lines chip selects signal or the selection input signals and the control input now whenever the microprocessor it is interfaced with the memory device then what are the steps that are taken let’s see this now the memory devices the memories in the microprocessor they are organized as two-dimensional arrays of memory locations so in the memory we have different memory locations or we can say we have the different register which are storing the data okay now if we are defining a memory by for K into 8 so I have told earlier also that for K it is the size of the memory and 8 it is the size of the data that can be stored at each memory location so 4 K means that the total size of the memory is 4 kilobytes we know 1 kilobyte equals 2 1 0 2 4 so 4 kilobyte will be equal to 4 into 1 0 to 4 that is 4 0 9 6 memory locations so this 4 kilobyte of memory it will be having 4 0 9 6 memory locations and each memory location can store 8 bit of data now to address these 4 0 9 6 memory locations we will require the address lines because each memory location is the storing 8 bit of data so we will require the data lines so this 8 it indicates the number of data lines so we can say that it will have 8 data lines that is from D naught to d7 so 8 data lines that is from D naught to d7 will be required to store the 8 bit data now we are having 4 0 9 6 memory locations so how we will determine the number of address lines using this information here we can find out this by if we are having n memory locations and suppose the device is having small in address lines so we can calculate it we can relate the memory locations and address lines by using the formula small n equals to log to the base to capital n where n was the number of address lines and capital n it is the number of memory locations so if we want to determine the number of address lines we are having the number of memory locations as 4 0 9 6 so we will write here 4 0 9 6 okay now when we determine this we will get the what we can say that 2 raised to the power n equals to capital n if we take the logarithm on both the sides then we will get 2 raised to the power N equals to capital n so 2 raised to the power n will be equal to 4 0 9 6 and we will get the value of n as so if we calculate this we will get the value of n as 12 okay so 12 address lines will be needed to address the 4 kilobyte of memory and 8 data lines will be needed to store the 8 bit data so by using this formula we can find out the number of address lines when we have the number of memory locations with us so we can use this formula and also we can use this formula so your small n will be the number of address lines will be the number of memory locations so for the four kilobyte of memory we are getting the number of address lines required to address the 4:09 six memory locations as 12 so 12 8 rest lines will be needed now suppose the microprocessor like we are starting the eight zero eight six microprocessor so eight zero eight six it is having 20 address lines from a naught to a 19 now out of these 20 address lines only twenty eight resins will be required to address these four zero nine six memory locations so if we are interfacing the eight zero eight six microprocessor with a 4 kilobyte of memory then we will require only 12 at rest lines that is from a naught to a 11 so what about the remaining address lines we can use the remaining address lines from a 12 to a 19 to form the chip select signal okay so this chip selects signal because we want to select the chip also so we can use these remaining address lines to form the logic for the chip select signals so if we are having any address lines we can use P address lines for addressing the memory location and we can use the remaining that is n minus P remaining address lines to form the chip select signals so whenever we are having this type of questions where we are asked to interface a memory chip with the microprocessor we will calculate that how many number of address lines we require to address that memory chip and the remaining address lines we can use to form the chip selects signal okay now let us study those steps which will which we will perform when we are interfacing the memory with the microprocessor we can say that let us study the general procedure of memory interfacing so step number one when we are interfacing the memory with the eight zero eight six microprocessor will be now the first step will be to arrange the available memory chips so as to obtain the 16-bit data bus width because the eight zero eight six microprocessor here we are studying the memory interfacing with the eight zero eight six microprocessor okay so eight zero eight six it is having a 16-bit data bus width okay so we are going to arrange the available memory chips most of the memory chips they are having the size cross into eight means into eight is there that means 8-bit data can be stored at each memory location now we want that sixteen byte data should be stored okay because our microprocessor it is having 16-bit data lines so we are going to arrange the memory chips so that we can get a complete 16-bit data how we can get this the upper 8-bit Bank we are going to arrange two memory chips here suppose each memory chip is having the size one kilobyte into eight means each memory to its memory location can store a bit of data so we have eight and eight bits it will be total 16-bit data so the upper 8-bit bank will be called the odd address memory bank the lower 8 bit bank will be called the even address memory bank so here they are having two upper will be called though or address memory bank and lower one will be called the even address memory back ok so in this way we are going to arrange the available memory chips so that we can get the complete 16-bit data width will be called or and or will be called or even okay so that will be the first step second step will be you second step will be to connect the available memory address lines we have will calculate that how many address lines will be required to address that memory chip how address lines are available with it and we know that eight zero eight six is having 20 address lines so we are going to connect the available memory address lines of the memory chip with those of the microprocessor means we are having supposed to there let’s take the example of four kilobyte of memory we were requiring only two lndra’s lines so 12 8 res lines we will connect with the 20 dress lines of the microprocessor suppose this was our memory it will have a knot to a 12 a 11 sorry we will need to address lines so these address lines will be connected with the address lines of the microprocessor that is from a knot to a 11 remaining lines we are left with a 12 to a 19 okay so available memory address lines of memory chip with those of the microprocessor also connect the memory read and write input to the corresponding processor control signal microprocessor 8:08 6 it is having two signals one for read one for the memory write for memory read it as having mr mr d and for memory write it as having MW r for memory read and for memory write okay so these signals will be connected to the read and write signals of the memory chip so the read and write signals of the memory they will be connected to the corresponding processor control signals okay so this was our second step now address lines of the microprocessor and the memory device they are connected to each other then data lines also they will be connected here we have to dictate the address lines the read and write signals are also connected and data lines are also connected that is from D naught to D seven eight address like a data line son here and for microprocessor we are having sixteen data lines D not to be 15 so one will be connected with the odd memory and the eight will be connected with the even memory okay so suppose here we are having though or this will be the even so these remaining data lines d 8 to D 15 they will be connected to the second memory chip okay now in the third step the remaining address lines that is for the case of four kilobyte of memory we are taking a 12 to a 19 so the remaining address lines we can say n minus P address lines of the microprocessor plus the bus high enable in the case of 8 0 8 6 microprocessor we have a signal bus high enable this signal and the a not signal these three that is remaining dress lines biacchi and a knot these three will be used to decode the required chip select signals so here we can say the bus hi enable the n minus P address lines and the a knot signal these three signals they will form the chip select signal means the memory chip will be selected the cs bar signal will be generated by the combination of these three we can use logic circuit logic gates here we can use decoders encoders to generate the chip select signal so we will use some logic circuit logic gates and decoders to generate the chip select signal now the chip selects signals they will be generated for the odd and even memory banks because they are having 8-bit data available at odd memory bank and 8-bit data available at the even memory bank so for both the order even memory banks we are going to generate separate chip select signals so using these three we will generate chip select signal for odd also and for even also okay and this chip selects signal it is derived from the output of the decoding circuit here the decoding circuit it can be a logic gate or it can be a decoder so the output of that lourd decoding circuit that will be the chip select signal so these are the three steps which we are going to follow whenever we will interface of memory chip with the eight zero eight six microprocessor first we will find out that how many address lines are required to address that memory chip then we will connect those address lines with the address lines of the microprocessor and the memory chip they will be connected data lines will be connected we will arrange the memory location so that we will get an 8-bit or memory bank and a bit even memory bank okay then chip selects signal will be generated using the three signals bhe a naught and the remaining address lines and that chip selects signal will be generated for both the odd and the even memory backs so in this video we studied about the interfacing of the memory chips with the eight zero eight six microprocessor we started with the that what is the memory what are the types of memory ram and rome available in the microprocessor what is the structure open simple memory device it consists of address data line selection input and control inputs and how we can interface our memory device with the eight zero eight six microprocessor so I hope that this topic is clear to you thank you

11 thoughts to “Interfacing Memory with 8086 Microprocessor – Microprocessor for Degree Engineering”

  1. When how many bit it can store is not given so what are bit consider ex interface the 64k ROM and 16k ram of 8086

  2. But my question remains tha" If the data is transferring from memory to processor or vice versa if electricity goes off (Light goes off) where will be the data on that point? waiting for honest reply.

  3. Hello Friends,

    Watch Complete Video Series of Subject Microprocessor only on Ekeeda Application.

    Use Coupon Code "NEWUSER" and access any one Subject free for 3 days!

    Download Ekeeda Application and take advantage of this offer.

    Android:- https://play.google.com/store/apps/details?id=student.ekeeda.com.ekeeda_student&hl=en

    iOS:- https://itunes.apple.com/tt/app/ekeeda/id1442131224

  4. In 8086 microprocessor, A0 bit is used for selecting bank ,not memory address.so A1 to A12 are used

Leave a Reply

Your email address will not be published. Required fields are marked *