Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Understanding the Microprocessor's Function: ALU, Control Unit, Memory, Input & Output, Lecture notes of Architecture

An overview of a digital computer, focusing on the functions of its arithmetic and logic unit (ALU), control unit, memory, input unit, and output unit. Students will be able to draw the block diagram of a simple computer, understand the function of each unit, and learn about microprocessor typical addressing modes and instructions.

What you will learn

  • How does the control unit fetch instructions from memory?
  • How does the microprocessor communicate with peripherals?
  • What is the role of the input unit in a digital computer?
  • What is the function of the arithmetic and logic unit (ALU) in a digital computer?
  • What is the difference between data transfer instructions and arithmetic instructions in a microprocessor?

Typology: Lecture notes

2021/2022

Uploaded on 08/05/2022

nguyen_99
nguyen_99 🇻🇳

4.2

(80)

1K documents

1 / 22

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Unit 8 : Microprocessor Architecture
Lesson 1 : Microcomputer Structure
1.1. Learning Objectives
On completion of this lesson you will be able to :
draw the block diagram of a simple computer
understand the function of different units of a microcomputer
learn the basic operation of microcomputer bus system.
1.2. Digital Computer
A digital computer is a multipurpose, programmable machine that reads
binary instructions from its memory, accepts binary data as input and
processes data according to those instructions, and provides results as
output.
1.3. Basic Computer System Organization
Every computer contains five essential parts or units. They are
i. the arithmetic logic unit (ALU)
ii. the control unit
iii. the memory unit
iv. the input unit
v. the output unit.
1.3.1. The Arithmetic and Logic Unit (ALU)
The arithmetic and logic unit (ALU) is that part of the computer that
actually performs arithmetic and logical operations on data. All other
elements of the computer system - control unit, register, memory, I/O -
are there mainly to bring data into the ALU to process and then to take
the results back out.
An arithmetic and logic unit and, indeed, all electronic components in
the computer are based on the use of simple digital logic devices that can
store binary digits and perform simple Boolean logic operations. Data
are presented to the ALU in registers. These registers are temporary
storage locations within the CPU that are connected by signal paths of
the ALU.
A digital computer is a
multipurpose, programmable
machine.
Basic computer system
organization.
The arithmetic and logic
unit (ALU) is that part of
the computer that actually
performs arithmetic and
logical operations on data.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download Understanding the Microprocessor's Function: ALU, Control Unit, Memory, Input & Output and more Lecture notes Architecture in PDF only on Docsity!

Unit 8 : Microprocessor Architecture

Lesson 1 : Microcomputer Structure

1.1. Learning Objectives

On completion of this lesson you will be able to :

♦ draw the block diagram of a simple computer ♦ understand the function of different units of a microcomputer ♦ learn the basic operation of microcomputer bus system.

1.2. Digital Computer

A digital computer is a multipurpose, programmable machine that reads binary instructions from its memory, accepts binary data as input and processes data according to those instructions, and provides results as output.

1.3. Basic Computer System Organization

Every computer contains five essential parts or units. They are

i. the arithmetic logic unit (ALU) ii. the control unit iii. the memory unit iv. the input unit v. the output unit.

1.3.1. The Arithmetic and Logic Unit (ALU)

The arithmetic and logic unit (ALU) is that part of the computer that actually performs arithmetic and logical operations on data. All other elements of the computer system - control unit, register, memory, I/O - are there mainly to bring data into the ALU to process and then to take the results back out.

An arithmetic and logic unit and, indeed, all electronic components in the computer are based on the use of simple digital logic devices that can store binary digits and perform simple Boolean logic operations. Data are presented to the ALU in registers. These registers are temporary storage locations within the CPU that are connected by signal paths of the ALU.

A digital computer is a multipurpose, programmable machine.

Basic computer system organization.

The arithmetic and logic unit (ALU) is that part of the computer that actually performs arithmetic and logical operations on data.

Digital Systems and Computer Organization

The ALU is the area of the computer in which arithmetic and logic operations are performed on data. The type of operation that is to be performed is determined by signals from the control unit. The data that are to be operated on by the ALU can come from either the memory unit or the input unit. Results of operations performed in the ALU can be transferred to either the memory unit for storage or the output unit.

1.3.2. Control Unit

Control unit is like the conductor of an orchestra, who is responsible for keeping each of the orchestra members in proper synchronization. This unit contains logic and timing circuits that generate the proper signals necessary to execute each instruction in a program.

