0% found this document useful (0 votes)
10 views6 pages

MP Sol

solution

Uploaded by

381roses
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views6 pages

MP Sol

solution

Uploaded by

381roses
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Microprocessor and Systems Final

Exam Solution Paper

Q.1: (CLO-1)

You have studied Microprocessor in course. In this section, questions


regarding 8086 microprocessors will be asked:

Q1(i)For input and Output interfacing, which bus is required?

Ans: Data Bus

Q.1(ii)When we say 8086 microprocessors is of 16-bit architecture, what is meant by


that?

Ans: The Intel 8086, is a 16-bit microprocessor designed by Intel corporation between 1976-1978.
This Intel 8086 microprocessor gave rise to the x86 architecture or 16-bit architecture. The figure
given below is the internal architecture of Intel 8086 microprocessor

The 8086 microprocessor performs faster operations as it has registers, internal and external buses and
ALU, all of 16-bit.
Intel 8086 microprocessor has two units;

Execution Unit (EU) and Bus Interface Unit (BIU). They are dependent and get worked by each other.

Units and Registers of 8086 Microprocessor:

Execution Unit (EU):

Execution unit receives program instruction codes and data from the BIU, executes them and stores
the results in the general registers. It can also store the data in a memory location or send them to an
I/O device by passing the data back to the BIU. This unit, EU, has no connection with the system
Buses. It receives and outputs all its data through BIU.

Bus Interface Unit:

As the EU has no connection with the system Buses, this job is done by Bus Interface Unit. BIU and
EU are connected with an internal bus. BIU connects EU with the memory or I/O circuits. It is
responsible for transmitting data, addresses and control signal on the buses.

General Registers:

General Registers or General Purpose Registers are a kind of registers which can store both data and
addresses.

Segment Registers:

There are four segment registers, CS (Code Segment), DS (Data Segment), ES (Extra Segment) and
SS (Stack Segment).

Instruction Pointer (IP):

To access instructions the Intel 8086 uses the registers CS and IP. The CS register contains the
segment number of the next instruction and the IP contains the offset.

Flag Registers:

Intel 8086 has 16 flag registers among which 9 are active. The purpose of the flag register is to
indicate the status of the processor. It does this by setting the individual bits called flags.

Arithmetic Logic Unit

Arithmetic and logic operations take place in the ALU.

Accumulator

The Accumulator holds one of the operands as well as the result in operations performed by the ALU.

Program Counter (PC)

The program counter contains the memory address of the next program instruction to be executed.
Address, Data and Status Registers and Stack Pointer

The Address Register contains address of a memory location to be accessed.

The Data Register contains the data coming from or going to memory or an I/O port.

The Status Register contains information about the result of the previous ALU operation.

The Stack Pointer register contains the address of the block of memory (the stack) where subroutine
return addresses are stored.

Control unit

The Control Unit contains the circuitry that controls the process of fetching, decoding and executing
program instructions.

Q.1(iii) The 8086 gave rise to x86 architecture? Explain what is the x86 architecture and
how it differs from x64 architecture?

Ans: x86 simply refers to a family of processors and the instruction set they all use. It doesn't actually
say anything specific about data sizes.

x86 started out as a 16-bit instruction set for 16-bit processors (the 8086 and 8088 processors), then
was extended to a 32-bit instruction set for 32-bit processors (80386 and 80486), and now has been
extended to a 64-bit instruction set for 64-bit processors. It used to be written as 80x86 to reflect the
changing value in the middle of the chip model numbers, but somewhere along the line the 80 in the
front was dropped, leaving just x86.

x64 is shorthand for x86-64, which is the 64-bit extension to x86. However, there are actually two
variations of this ISA: AMD64 and Intel64. However the differences are minor and of no real concern
to the end user

Q.1(iv) What is role of cache memory in speeding up the microprocessor? How it differs
from the registers?

Ans: Cache memory is an extremely fast memory type that acts as a buffer between RAM and the
CPU. It holds frequently requested data and instructions so that they are immediately available to the
CPU when needed. Cache memory is used to reduce the average time to access data from the Main
memory.

* A cache memory is an area in the computer where codes and instructions are stored while a register
holds instructions or data that the processor is working on or will be working on shortly. They form
part of the processor and are capable of holding only one item at a time.
Q.1(v) Write a C-language or Assembly language program to move data between two
registers?

MOV A,#55H ;load value 55H into reg. A


MOV R0,A ;copy contents of A into R0
;(now A=R0=55H)
MOV R1,A ;copy contents of A into R1
;(now A=R0=R1=55H)
MOV R2,A ;copy contents of A into R2
;(now A=R0=R1=R2=55H)
MOV R3,#95H ;load value 95H into R3
;(now R3=95H)
MOV A,R3 ;copy contents of R3 into A
;now A=R3=95H

Q.2: (CLO-2)

i) Write a program to generate a pulse train of 2 seconds period ? You can use
timer 1 in mode 1?

Ans:

1/12 × 11.0529 MHz = 921.6 MHz;

T = 1/921.6 kHz = 1.085 μs

Max delays

In mode 2 = 256*1.085 μs = 277.76 μs

In mode 1 = 65536*1.085 μs = 71.11 ms

Suppose we use delay of 50 ms

2 sec / 50 ms = 2000 ms / 50 ms = 40 loops

Counts = 50 ms / 1.085 μs = 46,083 counts

We’ll use mode 1.

TH TL = 65,536 – 46,083 = 19,453 = 0x4BFD


#include <reg51.h>

void TwoSec()

unsigned char i;

TMOD = 0x10;

for (i = 0 ; i<40 ; i++){

TH1 = 0x4B;

TL1 = 0xFD;

TR1 = 1;

while (TF1==0);

TR1 = 0; TF1 = 0;

sbit tick = P2^7;

void main(void){

while (1) {

P2++; TwoSec();

ii) Write a program to transfer serially the message “The earth is but one
country and mankind its citizens”

Ans:

#include <reg51.h>

void send(unsigned char ch []){

unsigned char i;

for(i=0;ch[i]; i++){

SBUF = ch[i]; // place value in buffer

while (TI == 0); // wait until transmitted

TI = 0; // Clear TI Flag

}
}

void main(void){

code unsigned char message[] = "The earth is but one country


and mankind its citizen ";

TMOD = 0x20; // use Timer 1, mode 2

TH1 = 0xFD; // 9600 baud rate

SCON = 0x50; // Serial Mode 1, Receive enable

TR1 = 1; // start timer

while (1)

send(message);

You might also like