



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




















an interface is a shared boundary across which two or more separate components of a computer system exchange information. The exchange can be between software, computer hardware, peripheral devices, humans, and combinations of these. Example: Some computer hardware devices, such as a touchscreen, can both send and receive data through the interface, while others such as a mouse or microphone may only provide an interface to send data to a given system. Mobile and washing machine Or Interface is the path for communication between two components. Interfacing is of two types, memory interfacing and I/O interfacing. Memory Interfacing When we are executing any instruction, we need the microprocessor to access the memory for reading instruction codes and the data stored in the memory. For this, both the memory and the microprocessor requires some signals to read from and write to registers. The interfacing process includes some key factors to match with the memory requirements and microprocessor signals. The interfacing circuit therefore should be designed in such a way that it matches the memory signal requirements with the signals of the microprocessor. Or IO Interfacing There are various communication devices like the keyboard, mouse, printer, etc. So, we need to interface the keyboard and other devices with the microprocessor by using latches and buffers. This type of interfacing is known as I/O interfacing.
Isolated I/O Isolated I/O in which we Have common bus(data and address) for I/O and memory but separate read and write control lines for I/O. So when CPU decode instruction then if data is for I/O then it places the address on the address line and set I/O read or write control line on due to which data transfer occurs between CPU and I/O. As the address space of memory and I/O is isolated and the name is so. The address for I/O here is called ports. Here we have different read-write instruction for both I/O and memory.
Memory M1 is selected whenever A 12 - A 23 =000000000000, while M2 is selected whenever A 12 - A 23 =100000000000. Figure 126: Full address decoding of two memory devices.
Both latches and flip-flops are circuit elements whose output depends not only on the current inputs, but also on previous inputs and outputs. The difference between a latch and a flip-flop is that a latch does not have a clock signal , whereas a flip-flop always does.
How can we make a circuit out of gates that is not combinatorial? The answer is feed-back , which means that we create loops in the circuit diagrams so that output values depend, indirectly, on themselves. If such feed-back is positive then the circuit tends to have stable states, and if it is negative the circuit will tend to oscillate. A latch has positive feedback. Here is an example of a simple latch: This latch is called SR-latch , which stands for set and reset. It is not practical to use the methods that we have used to describe combinatorial circuits to describe the behavior of the SR-latch. Later, we will show a method for describing flip-flops and clocked sequential circuits. For now, we just rely on our intuition to describe how latches work. The SR-latch is meant to have at most one of its inputs equal to 1 at any time. When both of its inputs are 0 it has two different stable states possible. Either x is 0 , in which case we have the following signal values:
The 1 on the r input makes sure the x output is 0 , and the two 0 s on the input of the upper nor -gate make sure the output of the upper nor -gate is 0. Now suppose the r input goes from 1 to 0 , while the s input remains at 0. The second input of the lower nor -gate is 1 , so the transition from 1 to 0 of the r input, does not make any difference. The output of the upper nor -gate remains at 1. In this case, if the s and r inputs are both 0 , there is only one possible stable state, the one that gives x the value 0. From the discussion above, we conclude that the SR-latch is able to remember the last state of the inputs, in the sense that it remembers which of the two inputs, s or r, last had the value of 1. When we need to draw an SR-latch, we use the following symbol:
Latches are asynchronous , which means that the output changes very soon after the input changes. Most computers today, on the other hand, are synchronous , which means that the outputs of all the sequential circuits change simultaneously to the rhythm of a global clock signal. A flip-flop is a synchronous version of the latch. To complicate the situation even more, there are several fundamental types of flip-flops. Here, we shall only consider a type called master-slave flip-flop. In addition to the fundamental types of flip-flops, there are minor variations depending on the number of inputs and how they control the state of the flip-flop.
Here, we shall only consider a very simple type of flip-flop called a D-flip-flop. A master-slave D-flip-flop is built from two SR-latches and some gates. Here is the circuit diagram: The leftmost SR-latch is called the master and the rightmost is called the slave. Let us first consider what happens when the clock signal is 1. In this case, the two and -gates in front of the input of the master are open , i.e., they let the value of the D-input through to the s input of the master, and the inverse of the D input to the r input of the master. Thus, the value of the D input will go straight trough the master to the x output of the master. But the two and -gates of the slave re closed , i.e., their outputs are always 0 , so the slave keeps its old value. When instead the clock signal is 0 , the reverse is true, i.e., the and -gates at the input of the master are closed , whereas the ones at the input of the slave are open. In this case, the flip-flop is completely insensitive to changes in input. Now, let us consider what happens when the clock goes from 1 to 0. For this to work, we have to assume that the input remains the same during a brief period from right before to right after the clock signal changes. The first thing that happens is that the and -gates at the input of the master turn off , i.e., they become insensitive to further changes in input. The value of the x output of the master is now the value of the D input right before the clock started changing. A brief moment later, the clock signal transition has traversed the inverter and reaches the and -gates of the slave. These gates open , allowing the x output of the master to be propagated to the x value of the slave. The x value of the slave, and therefore that of the entire flip-flop now contains the value of the D input right before the clock started changing. We can say that the clock transition copied the input to the output of the flip-flop. But at no point
At the end of the service routine, the RET instruction returns the execution to where the program was interrupted. All 8051 interrupts are vectored interrupts. Non-vectored Interrupt Non-vectored interrupt is an interrupt that has a common ISR, which is common to all non-vectored interrupts in the system. Address of this common ISR is known to the CPU. The interrupts which don’t have fixed memory location for transfer of control from normal execution. The address of the memory is sent along with the interrupt. The CPU crucially does not know which device caused the interrupt without polling each I/O interface in a loop. Once the interrupt occurs, the system must determine which device, of all the devices associated actually interrupted. The Difference A vectored interrupt is where the CPU actually knows the address of the interrupt service routine in advance. All it needs is that the interrupting device sends its unique vector through a data bus and through its I/O interface to the CPU. The CPU takes this vector, checks an interrupt table in memory and then carries out the correct ISR for that device. Therefore, the vectored interrupt allows the CPU to be able to know that ISR to carry out in software (memory). A non – vectored interrupt is where the interrupting device never sends an interrupt vector. An interrupt is received by the CPU and it jumps the program counter to a fixed address in hardware. This is typically a hard coded ISR which is device agnostic. The CPU crucially does not know which device caused the interrupt without polling each O/I interface in a loop and checking the status register of each I/O interface to find the one with status “interrupt created”.
The microprocessor is a programmable logic device, designed with registers, flip-flops. The microprocessor has a set of instructions designed internally, to manipulate data and communicate with peripherals. This process of data manipulation and communication is determined by the logic design of the microprocessor, called the architecture. The microprocessor can be programmed to perform functions on given data by selecting necessary instructions from its set. These instructions are given to the microprocessor by writing them into its memory. Writing (Or entering) instruction and data is done through an input device such as a keyboard. The microprocessor reads or transfers each instruction one at a time, matches it with its instruction set, and performs the data manipulation indicated by the instruction. The result can be stored in memory or scent to such output devices as LEDs or a CRT terminal. In addition, the microprocessor can respond to external signals. Its can be interrupted, reset, or asked to wait to synchronize with lower peripherals. All the various functions performed by the microprocessor can be classified in three general categories : ♦ Microprocessor-initiated operations ♦ Internal data operations ♦ Peripheral (or externally) initiated operations. To perform these functions, the microprocessor requires a group of logic circuits and a set of signals called control signals. However, early processors do not have the necessary circuitry on one chip; the complete units are made up more than one chip. Therefore, the term Micro Processing Unit (MPU) is defined here as a group of devices that can perform these functions with the necessary set of control signals. This term is similar to the term Central Processing Unit (CPU). However, later microprocessors include most of the necessary circuitry to perform these operations on a single chip. Therefore, the terms MPU and microprocessor often are used synonymously.
here are a total of 40 pins on the 8085. Check out the pin diagram below. Subsequently, we will take a look at the function of each pin. 8085 pin diagram Address and Data Bus (Pins AD0-AD7 and Pins A8-A15) AD0-AD7 (Lower-order address/Data Bus)- These pins are multiplexed. That means that they perform dual tasks. The address bus is used to connect with IO devices or memory. The 8085 has another pin, which helps in demultiplexing these 8 pins. That is the ALE pin. So for the first machine cycle, you can access the address
lines. These are then latched to an external latch. The 74LS373 IC is used to hold on to these 8 bits. So at the second machine cycle, the 8 address bits are latched and saved at the 74LS373 latch, and we source the data lines from the AD0-AD7 pins. In short, you have 16 bits of data sourced from 8 pins of the 8085 microprocessor. A8-A15 (Higher-order address Bus) – The remaining higher-order 8 bits of the 16-bit address access capability of the 8085 are sourced from these 8 pins. So you have A0A1A2A3A4A5A6A7 (from AD0- AD7 pins) A8A9A10A11A12A13A14A15 (from A8-A15 pins). A total of 16 bits. Status Signals (Pins ALE, S1, and S0) ALE (Address Latch Enable) – The address latch enable is a positive pulse that activates the external latch IC in the first machine cycle. This tells the external latch to wake up, address lines incoming! The latch responds and demultiplexes the AD0-AD7 pins to A0-A7 and D0-D7. S1 and S0 (Status signals) – These are basic status signals that indicate the operation that the microprocessor is performing at any given stage. S1 S0^ Operation 0 0 HALT 0 1 WRITE 1 0 READ 1 1 FETCH Control Signals (Pins , , IO/ ) (Read) – This is an active low input. When it goes low, the microprocessor reads data from either the IO device or from memory. In simple terms, the microprocessor takes data input by placing the data from a source (IO/Memory) on the data bus. (Write) – Another active low pin that does the opposite work as the previous pin. When it goes low, the data on the data bus is written to a memory location or an I/O device.
Clock Signals (Pins X1, X2, and CLKOUT) X1, X2 – These are the pins where you can connect the external crystal oscillator (or an LC or RC network). The 8085 has an internal clock generator. Intel was actually trying to move away from external clock generators when they introduced the 8085. So they built an internal clock generator. This clock generator is powered by the external oscillating circuit. The internal clock, however, divides the input at X1, X2 by two. So if you want the 8085 to operate at 6MHz, the input at X1, X2, has to be 12MHz. The division by two is just a precaution to get clean and evenly spaced clock cycles. As you will learn, clock cycles are very important for the execution of instructions in a microprocessor. Or any digital logic devices for that matter. CLKOUT (Clock Out) – This is the clock signal that you can use for other ICs or peripherals to sync them up with the microprocessor. The frequency available here is the same as the frequency that the microprocessor clock generator generates. Reset Signals (Pins and RESET OUT) – The bar on top of the pin indicates that this is an active low pin. Which means that it is active when it is given a low (zero) input. When a high (one) input is given, it’s off. The function of this pin is to reset the microprocessor. The program counter (which increases as programs execute) sets to 0. A fresh start. Once the low input is removed, the microprocessor begins executing instructions from 0000H address. The state of the flags and internal registers is unpredictable on the application of this signal. RESET OUT – This signal is used to a) indicate that the microprocessor is being reset. b) Reset external peripherals or CPUs. DMA (Direct Memory Access) Signals (Pins HOLD and HLDA) HOLD – The HOLD pin can be used to communicate to the microprocessor control mechanism that an external device is requesting the use of the address and data bus. Suppose a shift register IC is using the address and the data bus at a particular instant. Suddenly, a wild Counter appears and sends a signal to the HOLD pin. The microprocessor says hang on! Let me finish my current machine cycle. Once the microprocessor does that, it gives
up control of the buses to the counter. And send out an acknowledge signal via the HLDA pin. HLDA (HOLD Acknowledge) – The HOLD Acknowledge pin goes high when the microprocessor surrenders its control of the buses in response to the HOLD call. Once the HOLD request is attended to, the HLDA pin goes low, and the processor takes over the buses. Serial I/O Signals (Pins SID and SOD) SID (Serial Input Data) – Ths pins accepts serial input data. The data transfers from the pin to the 7th bit of the accumulator when a RIM instruction executes. SOD (Serial Output Data) – This pin outputs serial data onto the 7th bit of the accumulator when a SIM instruction is executed. We will take a look at the SIM and RIM instructions in the post on the instruction set of the 8085. Power Supply Signals (Pins Vcc and Vss) Vcc – 5V power input Vss – Ground
Addressing Modes in 8085 These are the instructions used to transfer the data from one register to another register, from the memory to the register, and from the register to the memory without any alteration in the content. Addressing modes in 8085 is classified into 5 groups − Immediate addressing mode In this mode, the 8/16-bit data is specified in the instruction itself as one of its operand. For example: MVI K, 20F: means 20F is copied into register K. Register addressing mode In this mode, the data is copied from one register to another. For example: MOV K, B: means data in register B is copied to register K.
An interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. Whenever an interrupt occurs, the controller completes the execution of the current instruction and starts the execution of an Interrupt Service Routine (ISR) or Interrupt Handler. ISR tells the processor or controller what to do when the interrupt occurs. The interrupts can be either hardware interrupts or software interrupts. Hardware Interrupt A hardware interrupt is an electronic alerting signal sent to the processor from an external device, like a disk controller or an external peripheral. For example, when we press a key on the keyboard or move the mouse, they trigger hardware interrupts which cause the processor to read the keystroke or mouse position. Software Interrupt A software interrupt is caused either by an exceptional condition or a special instruction in the instruction set which causes an interrupt when it is executed by the processor. For example, if the processor's arithmetic logic unit runs a command to divide a number by zero, to cause a divide-by-zero exception, thus causing the computer to abandon the calculation or display an error message. Software interrupt instructions work similar to subroutine calls. Interrupt Service Routine For every interrupt, there must be an interrupt service routine (ISR), or interrupt handler. When an interrupt occurs, the microcontroller runs the interrupt service routine. For every interrupt, there is a fixed location in memory that holds the address of its interrupt service routine, ISR. The table of memory locations set aside to hold the addresses of ISRs is called as the Interrupt Vector Table.
Timing diagram is a graphical representation. Represents the execution time taken by each instruction in graphical formate. The execuation format is represented in T states A computer processor or CPU speed is determined by the clock cycle , which is the amount of time between two pulses of an oscillator. Generally speaking, the higher number of pulses per second, the faster the computer processor can to process information. The clock speed is measured in Hz, often either megahertz (MHz) or gigahertz (GHz). For example, a 4 GHz processor performs 4,000,000,000 clock cycles per second.