Professional Documents
Culture Documents
R20
UNIT –1
MICROPROCESSORS, MICROCOMPUTER AND ASSEMBLY LANGUAGE
1. Draw a block diagram of Microprocessor based system and explain the functions of each
component: Microprocessor, Memory and I/O and their line communication [L4] [CO1]
[12M]
The basic components of Microprocessor based system are
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
The Figure 2.13(a) explains the concept of microprocessor and microcomputer in von Neumann The
microprocessor chip has to be interfaced to memory and I/O units to work as a computer for any application.
Figures 2.13(b) and 2.13(c) show the microprocessor and microcomputer chips connected to memory and I/O
units.
Clearly the microprocessor should be able to accept and send data from and to memory and I/O units. To
read a data from memory, the microprocessor should generate address of the location, and read control
signal for memory read. The microprocessor should also be able to accept data from memory. For
interfacing them Microprocessor to any input or output device the same information would be required.
Thus address, data and control signals are required to interface the microprocessor to memory and I/O
devices.The microprocessor fetches the first instruction
2.b) List different computer languages and explain them. [L2] [CO2]
[8M]
A programming language is a notation designed to connect instructions to a machine or a computer.
Programming languages are mainly used to control the performance of a machine or to express algorithms
Generally, there are three types of computer languages
1 Machine Level Language
2 Assembly Level language
3 High Level Language
In comparison to machine language, assembly language is easier to write and use. A high-level
language (HLL) is a programming language such as C, FORTRAN, or Pascal that enables a
programmer to write programs that are less dependent on machine.
3.a) Write the steps required for writing and executing Assembly language Program andexplain the
procedure. [L2] [CO3] [4M]
Let us define a program statement as ‘Write and Executing Assembly Language Programming 8085 to add two
numbers’. The three tasks are involved in this program :
.
Assembly Language Program to Machine Language Program:
Once the Assembly Language Programming 8085 is ready, it is necessary to convert it in the machine language
program. It is possible to do this by referring the proper hex code for each, assembly instruction from the 8085
instruction set manual. This process is known as hand assembly and the resulted machine language program is
also known as hex code. Let us see thehex code for our program.
Once the starting address is entered, the program can be executed by pressing EXECUTE key. The EXECUTE
key procedure loads the starting address of our program, 2000H into the program counter and program control is
transferred from monitor program to our program.
Once the starting address is entered, the program can be executed by pressing EXECUTE key. The EXECUTE
key procedure loads the starting address of our program, 2000H into the program counter and program control is
transferred from monitor program to our program. After this microprocessor reads one hex code at a time, and
when it fetches the complete instruction, it executes that instruction. Then it fetches the next instruction and this
process continues until the last instruction in the program is executed.
3.b) Differentiate low-level language and high-level language. [L2] [CO1] [4M]
Difference Between High-Level and Low-Level Languages
Parameter High-Level Language Low-Level Language
Basic These are programmer-friendly These are machine-friendly languages
languages that are manageable, easy that are very difficult to understand
to understand, debug, and widely used by human beings but easy to interpret
in today’s times. by machines.
Ease of These are very easy to execute. These are very difficult to execute
Execution
3.C) Define instruction and how it can be expressed in terms of symbolic code give example.
[L1] [CO2] [4M]
Instruction: An instruction (instruction format) is a command to the microprocessor to perform a
given task ona particular data. Instruction is a combination of opcode and operands.The instruction set
of a microprocessor is the collection of the instructions that the microprocessor is designed to execute.
The programmer can write a program in assembly language using instructions.
Instructions have been classified into the following groups:
1. Data Transfer
2. Arithmetic
3. Logical
4. Branch Control
5. Machine Control
Data Transfer: Which are used to transfer data from one register to another register, from memory to register
or register to memory, come under this group.
Examples are: MOV, MVI, LXI, LDA, STA etc.
When an instruction of data transfer is executed, data is transferred from the source to the destination without
altering the contents of the source.
For example, when MOV A, B is executed the content of the register B is copied into the register A, and the
content of register B remains unaltered.
Arithmetic
The instructions of this group perform arithmetic operations such as addition, subtraction; increment or
decrement of the content of a register or memory. Examples are: ADD, SUB, INR, DAD etc.
Logical
The Instructions under this group perform logical operation such as AND, OR, compare, rotate etc. Examples
are: ANA, XRA, ORA, CMP, and RAL etc.
A portable, compact computer that can run on an electrical wall outlet or a battery unit. All components
(keyboard, mouse, etc.) are in one compact unit. Usually more expensive than a comparable desktop.
Sometimes called a Notebook
ii) Workstation computers
A workstation is a special computer designed for technical or scientific applications. Intended primarily to be
used by one person at a time, they are commonly connected to a local area network and run multi-user
operating systems.
iii) Single board computers
A single-board computer (SBC) is a complete computer built on a single circuit board, with
microprocessor(s), memory, input/output (I/O) and other features required of a functional computer. Single
board computers are commonly made as demonstration or development systems, for educational systems, or
for use as embedded computer controllers. Many types of home computers or portable computers integrate all
their functions onto a single printed circuit board.
b) List different types of microcomputers and with example. [L1] [CO1] [6M]
Microcomputers
A microcomputer is a complete computer on a small scale, designed for use by one person at a time.A
microcomputer is now primarily called a personal computer (PC), or a device based on a single-chip
microprocessor Common microcomputers include laptops and desktops.
i) Lap tops
A portable, compact computer that can run on an electrical wall outlet or a battery unit. All components
(keyboard, mouse, etc.) are in one compact unit. Usually more expensive than a comparable desktop.
Sometimes called a Notebook
ii) Workstation computers
A workstation is a special computer designed for technical or scientific applications. Intended primarily to be
used by one person at a time, they are commonly connected to a local area network and run multi-user
operating systems.
iii) Single board computers
A single-board computer (SBC) is a complete computer built on a single circuit board, with
microprocessor(s), memory, input/output (I/O) and other features required of a functional computer. Single
board computers are commonly made as demonstration or development systems, for educational systems, or
for use as embedded computer controllers. Many types of home computers or portable computers integrate all
their functions onto a single printed circuit board.
System
hardware
1.Microprocess
2.Memory
3.Input devices
4.Output
devices
Microprocessor
The processor read the binary instructions from memory and execute those instructions
continuously, it will read temperature, display it at the LCD display panel, and turn on/off fan and
the heater based on the temperature
Memory
The system includes two types of memory
i. ROM- It is used to store the program called the monitor program, that is responsible for
In this system input device is temperature sensor a device that translates one form energy into
another form is called transducer, here temperature sensor is a transducer translate temperature
into an electrical signal A/D Converter
The electrical signal is converted into binary using A/D converter, the output of the A/D converter
is easily understand by the processor and generates control signals to output devices with respect
to the temperature Output
There are three output devices 1.fan or cooler 2.heater
3.LCD Fan
This is system output device that is turned on by the processor when the temperature reaches a set
higher limit Heater
This is turned on by the processor when the temperature reaches a lower limit.
6 List the three operations commonly performed by the Microprocessor or MPU. [L1] [CO2] [12M]
A memory unit stores binary information in groups of bits called words. Data input lines provide the
information to be stored into the memory, Data output lines carry the information out from the memory. The
control lines Read and write specifies the direction of transfer of data. Basically, in the memory organization,
there are 2^{l} memory locations indexing from 0 to 2^{l}-1 where l is the address buses. We can describe the
memory in terms of the bytes using the following formula:
N = 2^{l} Bytes
Where,
L is the total address buses
N is the memory in bytes
For example, some storage can be described below in terms of bytes using the above formula:
1kB= 2^10
64 kB = 2^6 x 2^10 Bytes
= 216 Bytes
Memory Address Register (MAR) is the address register which is used to store the address of the memory
location where the operation is being performed.
Memory Data Register (MDR) is the data register which is used to store the data on which the operation is
being performed.
Memory Read Operation:
Memory read operation transfers the desired word to address lines and activates the read controlline.
Description of memory read operation is given below:
In the above diagram initially, MDR can contain any garbage value and MAR is containing 2003 memory
address. After the execution of read instruction, the data of memory location 2003 will be read and the MDR
will get updated by the value of the 2003 memory location (3D).
As a CPU needs to communicate with the various memory and input-output devices (I/O) as we know data
between the processor and these devices flow with the help of the system bus. There are three ways in which
system bus can be allotted to them :
Separate set of address, control and data bus to I/O and memory.
Have common bus (data and address) for I/O and memory but separate control lines.
Have common bus (data, address, and control) for I/O and memory.
In first case it is simple because both have different set of address space and instruction but require more buses.
Isolated I/O
Isolated I/O in which we have common bus(data and address) for I/O and memory but separate read
and write control lines for I/O. So when CPU decode instruction then if data is for I/O then it places the
address on the address line and set I/O read or write control line on due to which data transfer occurs between
CPU and I/O. As the address space of memory and I/O is isolated and the name is so. The address for I/O here
is called ports. Here we have different read-write instruction for both I/O and memory.
7 a) Describe the memory model of a typical memory chip. [L2] [CO1] [6M]
A memory is just like a human brain. It is used to store data and instructions. Computer memory is the storage
space in the computer, where data is to be processed and instructions required for processing are stored.
The memory is divided into large number of small parts called cells.
1. Primary memory
2. Secondary memory
Primary memory includes ROM and RAM, and is located close to the CPU on the computer motherboard, enabling the
CPU to read data from primary memory very quickly indeed.
Primary Memory Types:
i.RAM, or random access memory
7.b) Explain how memory addresses are assigned to a memory chip of size 1K (1024X8)? [L2] [CO1] [6M]
8.a)Illustrate the Instruction fetch operation from memory location 2005H [L2] [CO1] [6M]
9. Explain the difference between the peripheral I/O and memory mapped I/O. [L2] [CO2] [12M]
10 a) Illustrate the microcomputer system with example. [L3] [CO1] [6M]
The 8085 microprocessor is an example of a Microcomputer System. A microprocessor system contains
two types of memory that are EPROM and R/WM, Input and Output devices, and the buses that are used
to link all the peripherals (memory and I/Os) to the MPU. In 8085, we 16 address lines ranging from A0 to A15 that are
used to address the memory. The lower
order address bus A0-A7 is used in the identification of the input and output devices. This microcomputer
system has 8 data lines D0-D7 which are bidirectional and common to all the devices.
It generates four control signals: Memory Read, Memory Write, I/O Read, and I/O Write, and they are
connected to different peripheral devices. The MPU communicates with only one peripheral at a time by
enabling that peripheral through its control signal.
For example, sending data to the output device, the MPU places the device address (or output port
number) on the address bus, data on the data bus, and enables the output device by using its control signal
I/O Write. After that, the output device displays the result.
The other peripheral that is not enabled remain in a high impedance state called Tri-state. The bus drivers
increase the current driving capacity of the buses, the decoder decodes the address to identify the output
port, and the latch holds data output for display. These devices are called Interfacing devices. These
Interfacing devices are semiconductor chips that are needed to connect peripherals to the bus system.
10 b) Draw the block diagram of output section of Microcomputer . Describe the role of tristate bus driver,
decoder and latch.