The control unit fetches an instruction from memory by sending an address and read command. The instruction word stored at the memory location is then transferred to the control unit. This instruction word, which is in some form of binary code, is then decoded by logic circuitry in the control unit to determine which instruction is being called for. The control unit uses this information to send the proper signals to the rest of the units in order to execute the specified operation.

This sequence of fetching an instruction code and then executing the indicated operation is repeated over and over by the control unit.

1.3.3. Memory Unit

The memory section usually consists of a mixture of RAM and ROM. It may also have magnetic floppy disks, magnetic hard disk or laser optical disks, magnetic hard disk or laser optical disks. Memory has two purposes. The first purpose is to store the instructions (Program) that the computer is to perform. The second purpose of the memory is to store the data that are to be operated on by the program. The memory stores these instruction and data as groups of binary digits (words).

Bus

Two different-size arrows are used; the larger arrows represent data or information that actually consists of a relatively large number of parallel lines, and the smaller arrows represent control signals that are normally only one or a few lines. The various arrows are also numbered to allow easy reference to them in the following descriptions. These components are common communication path called a bus.

The control unit fetches an instruction from memory by sending an address and read command.

The memory section usually consists of a mixture of RAM and ROM.

Bus

Digital Systems and Computer Organization

1.3.4. Input Unit

The input unit consists of all of the devices used to take information and data that are external to the computer and put them into the memory unit or the ALU. The control unit determines where the input information is sent. The input unit is used to enter the program and data into the memory unit or into the ALU from an external device during the execution of a program. Some of the common input devices are keyboards, Joysticks, mouse, OCR, OMR etc.

1.3.5. Output Unit

The output unit consists of the devices used to transfer data and information from the computer to the “outside world.” The output devices are directed by the control unit and can receive data from memory or the ALU. Examples of common output devices are printers, disk or tape units, video monitors, and digital-to-analog converters (DACs).

1.3.6. Interfacing

The devices that make up the input and output units are called peripherals because they are external to the rest of the computer. The most important aspect of peripherals involves interfacing. Computer interfacing is specifically defined as transmitting digital information between a computer and its peripherals in a compatible and synchronized way.

Many input/output devices are not directly compatible with the computer because of differences in such characteristics as operating speed, data format (e.g., BCD, ASCII, binary), data transmission mode (e.g., serial, parallel), and logic signal level. Such I/O devices require special interface circuits which allow them to communicate with the control, memory, and ALU portions of the computer system. A common example is the video display terminal (VDT), which can operate both as an input and an output device. The VDT transmits and receives data serially (one bit at a time) while most computers handle data in parallel form. Thus, a VDT requires interface circuitry in order to send data to or receive data from a computer.

Central Processing Unit (CPU)

In the ALU and control units are combined into one unit called the central processing unit (CPU). This is commonly done to separate the actual “brains” of the computer from the other units. In a microcomputer the CPU is usually implemented on a single chip silicon wafer.

Central Processing Unit.

Input Unit Output Unit Interfacing

Microprocessor Architecture

1.4. Exercise

1.4.1. Multiple choice questions

a) VDT stands for

i) Video processing unit ii) Video display terminal iii) Input output terminal iv) all of the above.

b) A digital computer is

i) a programmable machine ii) a digital machine iii) a digital calculator iv) none of the above.

1.4.2. Questions for short answers

a) What is the CPU? b) What is meant by interfacing in a computer system? c) What basic operations occur repeated by in computer?

1.4.3. Analytical questions

a) Name the five basic units of a computer and describe the major functions of each. b) Describe about the computer interfacing.

Microprocessor Architecture

  1. Decoding instructions
  2. Performing arithmetic and logic operations called for by instructions
  3. Responding to I/O generated control signals such as RESET and INTERRUPT.

The MPU contains all of the logic circuitry for performing these functions, but its internal logic is generally not externally accessible. Instead, we can control what happens inside the MPU by the program of instructions that we put in memory for the MPU to execute. This is what makes the MPU so versatile and flexible - when we want to change its operation, we simply change the programs stored in RAM (software) or ROM (firmware) rather than rewire the electronics (hardware).

The microprocessor is a semiconductor device consisting of electronic logic circuits manufactured by using either a large-scale (LSI) or very- large-scale integration (VLSI) technique. The microprocessor is capable of performing computing functions and making decisions to change the sequence of program execution. In large computers, the CPU performs these computing functions and it is implemented on one or more circuit boards. The microprocessor is in may ways similar to the CPU; however, the microprocessor includes all the logic circuitry (including the control unit) on one chip. For clarity, the microprocessor can be divided into three segments, arithmetic/logic unit (ALU), register unit, and control unit.

