The Address and Data Busses in 8085 Microprocessor

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.



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.



Demultiplexing the Bus AD7 – AD0, Demultiplexing AD7-AD0,The Address and Data Busses






– 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.

Demultiplexing the Bus AD7 – AD0

• The high order address is placed on the address bus and hold for 3 clk periods, 
• The low order address is lost after the first clk period, this address needs to be hold however we need to use latch
• The address AD7 – AD0 is connected as inputs to the latch 74LS373. 
• The ALE signal is connected to the enable (G) pin of the latch and the OC – Output control – of the latch is grounded.

The Overall Picture

Demultiplexing the Bus AD7 – AD0, Demultiplexing AD7-AD0,The Address and Data Busses




Draw 8085 register based structure microprocessor & define the registers.

Accumulator register:
The accumulator register is an 8bit register that is a part of the arithmetic/

Logic unit (ALU):
This register used to store 8-bit data and in performing arithmetic and logical

Draw 8085 register based structure microprocessor & define the  registers.



Operations:

Flag register: 
The ALU includes five flip-flops that are set or reset according to data conditions in the

accumulator and other registers. There are five different types of data conditions:

1. Zero flag

2. Carry flag

3. Sign flag

4. Parity flag

5. Auxiliary carry flag.

Stack Pointer: 
The stack pointer is a 16-bit register used as a memory pointer, it points to a memory

location in read or write memory.

Program Counter: 
This 16-bit register is a memory pointer. Memory location has 16-bit address and

that is why this a 16-bit register.

Flag Register In Microprocessor

– 8 bit register
– shows the status of the microprocessor before/after an operation
– S (sign flag), Z (zero flag), AC (auxillary carry flag), P (parity flag) & CY (carry flag)
Flag Register In Microprocessor
Flag Register In Microprocessor



Sign Flag:
• Used for indicating the sign of the data in the accumulator
• The sign flag is set if negative (1 – negative)
• The sign flag is reset if positive (0 –positive)

Zero Flag:
 – Is set if result obtained after an operation is 0
 – Is set following an increment or decrement operation of that register

Zero Flag
Zero Flag


 Carry Flag:
– Is set if there is a carry or borrow from arithmetic operation            

Carry Flag:
Carry Flag:

Auxiliary Carry Flag: – Is set if there is a carry out of bit 3

Parity Flag:
– Is set if parity is even
– Is cleared if parity is odd                      







The ALU & The Registers

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.


The Registers:

– General Purpose Registers
• B, C, D, E, H & L (8 bit registers)
• Can be used singly
• Or can be used as 16 bit register pairs

– BC, DE, HL
• H & L can be used as a data pointer (holds memory address)
– Special Purpose Registers

• Accumulator (8 bit register)
– Store 8 bit data
– Store the result of an operation
– Store 8 bit data during I/O transfer

The Registers
The Registers



Architecture of Intel 8085 Microprocessor

Intel 8085 Microprocessor

• Microprocessor consists of:

Control unit: control microprocessor operations.
ALU: performs data processing function.
Registers: provide storage internal to CPU.
– Interrupts
– Internal data bus
Architecture of Intel 8085 Microprocessor
Architecture of Intel 8085 Microprocessor

Assembly Language

Assembly Language

• Entering the instructions using hexadecimal is quite easier than entering the binary combinations.

– However, it still is difficult to understand what a program written in hexadecimal does.
– So, each company defines a symbolic code for the instructions.
– These codes are called “mnemonics”.
– The mnemonic for each instruction is usually a group of letters that suggest the operation performed.

• Using the same example from before,

– 00111100 translates to 3C in hexadecimal (OPCODE)
– Its mnemonic is: “INR A”.
– INR stands for “increment register” and A is short for accumulator.

• Another example is: 1000 0000,

– Which translates to 80 in hexadecimal.
– Its mnemonic is “ADD B”.
– “Add register B to the accumulator and keep the result in the accumulator”.

• It is important to remember that a machine language and its associated assembly language are completely machine dependent.

– In other words, they are not transferable from one microprocessor to a different one.

• For example, Motorolla has an 8-bit microprocessor called the 6800.

– The 8085 machine language is very different from that of the 6800. So is the assembly language.
– A program written for the 8085 cannot be executed on the 6800 and vice versa.




“Assembling” The Program:

• How does assembly language get translated into machine language?

– There are two ways:
– 1st there is “hand assembly”.

• The programmer translates each assembly language instruction into its equivalent hexadecimal code (machine language). Then the hexadecimal code is entered into memory.

– The other possibility is a program called an “assembler”, which does the translation automatically.


The 8085 Machine Language

The 8085 Machine Language

The 8085 Machine Language:

• The 8085 (from Intel) is an 8-bit microprocessor. – The 8085 uses a total of 246 bit patterns to form its instruction set. – These 246 patterns represent only 74 instructions. 
• The reason for the difference is that some (actually most) instructions have multiple different formats. – Because it is very difficult to enter the bit patterns correctly, they are usually entered in hexadecimal instead of binary. 
• For example, the combination 0011 1100 which translates into “increment the number in the register called the accumulator”, is usually entered as 3C.
Machine Language

Machine Language

                                                 Machine Language:


• The number of bits that form the “word” of a microprocessor is fixed for that particular processor. – These bits define a maximum number of combinations.
• For example an 8-bit microprocessor can have at most 28 = 256 different combinations.
• However, in most microprocessors, not all of these combinations are used. – Certain patterns are chosen and assigned specific meanings. – Each of these patterns forms an instruction for the microprocessor. – The complete set of patterns makes up the microprocessor’s machine language.
The Three Cycle Instruction Execution Model

