SYLHET INTERNATIONAL UNIVERSITY Shamimabad, Baghbari, Sylhet-3100 Assignment Title: Microprocessors and Interfacing & Assembly Language Course Title: Microprocessors and Assembly Language Course Code: 333 Credit: 3 & Course Title: Microprocessors and Assembly Language Lab Course Code: 334 Credit: 1.5 Created by : TeamBlackHole TeamBlackHole V I R
16
Embed
Microprocessor & Assembly language by team blackhole
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SYLHET INTERNATIONAL UNIVERSITY
Shamimabad, Baghbari, Sylhet-3100
Assignment Title: Microprocessors and Interfacing & Assembly
Language
Course Title: Microprocessors and Assembly Language Course Code: 333
Credit: 3 &
Course Title: Microprocessors and Assembly Language Lab
Course Code: 334
Credit: 1.5
Created by : TeamBlackHole
TeamBlackHole
V
I R
Part-I: Microprocessor and Interfacing
1. Describe the sequence of signals that occurs on the address bus, the
control bus, and the data bus when a simple microcomputer fetches an
instruction?
Ans:
i. A microcomputer fetches each program instruction in sequence,
decodes the instruction, and executes it.
ii. The CPU in a microcomputer fetches instructions or reads data from
memory by sending out an address on the address bus and a Memory
Read signal on the control bus. The memory outputs the addressed
instruction or data word to the CPU on the data bus.
iii. The CPU writes a data word to memory by sending out an address on
the address bus, sending out the data word on the data bus, and
sending a Memory write signal to memory on the control bus.
iv. To read data from a port, the CPU sends out the port address on the
address bus and sends an I/O Read signal to the port device on the
control bus. Data from the port comes into the CPU on the data bus.
v. To write data to a port, the CPU sends out the port address on the
address bus, sends out the data to be written to the port on the data
bus, and sends an I/O Write signal to the port device on the control
bus.
2. What determines whether a microprocessor is considered an 8-bit, a 16-
bit or a 32-bit device?
Ans:
The word size (8 bits, 16 bits, or 32 bits) of a microprocessor is the size of the
data path in the execution unit. Typically, this is the size of the accumulator.
Note: This is the execution unit size, not the bus interface unit size. An example
where this matters is the 8088, which is a 16 bit computer running on an 8 bit
bus.
The 8085 is 8 bits. The 8086/8088 is 16 bits. The 80386 is 32 bits. Modern Intel
processors are 64 bits.
3.
a. How many address line does an 8086 have?
Ans:
There are 20 address lines on the 8086, A19 - A0, of which the low order 16,
A15 - A0, With 20 address lines, and the 8086 can address 1,048,576 bytes.
b. How many memory address does this number of address line allow the
8086 to access directly?
Ans: The 8086/8088 has 20 address lines. It can access 220, or 1MB, or
1,048,576 bytes of memory.
c. At any given time an 8086 works with four segments in this address
space, how many bytes are contained in each segment?
Ans: 64 kilobyte are contained in each segment.
4. What is the main difference between 8086 and 8088?
DIFFERENCE BETWEEN 8086 AND 8088 MICROPROCESSOR
8086 Microprocessor 8088 Microprocessor
8086 has 16-bit data lines. 8088 has 8-bit data lines.
8086 is available in three clock
speed 5 MHz, 8 MHz and 10 MHz
Whereas 8088 is available in two
clock speed 5 MHz and 8 MHz
The memory space of 8086 is
organized as two 512KB banks.
The memory space of 8088 is
implemented as single 1M*8
Memory bank.
8086 has 6-byte instruction queue. 8088 has 4-byte instruction queue.
The 8086 has BHE (Bank high
enable)
The 8088 has SSO status signal.
The 8086 can read or write 8-bit or
16-bit data at a time.
The 8088 can read/write 8-bit data
at a time.
The I/O voltages level for 8086 is
measured at 2.5 mA.
The I/O voltages level for 8086 is
measured at 2 mA.
The 8086 draws maximum supply
current of 360mA.
The 8086 draws maximum supply
current of 340mA.
DIFFERENCE BETWEEN 8085 AND 8086 MICROPROCESSOR
The difference between 8085 and 8086 are given below.
8085 Microprocessor 8086 Microprocessor
It is 8-bit Microprocessor It is 16-bit Microprocessor
It has 16-bit address line. It has 20-bit address line.
It has 8-bit data bus. It has 16-bit data bus.
The clock speed of 8085
microprocessor is 3 MHz
The clock speed of 8086 can vary
between 5, 8 and 10 MHz for three
different microprocessor.
It has 5 flags. It has 9 flags.
It does not support pipe-lining. It supports pipe-lining.
It’s operate on clock cycle with 50%
duty cycle.
It’s operate on clock cycle with 33%
duty cycle.
It does not support memory
segmentation
It support memory segmentation
The 8085 microprocessor has 6500
transistor.
The 8086 microprocessor has 29000
transistors.
The 8085 microprocessor is
Accumulator based processor.
The 8086 microprocessor is general
purpose register based processor.
The 8085 has no minimum or
maximum mode.
The 8086 has minimum and
maximum mode.
In 8085 microprocessor only one
processor is being used.
In 8086 more than one processor is
being used (additional external
processor can be used).
In 8085 microprocessor only 64 KB
memory is used together.
In 8086 microprocessor 1 MB is
used.
5.
a. Describe the function of the 8086 queue?
Ans: The 8086/8088 instruction queue is a buffer that holds opcode bytes that
have been prefetched by the bus interface unit. This speeds up operations of the
processor by helping to reduce fetch latency, i.e. to improve the probability that
an opcode byte fetched by the processor is already available.
b. What are the functions of execution unit in 8086 Intel?
Ans: Basically the function of execution unit in 8086 is to perform all arithmetic
and logic operations. It tells the Bus Interface unit (BIU) where to fetch
instructions and data from. It has 4 components: Control circuitry, ALU, Flag
registers and general purpose registers.
1. Control circuits-it directs all the internal operations.
2. ALU-performs all logic operations.
3. General purpose registers-used to store data during execution.
4. Flag registers-it has a 16bit flag register containing 9 flags that are set for
certain conditions during any operation. Ex: carry flag (whenever there is a
carry).
It also has a decoder to decode the fetched instructions.
c. How does the queue speed up processing?
Ans: The instruction prefetch queue speeds up the processing of
microprocessors by attempting to have the next opcode bytes available to the
execution unit before it actually needs them. This works because, statistically,
there is time spent by the execution unit in executing a particular instruction;
time that the bus interface unit can use to go ahead and pre-fetch the next
opcode bytes. Sometimes, this results in a loss of time, because the execution
unit may branch to some other location. Modern processors attempt to sidestep
that by using branch prediction algorithms.
6. If the code segment for an 8086 program starts at address 70400h, what
number will be CS register?
Ans: 7040H
7. What physical address represented by
a. 4370:561EH
b. 7A32:0028H
TeamBlackHole
V
I R
Ans: a.
43700
561𝐸
48𝐷1𝐸
Ans: b.
7A320
0028
7𝐴348
8. Why does 8086 use only 6 byte queue?
Ans: Because the longest instruction in instruction set is 6 bytes long. Hence
with a 6 byte long queue it is possible to pre-fetch even longest instruction in
the instruction set.
9. Describe the dived-by-zero interrupt?
Divide-by-zero interrupt: If u attempt to divide an operand by zero, the 8086
will automatically interrupt the currently executing program
More specifically, 8086 will automatically do a type zero interrupt if
– The result of a DIV operation or an IDIV operation is too large to
fit in the destination register.
At the end of each instruction cycle, 8086 checks to see if any interrupts have
been requested. If an interrupt has been requested – the 8086 responds to the
interrupt by stepping through the following series of major actions:
• It decrements the stack pointer by 2 and pushes the flag register on the
stack.
• It disables the INTR interrupt input – by clearing the interrupt flag (IF) in
the flag register.
• It resets the trap flag (TF) in the flag register.
• It decrements the stack pointer by 2 and pushes the current code segment
register contents on the stack.
• It decrements the stack pointer again by 2 and pushes the current
instruction pointer contents on the stack.
• It does an indirect fat jump to the start of the procedure you wrote to
respond to the interrupt.
10. List out the major steps in developing an assembly language program.
• Program Development Steps
• Defining the Problem
• Representing program operations
• Finding the right instructions
• Writing a program
Defining the problems
• Find out the problem. For example: Sensing temperature, detecting