♦ Arithmetic and Logic Unit : In this area of the microprocessor, computing functions are performed on data. The CPU performs arithmetic operations such as addition and subtraction, and logic operations such as AND, OR, and exclusive OR. Results are stored either in register or in memory or sent to output devices. ♦ Register Unit : This area of the microprocessor consists of various registers. The register are used primarily to store data temporarily during the executing of a program. Some of the registers are accessible to the user through instructions. ♦ Control Unit : The control unit provides the necessary timing and control signals to all the operations in the microcomputer. It controls the flow of data between the microprocessor and peripherals (including memory).

Input

The input section transfers data and instructions in binary from the outside world to the microprocessor. It includes devices such as keyboards, teletypes, and analog-to-digital converters. Typically, a microcomputer includes a keyboard as an input device. The key board has sixteen data keys (o to 9 and A to F) and some additional function keys to perform operations such as storing data and executing programs.

Very-large-scale integration (VLSI)

The input section transfers data and instructions in binary from the outside world to the microprocessor.

Digital Systems and Computer Organization

Output

The output section transfers data from the microprocessor to output devices such as light emitting diodes (LEDs), cathode-ray-tubes (CRTs), printers, magnetic tape, or another computer. Typically, single-board computers include LEDs and seven-segment LEDs as output devices.

Memory

Memory stores binary information such as instructions and data, and provides that information to the microprocessor whenever necessary. To execute programs, the microprocessor reads instructions and data from memory and performs the computing operations in its ALU section. Result are either transferred to the output section for display or stored in memory for later use. The memory block has two sections : Read - Only Memory (ROM) and Read / Write Memory (R/WM), popularly known as Random Access Memory (RAM).

The ROM is used to store programs that do not need alterations. The monitor program of a single - board microcomputer is generally stored in the ROM. Program stored in the ROM can only be read; they cannot be altered.

The Read / Write memory (R/WM) is also known as user memory. It is used to store user programs and data. The information stored in this memory can be read and altered easily.

System Bus

The system bus is a communication path between the microprocessor and the peripherals; it is nothing but a group of wires that carries bits. The microcomputer bus is in many ways similar to a one-track, express subway, the microcomputer bus carries bits between the microprocessor and only one peripheral at a time. The same bus is time - shared to communicate with various peripherals, with the timing provided by the control section of the microprocessor.

The Bus System

The μC has three buses which carry all the information and signals involved in the system operation. These buses connect the microprocessor (CPU) to each of the memory and I/O elements so that and information can flow between the CPU and any of these other elements. The buses involved in all the data transfers have functions that are described as follows.

The output section transfers data from the microprocessor to output devices Output.

The system bus is a communication path between the microprocessor and the peripherals.

Memory stores binary information such as instructions and data, and provides that information to the microprocessor whenever necessary.

The μC has three buses which carry all the information and signals involved in the system operation.

Digital Systems and Computer Organization

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

The microprocessor functions are explained here in relation to the 8085 or 8080A MPU.

2.5. Microprocessor-Initiated Operations and 8085/8080A Bus Organization

The MPU performs primarily four operations.

  1. Memory Read: Reads data from memory.
  2. Memory Write: Writes data into memory.
  3. I/O read: Accepts data from input devices.
  4. I/O Write: Sends data to output devices.

All these operations are part of the communication process between the MPU and peripheral devices (including memory). To communicate with a peripheral (or a memory location), the MPU needs to perform the following steps:

Step 1 : Identify the peripheral or the memory location (with its address). Step 2 : Transfer data Step 3 : Provide timing or synchronization signals.

The 8085/8080A MPU performs these functions using three sets of communication lines called buses : The address bus, the data bus, and the control bus.

The MPU performs primarily four operations.

Microprocessor Architecture

2.5.1. Internal Data Operations and the 8085/8080A Registers

The internal architecture of the 8085/8080A microprocessor determines how and what operations can be performed with the data. These operations are

  1. Store 8-bits data.
  2. Perform arithmetic and logical operations.
  3. Test for conditions.
  4. Sequence the execution of instructions.
  5. Store data temporarily during execution in the defined R/W memory locations called the stack.

To perform these operations, the microprocessor requires registers, an arithmetic logic unit (ALU) and control logic, and internal buses (path for information flow).

Registers

