Sunday, 9 October 2016

what is microprocessor?

Answers for viva questions

1}What is Microprocessor
ans:-It is a program controlled semiconductor device (IC},which fetches,decode and executes instructions.

2} Explain the function of CPU in Microprocessor
ans:-A microprocessor controls all functions of the CPU, or central processing unit, of a computer or other digital device. The microprocessor is programmed to give and receive instructions from other components of the device. The system can control everything from small devices such as calculators and mobile phones, to large automobiles.

3} Define Compiler
ans:-A compiler is a computer program (or set of programs) that transformssource code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program.

4}Define Intrepreter
ans:- An interpreter may be a program that either :-executes the source code directly; translates source code into some efficient intermediate representation (code) and immediately executes this; explicitly executes stored precompiled code[1] made by a compiler which is part of the interpreter system.

5}Define Assembler
ans:-An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the computer's processor can use to perform its basic operations.

6}What is Assembly level language
ans:-An assembly language is a low-level programming language for microprocessors. It implements a symbolic representation of the binary machine codes and other constants needed to program a particular CPUarchitecture. This representation is usually defined by the hardware manufacturer, and is based on mnemonics that symbolize processing steps (instructions), processor registers, memory locations, and other language features.

7)What are Mnemonics
ans:-mnemonics are instructions or commands to perform a 
perticular opration 
given by user to microprocessor e.g MOV 
MIV
ADD
SUB
IMUL


8)What is a bus
ans:-Information is transferred between units of the microcomputer by collections of conductors called buses.
There will be one conductor for each bit of information to be passed,
e.g., 16 lines for a 16 bit address bus. There will be address, control, and data buses.

9)Distinguish between Microprocessor & Microcontroller.
ans:-The microprocessor is a digital integrated circuit device that can be programmed with a series of instructions to perform specified functions on data.
But micro controller is a computer on a chip which has memory,input,ouput on the chip itself.
So,micro processor can perform only few functions but micro controller can perform so many functions.


10)Define address bus, data bus and control bus
ans:- ADDRESS BUS:-An address bus is a computer bus (a series of lines connecting two or more devices) that is used to specify a physical address. When a processor or DMA-enabled device needs to read or write to a memory location, it specifies that memory location on the address bus (the value to be read or written is sent on the data bus). The width of the address bus determines the amount of memory a system can address.

DATA BUS:-The bus (connections between and with in the CPU, memory, and peripherals) used to carry data. Other connections are the address bus and control signals. The width and clock rate of the data bus determine its data rate (the number of bytes per second it can carry), which is one of the main factors determining the processing power of a computer

CONTROL BUS:-The control bus (or command bus) transports orders and synchonisation signals coming from thecontrol unit and travelling to all other hardware components. It is a bidirectional bus, as it also transmits response signals from the hardware.


11)What is nibble, byte and word
ans:-NIBBLE:-In computing, a nibble is a four-bit aggregation or half an octet. As a nibble contains 4 bits.

BYTE:-
The byte (pronounced /ˈba
ɪt/) is a unit of digital information in computing and telecommunications. The size of a byte is typically hardware dependent, but the modern de facto standard is 8 bits, as this is a convenient power of 2.

WORD:- The most common microprocessors used in personal computers (for instance, the Intel Pentiums and AMD Athlons) are an example of this; their IA-32 architecture is an extension of the original Intel 8086 design which had a word size of 16 bits.

12)What is a register
ans:-In computer architecture, a processor register (or general purpose register) is a small amount of storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere. Typically, this specialized storage is not considered part of the normal memory range for the machine. Processor registers are at the top of the memory hierarchy, and provide the fastest way for a CPU to access data.

13) Why is the data bus bidirectional
ans:-Data bus is bi-directional bcoz same bus is used for data transmission from microprocessor
to memory location or input/output device and vice versa. thats y data bus is bi-directional
14. Give the features of 8085 microprocessor
ans:- 

  • » 8-bit microprocessor,» Up to 8 MHz,» 64 KB RAM,» Single voltage,» On-chip peripherals,» 256 I/O ports,
  • » 8080 object-code compatible,40-pin DIP,44-pin PLCC

15. Give the features of 8086 microprocessor
ans:-8086
16)What is a flag
ans:-Flag Registers:-
* The flag indicates the condition of the microprocessor as well as controls its operations. * A flag register is a flip-flop which indicates some conditions produced by the execution of an instruction or controls certain operations of the EU. A 16-bit flag register in the EU contains nine active flags. Two types of flags: Conditional or status flags: Six flags are conditional flags. They are set or reset by the EU on the basis of the results of some arithmetic operation.

  • » 16-bit microprocessor,» 16-bit data bus,» Up to 10 MHz,» 1 MB RAM,» 64K I/O ports,40-pin DIP,56-pin QFP,
44-pin PLCC

17)What is the function of the accumulator
ans:-An accumulator is an 8-bit register that is a part of ALU (Arithmatic-Logic Unit) of a processor. It is used for temporary storage of 8-bit data and to perform arithmatic
operations like addition, subtraction, multiplication, division or logical operations like AND, OR, XOR etc. The result of operation is stored in accumulator.

