 This is Vishwanachawan, assistant professor, computer science and engineering department, Valchani Institute of Technology, Solapur. Now I am here to explain operating modes of A255. At the end of this session, students will be able to differentiate bit set reset and input output mode. Let us see the control word format of A255. A255 is called Programmable Peripheral Interface. So to know how it works, we should know how control word format of A255 appears. So it is total 8 bits, bit D0, D1, D2, D3, D4, D5, D6, D7. And the second row indicates the respective port cases like D0, PCL, port C, lower bit, that is PC0 to PC3. And this port will be acting as an input if it is 1. If it is 0, then it act as an output. Next D1 bit indicates regarding port B, PB0 to PB7. If it is 1, port B act as an input. If it is 0, port B act as an output. Next bit D2, port B mode selection, that is concerned with D1, which is port B. So selection of mode, there are two modes, mode 0 and mode 1. So if this bit is 0, then port B will be in mode 0 operation. If it is 1, then it will be in mode 1. Next D3 bit, which is PCU, port C upper part, PC4 to PC7. If it is 1, then port C upper part will act as an input. If it is 0, then it acts as an output. Next D4, which is port A, PA0 to PA7. If this bit is 1, it act as an input. If it is 0, it act as an output. Next two bits, D5 and D6. These two bits are reserved for port A mode selection. So there are three modes, mode 0, 1, 2. If it is 0, 0, these two bits are 0, 0. Then it will be under mode 0. If it is 0, 1, then it will be under mode 1. If it is 1, don't care, then it will be under mode 2 operation. Last bit, which is D7. If this bit is 0, then it will be under bit set reset mode. If it is 1, then it will act as a IO mode. We will see more detail with example. So the first three rows are already explained in the previous slide. Let us see one example. D7 bit 1, which indicates that it is in input output mode. Next two digit, D6 and D5. If both are 0, 0, then it will be under mode 0 operation. Next bit 1, that is port A. 1 means it act as an input. That is port A is going to act as an input. Then port C upper part is 0, indicates that port C upper part will act as an output. D2 bit 0, which indicates that port B is under mode 0 operation. Next bit, port B is 1, which indicates that port B is in input mode. Last bit 0, which indicates that PC lower part will act as an output. This is how we need to interpret the all 8 bits. So this is binary, whose equivalent value is 92H. Let us see how bit set and reset format works. Total there are 8 bits, D0 to D7. If D7 is 0, then it will be under bit set reset mode. And next three, that is D6, D5, D4, these are don't care conditions. Next three, D3, D2, D1, which is reserved for port C bit set and reset. The respective port will be reset if this D0 bit is 0. It will be set if it is 1. Let us see with an example, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1. So, how to interpret these 8 bits, this 0 indicates that no this is under bit set reset mode. Next 3 digit 0, since it is do not care it does not matter whether it is 0 or 1. Next 3 bits reserve for port C which is 001 which indicates that port C1 we will see how exactly it is going to assign. Then this is port C1 will be set, 1 means set, this is how 03HX indicates that port PC1 bit is set. So, we will see one more example which is concerned with reset. Since this is in BSR mode it should be 0, next do not care 3 values, next 001 same PC1 instead of 1 if it is 0 which indicates that reset, that is port C1 bit is reset. So, how port C value is calculated, port C0 means D1, D2, D3 values will be 000 respectively. So, port C1, 1, port C2, 2, port C3, 3, next 4 up to PC7, so based on this 001 in the previous slide which is here 001 which indicates that port C bit number 1, so we can use respective value to set reset the port C. So, think on this question and try to answer. The question is how many mode selections are there for port A and port B. Pause this video and write your answer, I hope you are done, so the answer is for port A 3 modes are there mode 01 and for port B 2 modes, mode 0 and mode 1, so regarding input output mode, if MSB of control 1 D7 is 1 then programmable peripheral interface works in input output mode, this is further divided into 3 modes, so we will focus on all 3 modes, mode 0, in this mode all the 3 ports which are port A, B, C can work as input function or output function depends on the value which is mentioned in the control word format, in this mode there is no interrupt handling capacity, so interrupt handling capacity can be overcome in upcoming modes, so mode 01 which is a handshake IOM mode, in this mode either port A or port B can work as input or simple output port and the port C bits are used for handshaking signals before the actual data transmission takes place and mode 01 it has the capacity to handle the interrupts and input outputs which are latched, we will see one example, the CPU wants to transfer a data to a printer, so in this case the speed of the processor is high compared to the speed of the printer, so before actual data transfer it will send handshake signal to the printer for synchronization, so this is how it sends, this is CPU, this is printer, so there are signals D0 to D7, bi-directional, strobe, acknowledgement and busy signal, so this is how printer and CPU they are interacting with each other the help of handshaking signals, so next mode is mode 02, bi-directional data bus mode, in this mode only port A works and port B can work either in mode 01 or mode 01, six bits port C are used as handshake signal and bits reset mode, this mode is used to set or reset the bits of port C only and selected when the most significant bit D7 in the control registry is 0, these are the references, thank you.