The Three Cycle Instruction Execution Model

• To execute a program, the microprocessor “reads” each instruction from memory, “interprets” it, then “executes” it.
• To use the right names for the cycles: – The microprocessor fetches each instruction, – decodes it, – Then executes it.
• This sequence is continued until all instructions are performed.

Memory Map and Addresses

                           Memory Map and Addresses



Memory Map and Addresses
Memory Map and Addresses



 The memory map is a picture representation of the address range and shows where the different memory chips are located within the address range.

Organization of a Microprocessor Based System

Let’s expand the picture a bit
Organization of a Microprocessor Based System
Memory

• Memory stores information such as instructions and data in binary format (0 and 1). It provides this information to the microprocessor whenever it is needed.
• Usually, there is a memory “sub-system” in a microprocessor-based system. This sub-system includes: – The registers inside the microprocessor – Read Only Memory (ROM)
• used to store information that does not change. – Random Access Memory (RAM) (also known as Read/Write Memory).
• used to store information supplied by the user. Such as programs and data.
• To execute a program: – the user enters its instructions in binary format into the memory. – The microprocessor then reads these instructions and whatever data is needed from memory, executes the instructions and places the results either in memory or produces it on an output device.

Definition of the Microprocessor

Definition of the Microprocessor

Microprocessor:
The microprocessor is a programmable device that takes in numbers, performs on them arithmetic or logical operations according to the program stored in memory and then produces other numbers as a result.

Programmable device:
The microprocessor can perform different sets of operations on the data it receives depending on the sequence of instructions supplied in the given program. By changing the program, the microprocessor manipulates the data in different ways.

Instructions: 
Each microprocessor is designed to execute a specific group of operations. This group of operations is called an instruction set. This instruction set defines what the microprocessor can and cannot do.

Takes in: 
The data that the microprocessor manipulates must come from somewhere.
• It comes from what is called “input devices”.
• These are devices that bring data into the system from the outside world.
• These represent devices such as a keyboard, a mouse, switches, and the like.

Numbers:
The microprocessor has a very narrow view on life. It only understands binary numbers. A binary digit is called a bit (which comes from binary digit). The microprocessor recognizes and processes a group of bits together. This group of bits is called a “word”. The number of bits in a Microprocessor’s word, is a measure of its “abilities”.

Words, Bytes, etc:
 • The earliest microprocessor (the Intel 8088 and Motorola’s 6800) recognized 8-bit words.
 – They processed information 8-bits at a time. That’s why they are called “8-bit processors”. They can handle large numbers, but in order to process  these numbers, they broke them into 8-bit pieces and processed each group of 8-bits separately.
• Later microprocessors (8086 and 68000) were designed with 16-bit words.

 – A group of 8-bits were referred to as a “half-word” or “byte”.
 – A group of 4 bits is called a “nibble”.
 – Also, 32 bit groups were given the name “long word”.
• Today, all processors manipulate at least 32 bits at a time and there exists microprocessors that can process 64, 80, 128 bits

Arithmetic and Logic Operations:
• Every microprocessor has arithmetic operations such as add and subtract as part of its instruction set.
 – Most microprocessors will have operations such as multiply and divide.
– Some of the newer ones will have complex operations such as square root.

• In addition, microprocessors have logic operations as well. Such as AND, OR, XOR, shift left, shift right, etc.
• Again, the number and types of operations define the microprocessor’s instruction set and depends on the specific microprocessor.

Stored in memory : 
• First, what is memory?

 – Memory is the location where information is kept while not in current use.
 – Memory is a collection of storage devices. Usually, each storage device holds one bit. Also, in most kinds of memory, these storage devices are grouped into groups of 8. These 8 storage locations can only be accessed together. So, one can only read or write in terms of bytes to and form memory.
 – Memory is usually measured by the number of bytes it can hold. It is measured in Kilos, Megas and lately Gigas. A Kilo in computer language is 210 =1024. So, a KB (KiloByte) is 1024 bytes. Mega is 1024 Kilos and Giga is 1024 Mega.

Stored in memory: 
• When a program is entered into a computer, it is stored in memory. Then as the microprocessor starts to execute the instructions, it brings the instructions from memory one at a time.
• Memory is also used to hold the data.

– The microprocessor reads (brings in) the data from memory when it needs it and writes (stores) the results into memory when it is done.

Produces:
For the user to see the result of the execution of the program, the results must be presented in a human readable form.
• The results must be presented on an output device.
• This can be the monitor, a paper from the printer, a simple LED or many other forms.

What is a Microprocessor?

What is a Microprocessor?

The word comes from the combination micro and processor.

Processor means a device that processes whatever. In this context processor means a device that processes numbers, specifically binary numbers, 0’s and 1’s.
To process means to manipulate. It is a general term that describes all manipulation. Again in this content, it means to perform certain operations on the numbers that depend on the microprocessor’s design.
Differences between Microprocessor, Microcomputer and Microcontroller

Differences between Microprocessor, Microcomputer and Microcontroller

Differences between Microprocessor, Microcomputer and Microcontroller:

Microcomputer – a computer with a microprocessor as its CPU. Includes memory, I/O etc.

Microprocessor – silicon chip which includes ALU, register circuits & control circuits

Microcontroller – silicon chip which includes microprocessor, memory & I/O in a single package.