18) What is stack pointer
ans:-The CPU has an automatic program stack. At any given time, the SP holds the 16-bit address of the next free location in the stack. The stack acts like any other stack when there is a subroutine call or on an interrupt. ie. pushing the return address on a jump, and retrieving it after the operation is complete to come back to its original location. There are instructions that push and pull the A and B accumulators and the X and Y index registers. These instructions are often used to preserve program context.
19) What are the advantages of 8086 microprocessor over 8085
ans:-T
he Intel 8085 and 8086 microprocessors is that the 8085 is an 8-bit system and the 8086 is a 16-bit system. 
This difference allows the 8086 system to have a much larger set of operational instructions and can make calculations to more significant places. 

20)Define effective address
ans:-Effective address is the final address generated by offsetting and indexing which is sent to the virtual translation logic. It is the address of the operand in the virtual address space of the process, but not necessarily the address of the operand in the physical address space of the computer. 

21)How many segment registers are there in 8086
ans:-4 different types of segments in 8086
CS(Code Segment)to hold code area SS(Stack Segment)to run program DS(Data Segment)to hold data ES(Extra Segment)to hold large data

22)What are the registers present in internal architecture 8086
ans:-The 8086 had eight (more or less general) 16-bit registers including the stack pointer, but excluding the instruction pointer, flag register and segment registers. Four of them, AX, BX, CX, DX, could also be accessed as twice as many 8-bit registers (see figure) while the other four, BP, SI, DI, SP, were 16-bit only.

23)What are the advantages of overlapping segments
ans:-

24)What is PSW. Give its structure and explain
ans:-The current state of the processor is stored in a register called ProcessorStatus Word(PSW).The PSW contains bits which indicate such things as whether the previous arithmetic operations produced a positive,negative or zero result. If a subtract instruction is followed by a "branch on zero" instruction ,then the branch will be taken if the PSW indicates that the subtraction resulted in a zero. Most loops,such as DO-WHILE,FOR,etc involve incrementing or decrementing a counter and repeating the loop until the counter reaches the limit.Each time the counter is changed,the result is compared with the limit,the PSW is set accordingly,and branch is taken or not depending on the contents of the PSW. The 8086 microprocessor has a 16-bit PSW.


25. What is an instruction
ans:-An instruction is an order given to a computer processor by a computer program.At the lowest level, each instruction is a sequence of 0s and 1s that describes a physical operation the computer is to perform (such as "Add") and, depending on the particular instruction type, the specification of special storage areas called registers that may contain data to be used in carrying out the instruction, or the location in computer memory of data. 


The Microsoft Macro Assembler (MASM) is an x86 assembler for MS-DOS and Microsoft Windows. It supports a wide variety of macro facilities and structured programming idioms, including high-level functions for looping and procedures.
26. What are different types of instructions. Give examples
ans:-There are different instruction types:-
1)Data Movement:-examples:-{Load,Move,Push,Pop} (2)Logical Operations:-ex:-{And,Or,Xor,Not,Shl,Shr}
3)Arithmetic Operations:-ex:-{Add,Sub,Mulu*,Muls*,Divu*,Divs*} (4)Comparison:-ex:-{Cmp}
5)Flow Control:-ex:-{Bra,Bsr,Rts,Rti}  (6)Others:-ex:-{Nop}

27. What are addressing modes
ans:-1. Immediate addressing.2. Register addressing.3. Direct addressing.4. Indirect addressing.

28. Give the different type of data related addressing modes and explain with examples.
ans:-1}Immediate addressing
Load the immediate data into the register, R.
Example: MVI R,data
2)Register addressing
Data from source register is moved into destination register.
Example: MOV Rd, Rs
3)Direct addressing
Accepts data from external devices to be stored in the accumulator or sends the data from the accumulator to the external device.
Example: IN 00H or OUT 01H

29. What are the different types of branch related addressing modes
ans:-II. Branch Addressing Modes
1. Intrasegment Direct2. Intrasegment Indirect3. Intersegment Direct4. Intersegment Direct

30. Distinguish between packed BCD and unpacked BCD
ans:-Packed BCD numbers are stored two digits to a byte in 4 bit groups referred as nibbles
Ex:86 in unpacked BCD there is only one digit per byte Ex: 08, 06


31. Describe CBW and CWD instructions
ans:-The CBW and CWDE mnemonics reference the same opcode. The CBW instruction is intended for use when the operand-size attribute is 16 and the CWDE instruction for when the operand-size attribute is 32. The CWDE instruction is different from the CWD (convert word to double) instruction. The CWD instruction uses the DX:AX register pair as a destination operand; whereas, the CWDE instruction uses the EAX register as a destination.

32)Describe about MUL, IMUL, DIV, IDIV instructions
ans:-MUL (multiply) instruction is used for unsigned multiplication. This instruction multiplies bytes or words. 
IMUL (Integer multiply) instruction is used for signed multiplication. This instruction multiply bytes or words. 
The DIV instruction is to divide unsigned data. We can divide a byte by byte, a word by byte, double word by word.
The IDIV instruction is to divide signed data. We can divide a byte by byte, a word by byte, double word by word and the operations are just like DIV instructions 

