The document discusses different methods of input/output (I/O) operations in microprocessors, including programmed I/O, interrupt I/O, and direct memory access (DMA). Programmed I/O involves the microprocessor executing instructions to transfer data via I/O ports. Interrupt I/O allows external devices to trigger an interrupt service routine. DMA allows data transfers directly between memory and external devices without microprocessor involvement using a DMA controller.
DMA stands for Direct memory access and is a method of transferring data from the computers RAM to another part of the computer without processing it using the CPU.
DMA stands for Direct memory access and is a method of transferring data from the computers RAM to another part of the computer without processing it using the CPU.
In many I/O interfacing applications and certainly in data acquisation system. it is often necessary to transfer data to or from an interface at data rates higher than those possible using simple programmed I/O loops
In many I/O interfacing applications and certainly in data acquisation system. it is often necessary to transfer data to or from an interface at data rates higher than those possible using simple programmed I/O loops
For the Students of Diploma in IT as well as CM
Scheme: G
Semester:4th
Subject:Microprocessor & Programming.
Subject.Code: 17431
Chapter.No: 1
Title: Basics of Micro-Processor
Question.No.1: Draw & Explain the Pin-Diagram of 8085 Micro-Processor.
INTRODUCTION TO DIGITAL ELECTRONICS & HALF ADDER (LINK TO VIDEO IN DESCRIPTI...George Thomas
Basics of Digital Electronics and Half adder
INTRODUCTION TO DIGITAL ELECTRONICS
https://www.youtube.com/watch?v=KybvB73a0Dc&t=1s
HALF ADDER WITH SIMULATION
https://www.youtube.com/watch?v=EgkyJ5Ur4f0&t=199s
Renewable and Non- renewable energy SourcesGeorge Thomas
Renewable energy is energy which is generated from natural sources i.e. sun, wind, rain, tides and can be generated again and again as and when required. Non-Renewable energy is energy which is taken from the sources that are available on the earth in limited quantity and will vanish fifty-sixty years from now.
A wind mill converts the kinetic energy of moving air into Mechanical energy that can be either used directly to run the Machine or to run the generator to produce electricity.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
MICROPROCESSOR INPUT OUTPUT OPERATIONS
1. INPUT/OUTPUT(I/O) OPERATION
The I/O operation is defined as the transfer of
data between μP and the external world.
Three main way to transferring data
Programmed I/O
Interrupt I/O
Direct Memory Access (DMA)
2. •Programmed I/O
The μP executes a program to perform all
data transfer between the μP and the
external devices via one or more registers
called I/O ports.
The μP completely controls all the
transfers of data.
3. •Interrupt I/O
An external device can force the
microcomputer system to stop executing the
current program temporarily so that it can
execute another program known as interrupt
service routine.
After having completed this program,μP
returns to the program that it was executing
before the interrupt.
4. •Direct Memory Access (DMA)
Data can be transferred between the micro
computer memory and external devices
without any microprocessor involvement.
An interface chip called the DMA controller
chip is used with the microprocessor for
transferring data via DMA
5. •Programmed I/O
The μP executes a program to perform all
data transfer between the μP and the
external devices via one or more registers
called I/O ports.
The μP completely controls all the
transfers of data.
6. •Programmed I/O ............
Two registers are associated with each I/O port.
Data Register – will contain the actual data being
inputted into or outputted from the μP.
Data direction register - configure each bit in the data
register as input or output
1 in DDR indicates corresponding bit in DR as output &
0 in DDR indicates corresponding bit in DR as input
7 6 5 4 3 2 1 0
DDR
DR
1 0 0 0 0 1 0 1
7. •Programmed I/O ............
1 0
I/O PORT A I/O PORT B
Only one data direction register, known as command or
control register.
8. Standard I/O & Memory Mapped I/O
Standard I/O
Utilizes a control pin on the microprocessor chip called
IO/M control signal.
IN
XX
2 – byte instructions
OUT
XX
9. Memory Mapped I/O
μP does not utilizes the IO/M, then the μPdoes not
differentiate between I/O and memory.
RAM address is used to represent I/O port.
LDA
XX
XX
STA
3- byte instructions
XX
XX
All μP instructions that reference memory address
can be used.
3 byte instructions
10. Memory mapped I/O
Reduce maximum size of memory.
Most significant bit used to distinguish between I/O and
memory.
A15 = 1 , an I/O port is selected
A15 = 0, a Memory is selected
11. UNDONDITIONAL AND CONDITIONAL
PROGRAMMED I/O
UNDONDITIONAL
Data transfer occurs at any time; the external device
must always be ready for data transfer.
CONDITIONAL
Data transfer between the microprocessor and
external device occurs via hand shaking.
The microprocessor execute a programme in order to
verify whether the external device is ready for data
transfer.
HAND SHAKING – The transfer of control information
btwn the μP and external device
12. The μP inputs the status
of external device
O.K for
I/O
transfer?
YES
Transfer data btwn μP
and external device
NO
13. •Interrupt I/O
An external device can force the
microcomputer system to stop executing the
current program temporarily so that it can
execute another program known as interrupt
service routine.
After having completed this program,μP
returns to the program that it was executing
before the interrupt.
14. ………Interrupt I/O
• The microcomputer uses a pin on the μP uses a pin on
the μP called the interrupt pin (INT).
• INTR and INTA
• When the device wants to communicate with the μP, it
makes the signal on the interrupt line HIGH or LOW.
• In response, the μP completes the current instruction.
• The programme interrupt service routine is executed.
15. • A maskable interrupt can be enabled or disabled by
executing instruction such as EI and DI.
• If the μP’s interrupt is disabled , the μcomputer
ignores a maskable interrupt.
• Interrupt flag- [ 1 – maskable interrupt are diabled]
• The non maskable interrupt has the higher priority
over the maskable iterrupt and cannot be enabled and
disabled by instructions.
• If both maskable interrupt and the non maskable
interrupt are activated at same time,the priority will
goes to …………………….
18. •Direct Memory Access (DMA)
Data can be transferred between the micro
computer memory and external devices
without any microprocessor involvement.
An interface chip called the DMA controller
chip is used with the microprocessor for
transferring data via DMA
19. • DMA controller chip put μP in a HOLD state by means
of HOLD control signal. The μP stops the current
operation and disconnects all the buses.
• The DMA controller chip takes over the μP bus as
soon as it receives the DMA acknowledge signal from
μP.
• DMA controller chip control all data transfer. After
completion of data transfer, it transfers control of the
system bus to μP by removing the μP from the HOLD
state.
20. • Data transfer is performed between memory and
peripheral device either by completely stopping the
microprocessor (Block Transfer DMA) or by cycle
stealing.
• In both case μP is stopped for DMA operation.
• BTD transfers a complete block of data
• CS data transfer occurs on a byte transfer basis until the
transfer is completed.
• If data block is large, BTD is recommended.
• If μP cannot be kept inactive in a particular application,
cycle stealing is used.
21.
22. • THREE REGISTERS are associated with DMA
controller
• Address register – starting address of data to be
transferred
• Terminal count register – contains the desire
block of data to be transferred
• Status Register – contains information such as
completion of the DMA transfer
23. Cycle stealing DMA
• The DMA controller transfers a byte of data
btwn the memory and peripheral device by
stealing a clock cycle of the μP.
• In order to perform a DMA transfer, the DMA
controller stop the μP by lowering the INHIBIT
signal to LOW.
• Using cycle stealing, data is transferred 1 byte
at a time.
• The DMA controller requests the μP for each
byte to be transferred.
24. Interleaved DMA
• DMA controller takes over the system bus when
the μP is not using it.
• Data transfer occurs without stopping the μP.
25. Addressing Modes
1. Direct Addressing Modes
In this mode of addressing the address of the operand (data) is
given in the instruction itself.
STA 2400 – store the content of accumulator in the
32,00,24 memory location 2400
In 02 - Read data from the Port C.
2. Register Addressing Modes
In this mode operand is in one of the general purpose registers
or accumulator.The opcodespecifies the addressof the register in
addition to the operation to be performed.
MOV A,B ADD B
78 80
26. 3. Register Indirect Addressing
In this mode the address of the operand is specified by the
register pair.
LXI H, 2500 load H-L pair with 2500
MOV A,M move the content of the memory location,
whose address is in the H-L pair to the
accumulator.
[MOV A,M – is an example for Register Indirect
Addressing Mode]
LXI H, 2500
ADD M
HLT
27. 4. Immediate Addressing Mode
In immediate addressing mode the operand is specified
with in the instruction itself.
MVI A,05
[3E, 05] ----------- code form
ADI 06
[C6, 06]
In the instructions the 2nd byte specifies data.
28. 5.Implicit Addressing
Instruction which operate on the content of the
accumulator. Such instructions donot require the address of
the operand.
CMA
RAL - rotate the content of the accumulator left on bit through
carry.
RAR - rotate the content of the accumulator right on bit through
carry.
RLC RRC
29. CLASSIFICATION OF INSTRUCTIONS
a. Data transfer group
b. Arithmetic group
c. Logical group
d. Branch Control Group
e. I/O Machine Control Group
30. a. Data transfer group
Instructions which are used to transfer data from
one register to another register, from memory to
register, register to memory etc.
MOV r1, r2
MOV B,A MOV A,B
MOV r, M
LXI H,2000 Load H-L pair by 2000
MOV B,M
MVI r, data MVI M, data MVI M, data
MVI M,08
31. LXI rp, data 16
LXI H, 2500H
LDA addr– load accumulator directly by the content of the
memory location , whose address is specified
by the 2nd and 3rd bytes of instruction.
LDA 2400 32,00,24 (code form)
STA addr
LHLD addr
SHLD addr
XCHG – exchange the content of H-L with D-E pair
32. b. Arithmetic Group
• The instruction under arithmetic group perform
arithmetic operation such as addition, subtraction,
increment, decrement of the content of a register or
memory.
ADD r
ADD M
ADC r [A] [A] + [r] + [CS]
ADC M
ADI - add immediate data to accumulator
DAD rp [H-L] [H-L] + [rp]
SUB r SUB M INR r INR M
33. c. Logical group
The instruction of this group perform AND, OR, EXCLUSIVE –OR
operations, compare, rotate or take complement of data in
register and memory.
ANA r
ANA M
ANI data
ORA r ORA M ORI data
XRA r XRA M XRI data
CMA RLC RRC
34. d. Branch Control Group
The instruction of this group change the normal sequence
of the program.
The conditional branch instructions transfer the program to
the specified label when certain conditions are applied.
The unconditional branch instructions transfer the program
to the specified label unconditionally.
JMP addr - jump to the instruction specified by
the address ( unconditional)
JZ addr - Jump if the result is zero ( conditional)
JNZ addr - Jump if the result is not zero (conditional)
JC addr – Jump if there is a carry
JP addr - Jump if the result is plus
35. JM – Jump if the result is minus
JPE – Jump if even parity
JPO – Jump if odd parity
CALL addr – call the subroutine identified by the address
( Unconditional)
Conditional CALL addr
CNZ addr - Call subroutine if carry status CS=0
RET – Return from subroutine
Conditional Return RC, RZC
RST - restart
36. e. I/O Machine Control Group
This group includes the instructions for input/output ports, stack and
machine control
IN port address – Input to accumulator from I/O port
IN 01
OUT port address – Output from accumulator to I/O port
PUSH rp (Push the content of register pair to stack
POP rp – Copy two bytes from the top of the stack into the specified
register.
HLT
SPHL (Move the content of H-L pair to stack pointer)
EI DI
37. Pin Configuration
A8 -A15 (output) – Address bus used for the most significant
bits of the memory address or I/O address.
AD0- AD7 (input/output) – These are time duplex address/ data
bus(dual purpose).
Used for the least significant 8 bits of the memory or I/O
address during the first clock cycle of the machine.
Used for data during second and third clock cycle.
ALE (output) -
38. The Address and Data Busses
• The address bus has 8 signal lines A8 – A15 which are
unidirectional.
• The other 8 address bits are multiplexed (time shared) with the 8
data bits.
– So, the bits AD0 – AD7 are bi-directional and serve as A0 –
A7 and D0 – D7 at the same time.
• During the execution of the instruction, these lines carry
the address bits during the early part, then during the
late parts of the execution, they carry the 8 data bits.
– In order to separate the address from the data, we can use a
latch to save the value before the function of the bits
changes.
39. The Control and Status Signals
• There are 4 main control and status signals. These are:
• ALE: Address Latch Enable. This signal is a pulse that
become 1 when the AD0 – AD7 lines have an address on
them. It becomes 0 after that. This signal can be used to
enable a latch to save the address bits from the AD lines.
• RD: Read. Active low.
• WR: Write. Active low.
• IO/M: This signal specifies whether the operation is a
memory operation (IO/M=0) or an I/O operation
(IO/M=1).
• S1 and S0 : Status signals to specify the kind of
operation being performed .Usually un-used in small
systems.
www.yesnarayanan.blogspot.com
40. Frequency Control Signals
• There are 3 important pins in the frequency control group.
– X0 and X1 are the inputs from the crystal or clock
generating circuit.
• The frequency is internally divided by 2.
– So, to run the microprocessor at 3 MHz, a clock
running at 6 MHz should be connected to the X0
and X1 pins.
– CLK (OUT): An output clock pin to drive the clock of the
rest of the system.
• We will discuss the rest of the control signals as we get to them.
41. Microprocessor Communication and Bus Timing
• To understand how the microprocessor operates and uses these
different signals, we should study the process of communication
between the microprocessor and memory during a memory read
or write operation.
• Lets look at timing and the data flow of an instruction fetch
operation. (Example 3.1)
42. Steps For Fetching an
Instruction
• Lets assume that we are trying to fetch the instruction at memory
location 2005. That means that the program counter is now set
to that value.
– The following is the sequence of operations:
• The program counter places the address value on the
address bus and the controller issues a RD signal.
• The memory’s address decoder gets the value and
determines which memory location is being accessed.
• The value in the memory location is placed on the data
bus.
• The value on the data bus is read into the instruction
decoder inside the microprocessor.
• After decoding the instruction, the control unit issues the
proper control signals to perform the operation.
43. Timing Signals For Fetching an Instruction
• Now, lets look at the exact timing of this sequence of events as that
is extremely important. (figure 3.3)
– At T1 , the high order 8 address bits (20H) are placed on the
address lines A8 – A15 and the low order bits are placed on
AD7–AD0. The ALE signal goes high to indicate that AD0 –
AD8 are carrying an address. At exactly the same time, the
IO/M signal goes low to indicate a memory operation.
– At the beginning of the T2 cycle, the low order 8 address bits
are removed from AD7– AD0 and the controller sends the Read
(RD) signal to the memory. The signal remains low (active) for
two clock periods to allow for slow devices. During T2 , memory
places the data from the memory location on the lines AD7–
AD0 .
– During T3 the RD signal is Disabled (goes high). This turns off
the output Tri-state buffers in the memory. That makes the
AD7– AD0 lines go to high impedence mode.
44. Demultiplexing AD7-AD0
– From the above description, it becomes obvious that the
AD7– AD0 lines are serving a dual purpose and that
they need to be demultiplexed to get all the information.
– The high order bits of the address remain on the bus
for three clock periods. However, the low order bits
remain for only one clock period and they would be lost
if they are not saved externally. Also, notice that the
low order bits of the address disappear when they are
needed most.
– To make sure we have the entire address for the full
three clock cycles, we will use an external latch to save
the value of AD7– AD0 when it is carrying the address
bits. We use the ALE signal to enable this latch.
45. Demultiplexing AD7-AD0
A15-A8
AD7-AD0 Latch
A7- A0
D7- D0
8085
ALE
– Given that ALE operates as a pulse during T1,
we will be able to latch the address. Then
when ALE goes low, the address is saved and
the AD7– AD0 lines can be used for their
purpose as the bi-directional data lines.
46. Cycles and States
• From the above discussion, we can define terms that will become
handy later on:
– T- State: One subdivision of an operation. A T-state lasts for
one clock period.
• An instruction’s execution length is usually measured in
a number of T-states. (clock cycles).
– Machine Cycle: The time required to complete one operation
of accessing memory, I/O, or acknowledging an external
request.
• This cycle may consist of 3 to 6 T-states.
– Instruction Cycle: The time required to complete the
execution of an instruction.
• In the 8085, an instruction cycle may consist of 1 to 6
machine cycles.
47. Generating Control Signals
• The 8085 generates a single RD signal. However, the signal
needs to be used with both memory and I/O. So, it must be
combined with the IO/M signal to generate different control
signals for the memory and I/O.
– Keeping in mind the operation of the IO/M signal we can
use the following circuitry to generate the right set of
signals:
48. A closer look at the 8085
Architecture
• Previously we discussed the 8085 from a
programmer’s perspective.
• Now, lets look at some of its features
with more detail.
49. The ALU
• In addition to the arithmetic & logic circuits, the ALU
includes the accumulator, which is part of every
arithmetic & logic operation.
• Also, the ALU includes a temporary register used for
holding data temporarily during the execution of the
operation. This temporary register is not accessible by
the programmer.
50. The Flags register
– There is also the flags register whose bits are affected by the arithmetic &
logic operations.
• S-sign flag
– The sign flag is set if bit D7 of the accumulator is set after an
arithmetic or logic operation.
• Z-zero flag
– Set if the result of the ALU operation is 0. Otherwise is reset. This
flag is affected by operations on the accumulator as well as other
registers. (DCR B).
• AC-Auxiliary Carry
– This flag is set when a carry is generated from bit D3 and passed
to D4 . This flag is used only internally for BCD operations.
(Section 10.5 describes BCD addition including the DAA
instruction).
• P-Parity flag
– After an ALU operation if the result has an even # of 1’s the p-flag
is set. Otherwise it is cleared. So, the flag can be used to
indicate even parity.
• CY-carry flag
– Discussed earlier
51. More on the 8085 machine
cycles
• The 8085 executes several types of instructions with
each requiring a different number of operations of
different types. However, the operations can be
grouped into a small set.
• The three main types are:
• Memory Read and Write.
• I/O Read and Write.
• Request Acknowledge.
• These can be further divided into various operations
(machine cycles).
52. Opcode Fetch Machine Cycle
• The first step of executing any instruction is the Opcode fetch
cycle.
– In this cycle, the microprocessor brings in the instruction’s
Opcode from memory.
• To differentiate this machine cycle from the very similar
“memory read” cycle, the control & status signals are set
as follows:
– IO/M=0, s0 and s1 are both 1.
– This machine cycle has four T-states.
• The 8085 uses the first 3 T-states to fetch the opcode.
• T4 is used to decode and execute it.
– It is also possible for an instruction to have 6 T-states in an
opcode fetch machine cycle.
53. Memory Read Machine Cycle
• The memory read machine cycle is
exactly the same as the opcode fetch
except:
– It only has 3 T-states
– The s0 signal is set to 0 instead.
54. The Memory Read Machine
Cycle
– To understand the memory read machine cycle, let’s study
the execution of the following instruction:
• MVI A, 32
– In memory, this instruction looks like:
2000H
2001H
3E
32
• The first byte 3EH represents the opcode for loading a
byte into the accumulator (MVI A), the second byte is the
data to be loaded.
– The 8085 needs to read these two bytes from memory before
it can execute the instruction. Therefore, it will need at least
two machine cycles.
– The first machine cycle is the opcode fetch discussed
earlier.
– The second machine cycle is the Memory Read Cycle.
– Figure 3.10 page 83.
55. Machine Cycles vs. Number of bytes in the instruction
• Machine cycles and instruction length, do not
have a direct relationship.
– To illustrate lets look at the machine cycles
needed to execute the following instruction.
• STA 2065H
• This is a 3-byte instruction requiring 4 machine cycles and 13
T-states.
• The machine code will be stored
in memory as shown to the right
• This instruction requires the following 4 machine cycles:
2010H
2011H
2012H
32H
65H
20H
– Opcode fetch to fetch the opcode (32H) from location 2010H, decode it and
determine that 2 more bytes are needed (4 T-states).
– Memory read to read the low order byte of the address (65H) (3 T-states).
– Memory read to read the high order byte of the address (20H) (3 T-states).
– A memory write to write the contents of the accumulator into the memory
location.
56. The Memory Write Operation
• In a memory write operation:
– The 8085 places the address (2065H) on
the address bus
– Identifies the operation as a memory write
(IO/M=0, s1=0, s0=1).
– Places the contents of the accumulator on
the data bus and asserts the signal WR.
– During the last T-state, the contents of the
data bus are saved into the memory
location.
57. Memory interfacing
• There needs to be a lot of interaction between the
microprocessor and the memory for the exchange of
information during program execution.
– Memory has its requirements on control signals
and their timing.
– The microprocessor has its requirements as well.
• The interfacing operation is simply the matching of
these requirements.
58. Memory structure & its requirements
Address
Lines
ROM
Date
Lines
Data Lines
• The process of interfacing the above two chips is the
same.
– However, the ROM does not have a WR signal.
CS
Output Buffer RD
Address
Lines
Data Lines
CS
Output Buffer RD
RAM
Input Buffer WR
59. Interfacing Memory
– Accessing memory can be summarized into the following
three steps:
– Select the chip.
– Identify the memory register.
– Enable the appropriate buffer.
– Translating this to microprocessor domain:
– The microprocessor places a 16-bit address on the
address bus.
– Part of the address bus will select the chip and the
other part will go through the address decoder to
select the register.
– The signals IO/M and RD combined indicate that a
memory read operation is in progress. The MEMR
signal can be used to enable the RD line on the
memory chip.
60. Address decoding
• The result of address decoding is the identification of
a register for a given address.
– A large part of the address bus is usually
connected directly to the address inputs of the
memory chip.
– This portion is decoded internally within the chip.
– What concerns us is the other part that must be
decoded externally to select the chip.
– This can be done either using logic gates or a
decoder.
61. The Overall Picture
• Putting all of the concepts together, we
get:
A15-A8
AD7-AD0 Latch
A7- A0
D7- D0
8085
ALE
WR RD IO/M
CS
1K Byte
Memory
Chip
RD WR
A15- A10
A9- A0
Chip Selection
Circuit