Communication and Bus Timing
Communication and Bus Timing
Microprocessor
Architecture and Memory
Interfacing
Memory Interfacing
ECE 3010
FCST-MIIT Microprocessor Architecture and Its
Operations
Microprocessor-initiated operations
Internal operations
Microprocessor-Initiated Operation
FCST-MIIT
System Bus
ECE 3010
FCST-MIIT
Major Operations
The 8-bit 8085 CPU (or MPU – Micro Processing Unit) communicates with the
other units using :
a 16-bit address bus,
an 8-bit data bus and
a control bus.
FCST-MIIT
8
ECE 3010
The 8085 System Bus
Address Bus
FCST-MIIT
10
Control Bus
Consists of various lines carrying the control signals such as read /
write enable, flag bits.
ECE 3010
FCST-MIIT
8085 Address Bus
Reset Z X X
ECE 3010
FCST-MIIT
8085 Control and Status Signals
(Output 3state)
READ indicates the selected memory or 1/0 device is to be read and that the
Data Bus is available for the data transfer.
(Output 3state)
WRITE indicates the data on the Data Bus is to be written into the selected
memory or 1/0 location.
Data is set up at the trailing edge of WR. 3 stated during Hold and Halt modes.
IO/ (Output)
IO/𝑀 indicates whether the Read/Write is to memory or l/O Tristated during
Hold and Halt modes.
ECE 3010
Example: Memory Read Operation
FCST-MIIT
15
ECE 3010
FCST-MIIT
17 Sequence the execution of instructions
Store temporary data in RAM during execution
ECE 3010
The 8085: CPU Internal Structure
FCST-MIIT
18
2001 78
2002 MVI A,F2H 3E
2003 F2
2004 ADD B 80
2005 HLT 76
ECE 3010
FCST-MIIT Internal Data Operation
1. The PC is a 16-bit register that perform the fourth operation in the list sequencing the execution of the instructions.
• Places the address 2000H on the address bus, and increments the address in the PC to 2001 for the next operation
• Brings the code 06H, interprets the code, places the address 2001H on the address bus and then gets byte 78H and
increments the address in PC to 2002H.
2. When the processor executes the first two instructions, it uses register B to store 78H and A to store F2 H in binary
(Operation 1)
3. When the processor executes the instruction ADD B in the ALU(Operation 2), it adds 78 H to F2H, resulting in the
sum 16AH. It replace F2H by 6AH in A and sets the Carry flag as described next.
4. The addition operation generates a carry because the sum is larger than the size of the accumulator (8 bits). To
indicate the carry, the processor sets the flip-flop called CY flag to 1
Interrupt:
The microprocessor can be interrupted form the normal execution of
instructions and asked to execute some other instructions called a
service routine (for example, emergency procedure).
The microprocessor resumes its operation after completing the service
routine.
ECE 3010
FCST-MIIT Peripheral or Externally Initiated Operations
Ready:
The 8085 has a pin called READY.
If the signal at this READY pin is low, the microprocessor enters into a
Wait state.
This signal is used primarily to synchronize slower peripherals with the
microprocessor.
Hold:
When the HOLD pin is activated by an external signal, the microprocessor
relinquishes control of buses and allows the external peripheral to use
them.
For example, the HOLD signal is used in Direct Memory Access (DMA)
data transfer.
ECE 3010
Example: Instruction Fetch Operation
Program counter puts the 16-bit memory address of the instruction on the address
bus
Control unit sends the Memory Read Enable signal to access the memory
FCST-MIIT
24
The 8-bit instruction stored in memory is placed on the data bus and transferred to
the instruction decoder
Instruction is decoded and executed
ECE 3010
Memory Chip
FCST-MIIT
Flip-Flop or Latch as a Storage Element
Memory Map and Address
Memory Address Range of a chip
Memory Address Lines
Memory Word Size
Memory Classification
ECE 3010
FCST-MIIT
Memory
I3 I2 I1 I0
𝑊𝑅
𝑊𝑅 Input Buffer EN 4-bit Register
𝑅𝐷
Register
EN
Output
𝑅𝐷 Buffer
O3 O2 O1 O0
ECE 3010
4-to-8 Bit Register
FCST-MIIT
No. of register=2n , n= no. of line
I7 I6 I5 I4 I3 I2 I1 I0
A0
4x4 4x4
A1
Output Output
𝑅𝐷 Buffer Buffer
O7 O6 O5 O4 O3 O2 O 1 O0
ECE 3010
FCST-MIIT
Two Memory Chips with Four Registers Each
and Chip Select
A2
A0 A0
𝑫𝒆𝒄𝒐𝒅𝒆𝒓 𝑪𝑺 𝑹𝑫 𝑾𝑹 𝑫𝒆𝒄𝒐𝒅𝒆𝒓 𝑪𝑺 𝑹𝑫 𝑾𝑹
A1 M1 A1 M1
1 11 R3 0 11 R3
1 10 R2 0 10 R2
1 01 R1 0 01 R1
1 00 R0 0 00 R0
ECE 3010
FCST-MIIT
Memory Map and Addresses
The microprocessor with its 16 address line is capable of identifying or addressing 65,536
(64K) such memory register or locations and the microprocessor with its 20 address line is
capable of addressing 1,048,576 (1Mbyte) memory location.
The size of this chip can be specified either as 8 byte, 8x8 bit or 64 bit.
A memory chip with 256 register (or location) with 4 I/O lines is specified as 256x4 bit or 1024
bit, for an 8-bit mp, two such memory chips (256 x 4) would be necessary to form the 8 bit
memory word size, resulting 256 bytes of memory.
Illustration the memory map of the chip with 256 Showing how the memory map can be changed by
bytes of memory modifying the hardware of the chip select (C̅S̅) line
ECE 3010
FCST-MIIT
Change Memory Map
It has eight address lines, one chip select (C̅S̅) line (active low) and read/write
( ÚW̅ ) line.
The 8 address lines (A7-A0) of the microprocessors are required to identify
256 (28 ) memory registers.
Eight other addresses lines (A15-A8) are connected to the chip select (C̅S̅)
line through inverters and NAND gate.
The entire range of the memory addresses from 0000 to 00FF is known as the
memory map of the chip
The memory map of the chip (fig: changed) range from 8000H to 80FF H.
ECE 3010
FCST-MIIT Memory Classification
combinations
x: Address lines
Calculate the address lines required for an 8K-byte (1024 x 8=8192 registers)
memory chip.
Number of address line x= log 8192/log 2=13 address lines
ECE 3010
FCST-MIIT
Memory Word Size
Various word sizes (1, 4, and 8)
The size of memory chip is generally specified in terms of the total
number of bits it can store.
Absolute Decoding
The decoding in which all available address line (16 lines in
memory mapped and 8 lines in peripheral mapping) are used for
decoding to generate a unquie address is called absolute
decoding.
ECE 3010
FCST-MIIT
Absolute vs Partial Address
Absolute Decoding Partial Decoding
Cons • Increased hardware and cost • Unutilized space & fold back (multiple
• Speed is less due to increased mapping)
delay • Bus contention
• Different future expansion
ECE 3010
FCST-MIIT
Address Decoding
ECE 3010
FCST-MIIT Address Decoding
ECE 3010
FCST-MIIT
ECE 3010
FCST-MIIT
ECE 3010
Microprocessor Communication
FCST-MIIT
and Bus Timing
Instruction Cycle
Machine Cycle
T states
ECE 3010
FCST-MIIT
Instruction Fetch
The primary function of memory is to store instructions and
data and to provide that information to the MPU whenever the
MPU requests it.
Example:
The instruction code 0100 1111 (4FH) is stored in memory
location 2005H. Illustrate the data flow and list the sequence of
events when the instruction code is fetched by the MPU
ECE 3010
Example: Instruction Fetch Operation
FCST-MIIT
53
ECE 3010
FCST-MIIT
Instruction Fetch Operation
1. The program counter places the 16 bit address 2005H on the address bus
2. The control unit sends the Memory Read control signal (active low) to
enable the output buffer of the memory chip.
3. The instruction (4F) stored in the memory location is placed on the data
bus and transferred to the instruction decoder of the microprocessor.
FCST-MIIT
55
ECE 3010
FCST-MIIT
Communication and Bus Timing
Shipping Company
1. A courier gets the address from the office; he or she drives the pickup van, finds the street, and
3. Somebody in the house opens the door and gives the package to the courier, and the courier returns
4. The internal office staff disposes the package according to the instructions given by the customer.
ECE 3010
FCST-MIIT Communication and Bus Timing
Illustrate the steps and the timing of data flow when the
instruction code (0111 1000) (78H _MOV A, B) stored in location
A000 H, is being fetched.
Memory Instruction
A000h MOV A, B
ECE 3010
FCST-MIIT Timing Diagram
Representation of Various Control signals generated during
Execution of an Instruction.
Instruction:
MVI A, 45H is stored in the
memory content of address:
A000H
Address Content
A000H 3E
A001H 45
ECE 3010
FCST-MIIT
Memory Read Machine Cycle
Address Content
A000H 21
A001H 45
A002H F0
ECE 3010
FCST-MIIT
Memory Read Machine Cycle
Address Content
A000H 7E
ECE 3010
FCST-MIIT
Memory Write Machine Cycle
Address Content
A000H 77
ECE 3010
FCST-MIIT
Demultiplexing the Bus
ECE 3010
FCST-MIIT Instruction Cycle, Machine Cycle & T-State
Time required to execute and fetch an entire instruction is called instruction cycle. It
consists:
Fetch cycle – The next instruction is fetched by the address stored in program counter (PC)
and then stored in the instruction register.
Decode instruction – Decoder interprets the encoded instruction from instruction register.
Reading effective address – The address given in instruction is read from main memory
and required data is fetched. The effective address depends on direct addressing mode or
indirect addressing mode.
Execution cycle – consists memory read (MR), memory write (MW), input output read
(IOR) and input output write (IOW)
The time required by the microprocessor to complete an operation of accessing
memory or input/output devices is called machine cycle.
One time period of frequency of microprocessor is called t-state. A t-state is measured
from the falling edge of one clock pulse to the falling edge of the next clock pulse.
FCST-MIIT
Input and Output (I/O) Devices
The eight address lines can have 256 address (28 combinations)
MPU can identify 256 input devices and 256 output devices with address range (00H~FFH)
The input and output devices are differentiated by the control signals:
MPU uses the I/O Read Control Signal for input devices
MPU uses the I/O Write Control Signal for output devices
In bus architecture, the devices (such as LED/Swithes )cannot be directly connected to the data bus or the
address bus
All connections must be made through tri-state interfacing devices so they will be enabled and connected to the
buses only when the MPU choose to communicate with them
ECE 3010
FCST-MIIT
Memory-Mapped I/O
72
FCST-MIIT
ECE 3010
FCST-MIIT 8085 Pin Description
Single + 5V Supply
4 Vectored Interrupts (One is Non Maskable)
Serial In/Serial Out Port
Decimal, Binary, and Double Precision Arithmetic
Direct Addressing Capability to 64K bytes of memory
The Intel 8085A is a new generation, complete 8 bit parallel
central processing unit (CPU).
The 8085A uses a multiplexed data bus. The address is split
between the 8bit address bus and the 8bit data bus.
ECE 3010
FCST-MIIT
8085 Pins
RD (Output 3state)
READ; indicates the selected memory or 1/0 device is to
be read and that the Data Bus is available for the data
transfer.
WR (Output 3state)
WRITE; indicates the data on the Data Bus is to be written
into the selected memory or 1/0 location.
Data is set up at the trailing edge of WR. 3stated during
Hold and Halt modes.
ECE 3010
FCST-MIIT
8085 Pins
READY (Input)
If Ready is high during a read or write cycle, it indicates that the memory or peripheral is ready to
send or receive data.
If Ready is low, the CPU will wait for Ready to go high before completing the read or write cycle.
HOLD (Input)
HOLD; indicates that another Master is requesting the use of the Address and Data Buses.
The CPU, upon receiving the Hold request. will relinquish 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 3stated.
ECE 3010
FCST-MIIT
8085 Pins
HLDA (Output)
HOLD ACKNOWLEDGE; indicates that the CPU has received the Hold request
and that it will relinquish the buses in the next clock cycle.
HLDA goes low after the Hold request is removed. The CPU takes the buses one
half clock cycle after HLDA goes low.
INTR (Input)
INTERRUPT REQUEST; is used as a general purpose interrupt.
It is sampled only during the next to the last clock cycle of the instruction.
If it is active, the Program Counter (PC) will be inhibited 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.
ECE 3010
FCST-MIIT
8085 Pins
INTA (Output)
INTERRUPT ACKNOWLEDGE; is used instead of (and has the same timing as) RD during
the Instruction cycle after an INTR is accepted. It can be used to activate the 8259
Interrupt chip or some other interrupt port.
RST 5.5
RST 6.5 - (Inputs)
RST 7.5
RESTART INTERRUPTS; These three inputs have the same timing as I NTR except they
cause an internal RESTART to be automatically inserted.
RST 7.5 ~~ Highest Priority
RST 6.5
RST 5.5 o Lowest Priority
The priority of these interrupts is ordered as shown above. These interrupts have a higher
priority than the INTR.
ECE 3010
FCST-MIIT
8085 Pins
TRAP (Input)
Trap interrupt is a nonmaskable restart interrupt.
It is recognized at the same time as INTR. It is unaffected by any mask
or Interrupt Enable.
It has the highest priority of any interrupt.
RESET IN (Input)
Reset sets the Program Counter to zero and resets the Interrupt
Enable and HLDA flipflops.
None of the other flags or registers (except the instruction register) are
affected
The CPU is held in the reset condition as long as Reset is applied.
ECE 3010
FCST-MIIT
8085 Pins
IO/M (Output)
IO/M indicates whether the Read/Write is to memory or l/O
Tristated during Hold and Halt modes.
SID (Input)
Serial input data line The data on this line is loaded into
accumulator bit 7 whenever a RIM instruction is executed.
SOD (output)
Serial output data line. The output SOD is set or reset as
specified by the SIM instruction. Vcc +5 volt supply. Vss
Ground Reference