33)Describe about LOOP instructions
ans:-The LOOP instruction is a combination of a decrement of CX and a conditional jump. In the 8086, LOOP decrements CX and if CX is not equal to zero, it jumps to the address indicated by the label. If CX becomes a 0, the next sequential instruction executes.

34)Give examples of conditional branch instructions
ans:-In a loop if there are different jump instructions with a condition or counter called conditional loop and instructions in that loop are called unconditional branch instructions.

35)Give examples of unconditional branch instructions
ans:-In a loop if there are different jump instructions with no condition it is called unconditional loop and instructions in that loop are called unconditional branch instructions.

36)What are flag manipulation instructions ? Give examples
ans:-Flag manipulation instructions. STC, CLC, CMC. Set, clear, complement carry flag. STD, CLD. Set, clear direction flag

37)Explain about DAA instruction
ans:-decimal adjust addition result
daa
The daa instruction is used to adjust the content of the AL register after that register is used to perform the addition of two packed BCDs. The CPU uses the following logic:

CF_old = CF
IF (al AND 0Fh > 9) or (the Auxilliary Flag is set)
al = al+6
CF = CF or CF_old
AF set
ENDIF
IF (al > 99h) or (Carry Flag is set)
al = al + 60h
CF set
ENDIF

38)Explain shift and rotate instructions
ans:-SHL(SHIFT LEFT):-shifting bit code by no.of bits to left{ex:-00001011 when shifted left by one bit it becomes 00010110},SHR(SHIFT RIGHT):-shifting bit code by no.of bits to right{ex:-00001011 when shifted left by one bit it becomes 00000101}
ROR(ROTATE RIGHT):-rotate bit code from right to left{ex:-00001011 when rotated right by one bit it becomes as 00010110}ROL{ROTATE LEFT}:-rotate bit code from left to right{ex:-00001011 when rotated left by one bit it becomes as 10000101}RCL{ROTATE CARRY TO LEFT};RCR{ROTATE CARRY TO RIGHT}

39. What are directives.
ans:-Assembler directives are instructions to the assembler concerning the program being assembled.

41. Define assembly process
ans:-A microprocessor executes a collection of machine instructions that tell the processor what to do is known as assembly process.

42. Define two pass assembler
ans:-A two pass assembler does two passes over the source file ( the second pass can be over a file generated in the first pass ). In the first pass all it does is looks for label definitions and introduces them in the symbol table. In the second pass, after the symbol table is complete, it does the actual assembly by translating the operations and so on.

43. What are the advantages of modular programming
ans:-Modular programming can be used to break up a large program into manageable units, or to create code that can be easily re-used. Reduce problem to smaller, simpler, humanly comprehensible problems

44. What is linking and relocation
ans:- A linker is a program used to join together several object files into one large object file. The linker produces a link file which contains the binary codes for all the combined modules. It also produces a link map which contains the address information about the link files. The linker does not assign absolute addresses but only relative address starting from zero, so the programs are relocatable & can be put anywhere in memory to be run.

45. What is a stack
ans:-A stack is a last in, first out (LIFO) abstract data type and data structure. A stack can have any abstract data type as an element, but is characterized by only two fundamental operations: push and pop.

46. What are stack operated instructions. Explain
ans:-The generic use of stack is for, Return address return value ,parameters to called function, local variables in the called function, processor registers that will be reused in the called function.

47. Define Procedure
ans:-Procedures are a group of instructions stored as a separate program in memory and it is called from the main program whenever required. The type of procedure depends on where the procedures are stored in memory. If it is in the same code segment as that of the main program then it is a near procedure otherwise it is a far procedure.

48. Explain about CALL and RETURN instructions
ans:-CALL 16-bit memory address of a subroutine
It is a 3-byte instruction that transfers the program sequence to a subroutine
Saves the content of the PC (Program Counter-16-bit register) , the address of the next instruction , on the stack. Decrements the stack pointer register by 2. Jumps unconditionally to the memory location specified by the 2nd and 3rd bytes. This instruction is accompanied by a 

RETURN instruction in the subroutine.The return instruction is used either to return a function value or to terminate the execution of a function. The exit may be from anywhere within the function body, including loops or nested blocks. If the function returns a value, the return instruction is required

49. What is recursive procedure
ans:-A recursive procedure is a procedure, which calls itself. Recursive procedures are used to work with complex data structures called trees. If the procedure is called with N=3, then the N is decremented by 1 after each procedure CALL and the procedure is called until N=0.

50. What is an interrupt. Explain
ans:-An interrupt is a condition that causes the microprocessor to temporarily work on a different task, and then later return to its previous task. Interrupts can be internal or external. Internal interrupts, or "software interrupts," are triggered by a software instruction and operate similarly to a jump or branch instruction
Turbo Assembler (TASM) is an x86 assembler package developed by Borland. It is used with Borland's high-level language compilers, such as Turbo Pascal, Turbo Basic and Turbo C.

No comments:

Post a Comment