Solved Tutorial With Tiny Bugs27-8-12
Solved Tutorial With Tiny Bugs27-8-12
Solved Tutorial With Tiny Bugs27-8-12
There
may be some intentional mistakes / bugs which students are
expected to correct by mostly referring Class lecture notes.
Q1A :by entering into microprocessor age , narrate the history of microprocessor
evolution and revolution your own words . While going through this evolution and
revolution, compare:
- Word length -clock speed -addressing range - number of transistors
major application- execution speed in terms of MIPS and cache memory for the
following microprocessors:
Answer:
Word
Clock speed
Addressing
Number of transistor
length
Range
Intel 4004
4 bit
1MHZ
4 byte
2,300
Intel 8080
8 bit
1MHZ
64KB
150,000
Motorola 6800
8 bit
1MHZ
64KB
150,000
Intel 8086
16 bit
4.47-10MHZ
1MB
30,000
Pentium with MMX
32 bit
66-200MHZ
MB
1900000
Pentium III xeon
64 bit
600MHZ
MB
>3,000,000
Pentium IV
64 bit
2.3GHZ
MB
>3,000,000
Major appl.
Intel 4004
Intel 8080
Motorola 6800
Intel 8086
Pentium with MMX
Pentium III xeon
Pentium IV
Execution speed
in terms of MIPS
50 KIPS
Cache memory
MIPS
16KB
MIPS
8 KB
2.5MIPS
MIPS
16KB
16KB
MIPS
512KB, 1MB
MIPS
512KB,1MB
8 KB
The only difference between the 8086 and the 8088 microprocessors is that BIU
of 8088 can transfer only 8 bits data at one time.
Two main parts to the microprocessor
1- The bus interface unit (BIU)
2- The execution unit (EU)
Jobs performed by bus interface unit ( BIU ):
It is interface to the outside world.
It is performs BUS operation such as
1. instruction fetching
2. reading operand from memory
3. reading operands to memory
4. Inputting or outputting data to I/O peripherals.
Its jobs also include instruction queuing & address generation.
Q4 (A) : What is the word shown in figure below ? Express the result in hexadecimal
form . Is it stored at even or an odd address boundary?
Address
Memory
(Hex)
(Binary)
0072C
1111 1110
0072B
1010 1010
Answers
The most significant byte of the word is stored at address 0072C and equals to
11111101= FD H
Its least significant byte is stored at address 0072B and is
10101010=AA H
Together these two byte give the word
11111101101010101= FDAA H
Expressing the address of the least significant byte in binary from gives
0072B= 00000000011100101011
Since the rightmost bit (LSB) is logic 1 , the word is stored at an odd address boundary in
memory.
Q4 (b): what would be 'offset' required to map to physical location 002B3(16) if the
segment base address is 0029 (16).
Answer:
= 002b3 -0029= 0299H
PA= 002B30
SR= 0029
-------------------------0029 H
Q4 (C): calculate the value of the physical address that follows. Assume all number as
hexadecimal umbers.
(1) A200: 12CF
(ii) B2C0:FA12
(1) A200:12CF
A2000
12CF
---------A32CFH
(d) B2C0:FA12
B2C00
FA12
----------C2612
Q4 (D): A data segment is to be loaded from address A0000(16) to AFFFF(16) . what
value must be loaded in to DS?
Address is: 0000 H
Q 4 (C) : How large is the 8088 memory address space?
1 M byte.
Q5( A): A microprocessor- based weighing bridge in a sugar mill requires 4K memory
plus 2 I/P &2 O/P ports. Choose a suitable memory allocation to minimize the I/P &O/P
address decoding for this up based system .draw neat &clean diagram showing the
connectivity of microprocessor with program memory, address decoder ,and I/P ports .
Solution
Program required = 4k
This can be stored within bottom 32 k
Then
A1
0
1
0
1
A14
A13
A12.A3
A2
A1
A0
SELECTED
XXXX
ROM/RAM MEMORY
XXXX
I/P1
XXXX
I/P2
XX..XX
O/P1
XX.XX
O/P2
]Q6 (A): Distinguish between data addressing modes & memory addressing modes?
Answers :
The data- addressing modes include register operand addressing mode, immediate operand
addressing mode where the operand to access is specified as residing in an interval registers of
the microprocessor while memory address mode a physical address (PA) of the operand and
the initiate a read or write operation to this storage location.
PA= segment base: base +index +displacement
Q6 (B): Identify the addressing modes used for the source and the destination operands
in the instruction that follow:
(i)
MOV
AL,BL
(ii)
MOV
AX,OFF H
(iii)
MOV
[DI],AX
(iv)
MOV
DI,[SI]
(v)
MOV
[BX+SI],BP
(vi)
MOV
CL,[BX+4]
(vii)
IN
AL,P8
(viii)
OUT
DX,AX
(ix)
MOV
ARRAY [BX+SI],DX
(x)
MOV
EAX,[BX]
Answers:
Instruction
Sources
Destination
1
MOV
AL , BL
Register
Register
MOV
AX,OFF H
Immediate
Register
MOV
[DI],AX
Register
Indirect
MOV
DI,[SI]
Indirect
register
MOV
[BX+SI],BP
Based index
Register
MOV
Relative
register
IN
OUT
MOV
10
MOV
CL,[BX+4]
AL,P8
DX,P8
ARRAY[BX+SI],DX
EAX,[BX]
Immediate
Immediate
Register
Indirect register
SS
ES
DS
CS
DI
SI
8-bit,
16-bit
Displacement
CS
DS :
SS
ES
BX
BP
SI +
DI
8-bit,
16- bit
Displacement
Q. # 08 (A) Write a short program to transfer a word from an input device whose address
is 10A0 H, into DX.
IN AX, 10AOH
MOV DX, AX
The source segment base value is the code segment CS register and the source of the offset is
0050H so the PA = CS:0050H
Q # 09 (A) List the differences between 8086 and 8088 microprocessor.
The only difference between an 8088 microprocessor and an 8086 microprocessor is the BIU.
In The 8088, the BIU data bus path is 8 bits wide versus the 8086's 16-bit data bus. Another
difference Is that the 8088 instruction queue is four bytes long instead of six.
The important point to note, however, is that because the EU is the same for each processor,
the Programming instructions are exactly the same for each. Programs written for the 8086 can
be run On the 8088 without any changes.
Q #09 ( b) Is 8086/8088 TTL compatible? Explain your answer?
Yes, 8088/8086 microprocessor is compatible.
if the noise immunity figure is de-rated to 350 mv from 400 mv.
( C )What information appears on the address / data bus of the 8088 while ALE is active?
Address bits A7-A0
( D ):- Explain the operation of the TEST pin and the wait instruction?
TEST pin is input which is tested by WAIT.
=0
( c ) compare minimum mode versus maximum mode of operation for the 8086/8088
microprocessor
There are two available mode of the operation for the 8088/8086 microprocessor, Minimum
mode and Maximum mode. Min mode is obtained by the connection of the selection pin
MN/MX to + 5 v and max. Mode is selected by grounded.
Maximum mode is used when ever a coprocessor is connected to the system.
In Minimum mode the signal of the I/O is generated by the processor so it costs less minimum
mode allow the eight bit peripherals to be used with the 8088/8086 without any special
consideration.
3- Operating speed: the speed of operation of the device affects the interface design
4- Data availability: the interface may be able to provide or receive data continuously or data
transfer may be restricted to discrete time intervals.
5. Data timing: data may need to be transmitted to or received from the computer at regular
time intervals or irregularly.
(b) Contrast a memory mapped I/O system with an isolated I/O system
Memory mapped I/ O: any instruction that reference to memory can accomplish the I/O
transfer.
Isolated I/ O: the data transfer between microprocessor and the I/O device takes places using
special I/P instruction IN & OUT
( c ) Explain the term handshaking as it applies to computer system.
Handshaking :
Many I/O devices accept or release information at a much slower rate
than the microprocessor; another method of I/O control called Handshaking or polling
synchronizes the I/O device with the microprocessor. An example device that requires
handshaking is a parallel printer that sends 100 cps . its clear that the processor can send 100
CPS to the printer , so to slow the processor down to match the speed of the of the printer .
The computer printer devices is facilitated using parallel I/O device PPI .As the printer is an
output device , one can program port B of PPI as output port in handshake mode ( i.e. mode 1 )
in this case m few lines of port C serve the purpose of handshake line , where as the printer can
intimate the computer about its status on port A of PPI , which is programmed as simple input
in mode 0 . the printer port physically appears to the near of CPU casing as female D-Type 25
Pin connector .
( d ) Draw the I/O map of personal computer illustrating many of the fixed I/O areas.
Q# 12. ( a ) write a series of instruction that will output AA16 to an output port located
at address C000H of the I/O address space
SOLTION
MOV DX, C000 ; DX register must be loaded with address of the output port .
MOV AL, AA
OUT DX, AL
( b ) suppose data are to be read from two byte wide input ports at address FF H and A9
H respectively and then output as word wide output as word output port at address
FAFD H . Write a sequence of instruction to perform this input/output operation.
Solution:
IN AL.AA
; first read byte from the port address AAH into AL.
MOV AH, AL
; and move it to AH
IN AL, A9
OUT DX, AX
Q# 13 ( a ) the 82C55 PPI has how many programmable I/O PIN CONNECTION . list
the pins that belong to group A & group B in the 82C55. Also mention two pins which
accomplish internal I/O port section.
The 82C55 has 24 programmable I/O.
Group A consist:
1- port A
2- upper half of port C (PC7-PC4)
3- A1,A0,WR
Group b consist from :
1- port B (PB7-PB0)
2- lower half of port c(PC3-PC0_
3- RD
4- RESET
5- CK
6- VCC
7- GND
. Two pins accomplish internal I/O port address is A0 and A1
(b ) what three modes of operation are available to the 82C55 PPI? Mention the purpose
of STB signal is strobes input operation of the 82C55
Mode 0: Latched I/O
Mode 1: strobes I/O
Mode2: bi-directional I/O.
(c) How is the interrupt request pin (INTR) enabled input mode of operation of the
82C55?
The INTR pin becomes logic 1 when the STB input returns to logic 1, and it is cleared when
the data are input from the port by the microprocessor.
(d) In strobe output operation of the PPI, what is the purpose of ACK signal?
The ACK signal is an output that signals that the data have been removed from the port.
Q.# 14 By considering all aspects of microprocessor based application design explain
- System specification
- block level system design
- Software design
- Hardware design
- Hardware and software integration
-prototype
SYSTEM SPECIFICATION:
The specification states that functions that the system must perform but does
not necessarily cover how the functions are implemented.
BLOCK DIGRAM:
This includes:
Selecting microprocessor type
Determination of I/O and memory requirements
Division of tasks between hardware and software
Software design:
It is often proceeds in parallel with the hardware design.
The software may be written in assembly language or in a high level language or in
combination of two.
Depending on the type of the computer used for the software development, it may be
possible to debug parts of the software with out hardware.
HARDWARE DESGIN
It consists of selection of:
Microprocessor
Memory (RAM & ROM )
Peripheral IC's
Design circuitry to connect them together to from the system
HARDWARE & SOFTWARE INTERGATRION
Hardware debugging usually begins by testing the system with short test programs
After the hardware is able to execute these test program the hardware /software
integration begins.
The actual application software replaces the test programs and the complete system is
debugged.
This can be cheapening task, since there are often both hardware and software
problems to be found and is not always clear which it which.
Several types of test equipment are available for assisting in this process:
1- LOGIC ANALYZER: which captures a trace of the bus activity and displays
the sequence of bus cycles that were executed?
2- IN CIRCUIRT EMULATORS: which pugs into the microprocessor socket
and allows the operation of the system be controlled and monitored.
Q. # 15 (a) Discuss the function of an interrupt in a microprocessor based system and
explains the interrupts structure of the Intel family of microprocessors
1) interrupts provide a mechanism for changing the program environment.
2) Transfer program control is initiated by the occurrence of an event internal to the
microprocessor or an event in its external hardware .
3) For instance when an interrupt signals occurs indicating that an external device , such as
printer , requires services , the microprocessor must suspend what it is doing in the
main part of the program and pass control to a special routine (Interrupt services routine
) that performs the function required by the device .
4) When the microprocessor terminates execution in the main program, it remembers the
location where it left off and then it picks up execution with first instruction in services
routine. After this routine run to completion, program control is returned to the point
where the microprocessor originally left the main body of program.
5) Interrupts are practically useful when interfacing I/O device that provide data at
relatively low data transfer rates.
The interrupts of the entire Intel family of microprocessor include :
- Hardware pins that request interrupt (INTR & NMI) and one hardware pin (INTA) that
acknowledges the interrupt requested through INTA.
- In addition to the pins , the microprocessor also has software interrupts
INT,INTO,INT3, and BOUND
- Two flags bits , IF ( Interrupt flag) and TF ( Trap flag) , are also used with the interrupt
structure and a special return instruction IRET ( or IRED in 80386/higher )
- Hardware , software , and internal interrupts are serviced in priority basis.
- Internal interrupts are the highest priority group.
- Next lowest is the nonmaskable interrupts.
- Next lowest is software interrupts
- External hardware interrupts are the lowest priority group.
(b) Explain the operation of software interrupts instruction INT, INTO, INT3 &
BOUND.
Answer:
INT: INT instruction calls the interrupts service procedures that begins at address represented
in vector number
INTO: INTO instruction checks the overflow flag (OF), if OF =1, the instruction calls the
procedure whose address is stored in interrupt vector type number 4.
If OF = 0, then the INTO instruction performs no operation and next sequential instruction in
the program executes.
INT3: INT3 instruction is often used as a breakpoint interrupt because it is easy to insert a 1byte instruction into a program, breakpoints are often used to debug faulty software.
BOUND: The BOUND instruction which has two operands, compares a register with two
words of memory data for example, if the instruction BOUND AX, DATA is executed, AX is
compare with the contents of DATA and DATA +1 and also with DATA+2 and DATA+3 if AX
is les than the contents of DATA and
DATA+1.
the type 5 interrupt occurs. If AX is greater than DATA+2 and DATA +3 , a type 5 interrupt
occurs. If AX is within the bounds of these two memory word no interrupts occurs.
( c ) what is 8295A? Also mention how many 8295 a are required to have 64 interrupt
inputs.
8259A is programmable interrupts controller that adds eight interrupt inputs to the
microprocessor.
It required a master 8295A and eight 8295A slaves.
Q. # 16 ( a ) The interrupt vectors and vector table are crucial to an understanding of
hardware and software interrupts .At what memory address is the interrupts vector table
is located?
In the first 1 k byte at location 00000000 H-000003FFH
( b ) describe the function of the following dedicated interrupts of 8086 microprocessor:
- Divider Error
- Single step or trap
- Over flow
- Bound
Answer
Type 0 _ Divider Error: Occurs whenever the result of a division overflows or whenever
an attempt is made to divide by zero
Type 1 Single step or Trap: occurs after the execution of each instruction if the trap
(TF) flag bit is set. Upon accepting this interrupt the TF bit is cleared so the interrupt
service procedure executes al full speed.
Type 4 overflow: is a special vector used the INTO instruction. The INTO instruction
interrupts the program if an overflow condition exits as reflected by the overflow flag (OF)
Type 5 BOUND: is an instruction that compares register with boundaries stored in the
memory. If the contents of the register is greater than or equal to the first word in memory
and less than or equal to the second word, no interrupt occurs because the contents of the
register is within bounds. If the contents of the register of the register is out of bounds, a
type 5 interrupt execute
Q .17 (a) Write assembly language procedure to fill the screen with string " Advanced
microprocessor system "?
Title first assembly language program
.model small
.data
NAL DB
41h,64h,76h,61h,60h,63h,65h,64h,6dh,4dh,69h,63h,72h,6fh,70h,72h,6fh,63h,65h,73h,73h,6fh,
72h,6dh,53h,79h,73h,74h,65h,6dh
.code
.startup
MOV CX, 29
MOV BX, 0H
MOV AH, 2H
Back: MOV AL, [BX] +NALO
INT 21H
INC BX
Loop back
.exit
End
(b) Explain
(I) In how many ways DMA process may be initiated and be terminated.
To initiate the DMA process, we use HOLD signal.
To terminate the DMA process, we use EOP signal.
(ii) The sequence of events as DMA is required by an I/O device.
The DMA I/O technique provides direct memory access to the memory,
while the p is temporarily disabled. This allows data to be transferred between memory & the
I/O devices at a rate that is limited only by the speed of the memory components in the system
or the DMA.
This process can be done by using the HOLD pin (input) that is used to request a DMA
action and the HOLD pin is an output that acknowledges.
(iii) What happens when DMAC receives DMA request from another channel while it is
serving one?
The 8237 DMA controller supplies the memory and I/O with control signals and
memory address information during the DMA transfer, the 8237 DMA controller is capable of
DMA transfers at rates of up to 1.6MB per sec. so, DMAC receive DMA from another
channel, this means that, the channel is capable of addressing a full 64k-byte section of
memory and can transfer up to 64k-bytes with a single programming.
Q. 18
The device we discussed in this lecture fall into two classes: microprocessors & single
chip microcomputers (microcontrollers).
(i) What are the characteristics required chip microcomputer?
A practical p controlled the system would almost certainly be implemented a single chip computer since the application relatively simple at high value market, so , it is possible to
develop a-p application on the MC6800,6802 subsequently to one smaller charger chip controller from the same family.
6805 is suitable:
RAM (B) ROM (B)
I/O
clock minimum system
64
1100
20
yes
one chip
(ii) The 6802 includes many of theses characteristics. Is it single chip
microcomputer? If not, what is missing?
I/O, ROM is missing
Since it is 6800+clock and 128 bytes RAM
(iii) What are major advantages &disadvantages of single chip microcomputer?
Single chip has the MPU, Memory, I/O function, all integrated into a single IC.
ADVANTAGE:
Single chip microcontrollers are cheap, flexible.
DISADVANTAGE:
Limited memory & I/O lines.
EAX
EBX
ECX
EDX
ESP
EBP
ESI
EDI
0
32
MOV CL, BL
MOV BX,SI
MOV AX,DS
MOV AH,AI
.
?How many bits of storage do the following EPROM memory devices contain ( xxii)
2708
2716
2732
2764
27128
?What are the purposes of CAS and RAS inputs of a DRAM ( xxviii )
.CAS and RAS are two special pins called as Column Address Strobe and Row Address Strobe
?How much time is required to refresh a typical DRAM ( xxix )
ms 2-4
? What is the purpose of BHE and A0 pins on 8086 micro processor ( xxx )
.The BHE select the upper memory bank and A0 select lower memory bank
Q No.20 What are Embedded systems? Give some Examples of Embedded systems. What
is Technology behind Embedded systems? Explain Criteria to choose a microcontroller
for small embedded microcontroller based application.
[ Refer Lecture 27-28 Embedded System Design ]