The 8085/8080A has six general - purpose registers to perform the first operation listed above, that is, to store 8-bit data during a program execution. These registers are identified as B, C, E, H, and L. They can be combined as register pairs - BC, DE, and HL - to perform some 16-bit operation.

These registers are programmable, meaning that a programmer can use them to load or transfer data from the registers by using instructions. For example, the instruction MOV B, C transfers the data from register C to register B. Conceptually, the registers can be viewed as memory locations, except they are built inside the microprocessor and identified by specific names. Some microprocessors do not have these types of registers; instead, they use memory space as their registers.

Accumulator

The accumulator is an 8-bit register that is part of the arithmetic logic unit (ALU). This register is used to store 8-bit data and to perform arithmetic and logical operations. The result of an operation is stored in the accumulator. The accumulator is also identified as register A.

Flags

The ALU includes five flip-flops that are set or reset according to data conditions in the accumulator and other registers. The microprocessor uses them to perform the third operation; namely testing for data conditions.

Registers

Internal data operations and the 8085/8080A registers.

Accumulator Flags

Microprocessor Architecture

b) The central processing unit which is the ‘brains’ of the computer is the combination of

i) the ALU and control unit ii) the input unit and ALU iii) the control unit and bus structure iv) the ALU and bus structure.

c) A CPU with 16 address lines can address

i) 16,384 memory locations ii) 32,768 memory locations iii) 64,000 memory locations iv) 65,536 memory locations.

2.6.2. Questions for short answers

a) What is meant by interfacing in a computer system? b) What is the function of central processing unit?

2.6.3. Analytical question

a) Draw the typical structure of a micro computer and show its bus organization

Digital Systems and Computer Organization

Lesson 3 : 8085 Microprocessor Architecture

3.1. Learning Objectives

On completion of this lesson you will be able to :

♦ recognize the functions of various pins of the 8085 microprocessor. ♦ list the various internal units that make up 8085 architecture, and explain their functions decoding and executing an instruction. ♦ draw the block diagram of an 8085 base microcomputer.

3.2. The 8085 MPU

The term Micro Processing Unit (MPU) is similar to the term Central Processing Unit (CPU) used in traditional computers. We define the MPU as a device or a group of devices (as a unit) that can communicate with peripherals, provide timing signals, direct data flow, and perform computing tasks as specified by the instructions in memory. The unit will have the necessary lines for the address bus, the data bus, and the control signals, and would require only a power supply and a crystal (or equivalent frequency - determining components) to be completely functional.

Using this description, the 8085 microprocessor can almost qualify as an MPU, but with the following two limitations.

  1. The low-order address bus of the 8085 microprocessor is multiplexed (time shared) with the data bus. The buses need to be demultiplexed.
  2. Appropriate control signals need to be generated to interface memory and I/O with the 8085. (Intel has some specialized memory and I/O devices that do not require such control signals).

The 8085 Microprocessor

The 8085 is an 8-bit general purpose microprocessor capable of addressing 64K of memory. The device has forty pins, requires a +5 V single power supply, and can operate with a 3-MHz single-phase clock. The 8085 is an enhanced version of predecessor, the 8080A; its instruction set is upward-compatible with that of the 8080A, meaning that the 8085 instruction set includes all the 8080A instructions plus some additional ones. Programs written for the 8080A will be executed by the 8085, but the 8085 and the 8080A are not pin compatible.

We define the MPU as a device or a group of devices (as a unit) that can communicate with peripherals, provide timing signals, direct data flow, and perform computing tasks as specified by the instructions in memory.

The 8085 is an 8-bit general purpose microprocessor capable of addressing 64K of memory.

Digital Systems and Computer Organization

♦ RD - Read : This is a Read control signal (active low). This signal indicates that the selected I/O or memory device is to be read and data are available on the data bus. ♦ WR - Write : This is a Write control signal (active low). This signal indicates that the data on the bus are to be written into a selected memory or I/O location. ♦ IO/M : This is a status signal to differentiate between I/O and memory operations. When it is high, it indicates and I/O Operation; when it is low, it indicates a memory operation. This signal is combined with RD (Read) and WR (Write) to generate I/O and memory control signals. ♦ S 1 and S 0 : There status signals, similar to IO/M, can identify various operations; but they are rarely used in small systems.

Power Supply and Clock Frequency

The power supply and frequency signals are as follows :

