







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Notes for BCA students of UOM. old syllabus
Typology: Lecture notes
1 / 13
This page cannot be seen from the preview
Don't miss anything!
Input Device
Output CPU Device
Memory
3BCA5 Introduction to Microprocessor Unit -
A microprocessor is an integrated circuit which has the ability to mimic the processes executed by the processing unit. The integrated circuit accepts data as an input and process it according to instruction code to generate an information. With the use of input device, processing unit can get the input and after processing the input, processor will give the information to the user with the help of output device. The integrated circuit was also designed which has an ability to store the data, instruction code and information. The processing unit reads instruction code from this circuit and act accordingly. The system with central processing unit, input device, output device and memory can be visualized as shown in the figure 1.1. The processor as an integrated circuit in a very small size hence referred Microprocessor Data Data Information Information
Data Instruction Code Information
fig 1.1 Block diagram of a Computer
fig 1.2 is a simple seqential digital circuit which consists od 4 bit counter, 2 decoders, registers, switch control circuit, control unit arithmetic logic unit and bus.
Prof. Parimal Kumar K.R
It is a 4 bit counter, which starts counting from 0 and ends at 15 (0000 – 1111). The counter is driven by the clock signal and the output is given to Decoder A through 4 lines referred as address bus.
It is a 4 : 16 Decoder which activate its output depending on the status of inputs. The output of the decoder is used to select one of the registers within the register array.
The above figure shows the register array consists of sixteen 3 bit registers. The output of all the registers are connected to a common bus through the Output Enable (OE) switch
The output of the Decoder A is used to active output enable signals of sixteen registers (R 0 - R 15 ). At a time only one output of decoder is activated according to the output signal, so data of only one register is available on the common bus.
AND : This control circuit generated control signals to perform AND operation in ALU. [ A ] Ʌ [ B ] = [ C ]
OR : This control circuit generated control signals to perform OR operation in ALU. [ A ] V [ B ] = [ C ]
LOAD A : This control circuit generates control signals which activate input enable signal for register A. It also indicates switch control circuit to change switch position to A.
LOAD B : This control circuit generates control signals which activate input enable signal for register B. It also indicates switch control circuit to change switch position to B.
ALU takes input from register A and register B and processes it according to the operation selected by the control unit. The processed result is stored in register C.
Switch control circuit is responsible for switch position. It gets the input from LOAD A, LOAD B control circuits. If any of the input s is activated, it changes switch position to A, otherwise it hold switch at position B.
operation is referred as “operation code” or “OpCode”. As mentioned in table 1.1. each operation has its own operational code.
In operation MOV A,C and MOV B,C the data is transferred from register C to register A or B respectively. In operation ADD, SUB, AND and OR the processing data is taken from register A and register B. In operation LOAD A and LOAD B data from common bus is directly loaded into register A and register B respectively. For last 2 operations switch must be in position A
After each operation is couter is incremented by one, so that the decoder selects the next register. Again the data from selected register is available on the common bus and the process is repeated.
Different phases in the execution process are
1. Fetch microprocessor places the contents of the program counter on the address bus and gets the instruction code, opcode from the address memory location. The microprocessor then saves opcode in the instruction register. 2. Decode The instruction from the instruction register is decoded with the help of instruction decoder to generate appropriate control signals to execute the instuction. 3. Execute Microprocessor generates appropriate control signals and executes the instruction.
Problem : Add 2 numbers ( 5 + 2)
Procedure : 1. Load first number in register A
Steps : 1. LOAD A
First step is to load the number in register A. So, the opcode to do this should be stored in register R 0 and the value for register A is stored in register array R 1. Similarly for second value. The opcode to load register B is in register R 2 and second value is in register R 3. The opcode to add is stored in register R 4.
STEP 1 : Output of COUNTER is 0 (0000) In the beginning the counter output is 0 (0000). This output value is given as input to 4 : 16 Decoder (A) which selects register R 0 from register array. The value in register is 110 which is available in common bus. The Instruction decoder (3 : 8 Decoder B) will use this data to select the operation. Data is 110. So, it selects LOAD A operation. LOAD A operation will enable input for register A and change the switch position from B to A (fig 1.4).
STEP 2 : Output of COUNTER is 1 (0001) Counter output is 1 (0001). This output value is given as input to 4 : 16 Decoder (A) which selects register R (^1) from register array. Now the value 101 is availabe on the common bus. This value is moved directly to register A because switch is positioned at A and input to register A is enabled. After the data transfer switch position is changed from position A to position B.
STEP 3 : Output of COUNTER is 2 (0010) Counter output is 2 (0010). This output value is given as input to 4 : 16 Decoder (A) which selects register R (^2) from register array. The value in register is 111 which is available in common bus. The Instruction decoder (3 : 8 Decoder B) will use this data to select the operation. Data is 111. So, it selects LOAD B operation. LOAD B operation will enable input for register B and change the switch position from B to A.
STEP 4 : Output of COUNTER is 3(0011) Counter output is 3 (0011). This output value is given as input to 4 : 16 Decoder (A) which selects register R (^3) from register array. Now the value 010 is availabe on the common bus. This value is moved directly to register B because switch is positioned at A and input to register B is enabled. After the data transfer switch position is changed from position A to position B.
STEP 5 : Output of COUNTER is 4(0100) Counter output is 4 (0100). This output value is given as input to 4 : 16 Decoder (A) which selects register R (^4) from register array. The value in register is 111 which is available in common bus. The Instruction decoder (3 : 8 Decoder B) will use this data to select the operation. Value is 010. So, it selects ADD operation which
The 8085 Microprocesor Microprocessor 8085 is an 8 bit NMOS single chip with approx 6200 transistors on 166 X 222 mil chip contained in a 40 pin dual in line package.
fig 2.1 Architecture of 8085 microprocessor
It consists of various functional blocks. They are
The registers can be classified as a. General purpose registers
It has 6 general purpose registers B,C,D,E,H,L which can be used as a 8 bit registers or in pairs as 16 bit registers BC, DE and HL. When used in pairs the higher order byte resides in the first register and the lower order byte in the second register. Example Higher order in B and lower order byte in C.
The special HL pair functions as a pointer to memory location. These registers is also called scratch pad registers. Bus access is not required to store and load onto these registers. Thse can be used to store intermediate results.
b. Temporary registers i. Temporary data registers These registers are nor accesible. It is internally used for execution of arithemtic and logical operations. The ALU has 2 inputs. One input is supplied by the accumulator and another from the data registers.
ii. W and Z registers These are 8bit registers which cannot be accessible.
The CALL instruction is used to transfer the program counter to a sub program. This instruction pushes the content of program counter to the stack and loads the first instruction address of the subroutine in to the program counter. The given address is temporarily stored in W nad Z register and placed on the bus.
During XCHG instruction the data in H & L is transferred to D & E register respectively. At the time of exchange W and Z registers are used to temporarily store the data.
c. Special purpose registers. i. Register A (Accumulator) It is a tri state 8 bit register. It is extensively used in arirthmetic, logic, store load and I/O operations. The result of arithmetic and logical operations are stored in the register A. It is also called as accumulator.
ii. Flag register In a 8 bit register, 5 bits carry significant information in the form of flags. They are D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 S Z X AC X P X CY
Sign flag (S) : The D7 bit is set (1) after the execution of arithmetic or logical operations if the resultant is a negetive number. For positive numbers the value will in D7 is 0. Zero flag (Z) : In the ALU, after an operation if the result is zero the D6 bit is set (1). The flag also sets to zero if a certain register content becomes zero after an increment or decrement operation in that particulat register.
Shifter : It performs logical operations like rotate left, rotate right, etc.The result of operation is again stored into accumulator. Status Register : Also known as flag register. It contains a no. of flags either to indicate conditions arising after last ALU operation or to control certain operations.
The instruction decoder decodes the opcode received from the instruction register. Depending upon the nature of the instruction it gives timing and control signals which controls the register , the data buffer, ALU and the external peripheral signals. It also gives the information about which machine cycle is currently executing in the encoded form on the S 0 , S 1 and IO/M lines.
It is an 8 bit bidirectional buffer. It is used to drive multiplexed address/data bus i.e, low order
address bus (A 7 – A 0 ) and data bus (D 7 – D 0 ).
It is a 16 bit register used to increment or decrement the content of program counter or stack pointer as a part of instruction execution.
Consider a microprocessor is executing the main program. Now whenever the interrupt signal is enabled or requested the microprocessor temporarily stops the execution of main program and transfers control to specific special routine known as "Interrupt Service Routine"(ISR). After the completion of request, the control goes back to the main program.
There are 5 interrupt signals present in 8085.They are: I. INTR II. RST 7. III. RST 6. IV. RST 5. V. TRAP
TRAP is a NON-MASKABLE interrupt control and other three are maskable interrupts. A non- maskable interrupt is an interrupt which is given the highest priority in the order of interrupts. Non- maskable interrupt cannot be disabled by programmer at any point of time. Whereas, the maskable interrupts can be disabled and enabled using EI and DI instructions. Among the maskable interrupts RST 7. is given the highest priority above RST 6.5 and least priority is given to INTR.
In serial communication one bit is transferred at a time over the single line. In this processor, serial IO control provides two lines SID and SOD for serial communication. The serial output data line (SID) is used to send the data and serial input data line (SOD) is used to receive the data serially.
The operation in microprocessor are synchronized using the clock signals. Along with the control of fetching and decoding operations and generating appropriate signals for instruction execution, control circuitry also generates signals required to interface external devices with the processor.
Pin definition of 8085
fig 3.1 8085 Pin Diagram fig 3.2 Functional pin diagram
The signals of 8085 can be classified into 7 groups according to their functions.
2. RST 7.5,RST 6.5 and RST 5.5: These are active high, edge (RST 7.5) or level (RST 6.5 and RST 5.5) triggered maskable interrupts.The priorities of these are TRAP, RST 7.5, RST 6.5, and RST 5.5. When RST 7.5, RST 6.5 and RST 5.5 are active, the program counter jumps automatically at address 003C, 0034, 002C respectively. 3. INTR and INTA: INTR is an active high, level triggered general purpose interrupt. When INTR is active microprocessor generates an interrupt acknowledge signal INTA. If INTR is active, the Program Counter (PC) will be restricted from incrementing and an INTA will be issued. During This cycle a RESTART or CALL instruction can be inserted to jump to the interrupt Service routine. The INTR is enabled and disabled by software. It is disabled by Reset And immediately after an interrupt is accepted.
a. SID : This is an active high Serial input data line the data on this line is loaded into accumulator bit 7 whenever a RIM instruction is executed. This signal is used to accept serial data bit by bit from the external device.
b. SOD : This is an active high Serial output data line. The output SOD is set or reset as specified by the SIM instruction. This signal enables the transmission of data serially bit by bit to the external device.
a. HOLD : HOLD indicates that another Master is requesting the use of the Address and Data Buses. The CPU, upon receiving the Hold request, will withdraw the use of buses as soon as the completion of the current machine cycle. Internal processing can continue. The processor can regain the buses only after the Hold is removed. When the Hold is Acknowledged, the Address, Data, RD, WR, and IO/M lines are tristated.
b. HLDA : HOLD ACKNOWLEDGE indicates that the CPU has received the Hold request and that it will withdraw the buses in the next clock cycle. HLDA goes low after the Hold Request is removed. The CPU takes the buses one half clock cycles after HLDA goes Low.
a. RESET IN : Reset sets the Program Counter to zero and resets the Interrupt Enable and HLDA Flip- flops and makes address, data and control lines tristated. The CPU is held in the reset condition as long as Reset is applied. After reset status of internal register and flag are unpredictable. After reset microprocessor starts executing the instruction from 0000H onwards.
b. RESET OUT : This is an active high output signal used to indicate CPU is being reset and can be used as a system RESET. The signal is synchronized to the processor clock. This signal is also used to reset the peripherals once the microprocessor is reset. It is an acknowledgement signal to RESET IN.
Exercise Questions
8085 microprocessor.