♦ VCC : + 5 volt power supply. ♦ VSS : Ground Reference. ♦ X 1 , X 2 : A crystal (or RC, LC network) is connected at these two pins. The frequency is internally divided by two; therefore, to operate a system at 3 MHz, the crystal should have frequency of 6 MHz. ♦ CLK (OUT) - Clock Output : This signal can be used as the system clock for other devices.

Interrupts and Externally Initiated Operations

The 8085 has five interrupt signals that can be used to interrupt a program execution. Once of the signals, INTR (Interrupt Request), is identical to the 8080A microprocessor interrupt signal (INT); the others are enhancements to the 8080A. The microprocessor acknowledges an interrupt by the INTA (Interrupt Acknowledge) signal.

In addition to the interrupts, three pins - RESET, HOLD, and READY - accept the externally initiated signals as inputs. To respond to the HOLD request, it has one signal called HLDA (Hold Acknowledge). The RESET is again described below.

♦ RESET IN : When the signal on this pin goes low, the program counter is set to zero, the buses are tri-stated, and the MPU is reset. ♦ RESET OUT : This signal indicates that the MPU is being reset. The signal can be used to reset other devices.

Interrupts and Externally Initiated Operations.

Power supply and clock frequency.

Microprocessor Architecture

Serial I/O Ports

The 8085 has two signals to implement the serial transmission : SID (Serial Input Data) and SOD (Serial Output Data).

3.3. Exercise

3.3.1. Questions for short answers

a) What are the functions of 8085 microprocessor? b) What are control and status signals?

3.3.2. Analytical question

a) List the internal units of 8085 architecture and explain their function.

Microprocessor Architecture

4.2. Addressing Modes

The sequence of operations that a processor has to carry out while executing an instruction is called its instruction cycle. One of the activities in an instruction cycle is the determination of the addresses of the operands involved in that instruction.

The way in which a processor accomplishes this task is called the addressing mode.

Most common addressing techniques are :

♦ Inherent Addressing ♦ Immediate Addressing ♦ Absolute Addressing ♦ Register Addressing ♦ Register Indirect Addressing

4.2.1. Inherent Addressing

An instruction is said to have an inherent addressing mode if its op-code indicates the address of the operand, which is usually the contents of a register. For example, consider the following instruction :

STC : Set the carry flag in the status register. Since the op-code implies the address of the operand, the processor does not have to compute the operand address. This mode is very common with 8-bit microprocessors such as the 8085, Z80 and MC6809.

4.2.2. Immediate Addressing

Whenever an instruction contains the operand value, it is called an immediate mode instruction. For example, consider the following instruction :

ADD # 25 , R1 ; R1 ← R1 + 25

In this instruction, the symbol # indicates that it is an immediate-mode instruction. This convention is adopted in the assemblers for processors. In these systems, the machine representation of this instruction occupies two consecutive memory words. The first word holds the op-code, whereas the next word holds the data value. In this example, data value is 25. To execute this instruction, the processor has to access memory twice.

Most common addressing techniques are.

Inherent Addressing Immediate Addressing

Digital Systems and Computer Organization

The advantage of immediate addressing is that no memory reference other than the instruction fetch is required to obtain the operand, thus saving one memory in the instruction cycle. The disadvantage is that the size of the number is restricted to the size of the address field, which, in most instruction sets, is small compared with the word length.

4.2.3. Absolute Addressing

An instruction is said to have an absolute addressing mode if it contains the address of the operand. For example, consider the following move instruction :

MOVE 5000 , R2 ; R2 ← [5000]

This instruction copies the contents of memory location 5000 in the register R2.

4.2.4. Register Addressing

An instruction is said to have a register mode if it contains a register address as opposed to a memory address. For example, consider the following register mode and instruction :

ADD R2 , R3 ; R3 ← R2 + R

4.2.5. Register Indirect Addressing

Whenever an instruction specifies a register that holds the address of an operand, the resulting addressing mode is known as the register indirect mode. From this definition, it follow that the EA of an operand in the register-indirect mode is the contents of the register R. More formally, this result is written as follows:

EA = [R]

To illustrate this idea clearly, consider the following instruction:

MOVE (R2) , (R3) ; [R3] ← [R2]

Assume that the following configuration exists :

[R2] = 500016

[R3] = 400016

[5000] = 125616

[4000] = 462916

An instruction is said to have an absolute addressing mode if it contains the address of the operand.

An instruction is said to have a register mode if it contains a register address as opposed to a memory address.

Whenever an instruction specifies a register that holds the address of an operand, the resulting addressing mode is known as the register indirect mode.