MBSD Assignment
MBSD Assignment
2012-CE-046
Submitted By: Owais Khan Roll No.: 2012-CE-046 Section: A Submitted To: Prof. Misbah Miss Kanza Miss Madiha
Page 1
Assignment #2 Q1) Draw the block diagram of three bus architecture and label each block of it. Ans: Following is a figure showing Three Bus Architecture:
2012-CE-046
Q2)What are the advantages of having wider address and data bus? Give examples of each bus. Ans: Data Bus: Advantage of a wider data bus is the speed in application that uses wide data.let as take an example of a 32-bit number stored in memory, it will takes the 8088 multiprocessor four transfer operations to complete because its data bus is only 8 bit wide. Eg: Greater the data bus, greater would be the would be the transfer of data. If its 32 bit wide then a 32 bit data can travel through it.
Address Bus: The number of lines on the bus determines the number of addresses on the memory. So greater the number of lines, greater would be the addresses in the memory. Eg: A 32 bit bus can represent 232 unique addresses which would result in 4.29x109 addresses in the memory.
Page 2
2012-CE-046
Ans: Yes, the data bus is bidirectional because it is used in both the directions. It fetch the data from memory or input devices for processing and after the processing take places, it stores the back to memory.
Q4)What is the function of EU and BIU of a microprocessor? Also list the registers of 8086 Ans: EU (Execution Unit): The Execution unit of 8086 tells the BIU where to fetch instructions of data from, decodes instructions, and executes instructions. BIU (Bus Interface Unit): The BIU sends out addresses, fetches instructions from memory, read data from ports and memory, and writes data a ports and memory. In other words the BIU handles all transfer of data and addresses on the buses for the execution unit.
In Real Mode 16-Bit CPU can access only 1MB memory whereas Protected Mode allows to access more than 1 MB memory. Real Mode can perform only one task at a time while Protected Mode performs multiple task at a time makin it multitasking. In Real Mode the pentium4 operates as a very high performance 8086 whereas some system control instrution are only valid in the Protected Mode.
Q6)Differentiate between register, immediate, direct and indirect addressing mode Ans: Register Addressing: The Register Addressing mode takes place when the operands (between which operation is performed) are Registers it self. It Is to be kept in mind that the operation can talke place only when bits of both the operands are same. Eg: MOV AL, BL MOV AX,BX Immediate Addressing: The Immediate Addressing mode takes place when any values is directly moved to register. Eg: MOV DL, 34
Page 3
Assignment #2
2012-CE-046
Direct Addressing: Direct addressing mode means that the value for a given instruction in assembly programming is pointed to by a given value. This means the value is variable, based on what is stored in memory at a given address Eg: MOV DX,[4802H] ;which means that whatever value is stored in the address 4802, it should be moved in DX register. Indirect Addressing: Indirect addressing mode means the operand address is contained in a register Eg: MOV DL,[AX] ;which means that the content of the address (content of AX) should be moved to DL.
Q7) Suppose memory bytes 0-4 have the following contents Address Contents 0 01101010 1 11011101 2 00010001 3 11111111 4 01010101 Assume that a word is 2 bytes what are the contents (Hex) -the word of memory of address 2? -the word of memory of address 3?
Ans:
The word memory of address 2 in HEX is 11H The word memory of address 3 in HEX is FFH
Q8) Convert FAE2CH into binary and decimal system Ans: To BINARY: F 1111 A 1010 E 1110 2 0010 C 1100 ---------------------------1111 1010 1110 0010 1100 To DECIMAL: (FAE2CH)16 = (?)10 Fx164 + Ax163 + 983040 + 40960 + =(1027628)10
Ex162 3584
+ +
2x161 + 32 +
Cx160 12
Page 4
Assignment #2 Q9) Add FEFFEh to FBCADh Ans: FEFFEh = FBCADh = Addition: 1111 1110 1111 1111 1110 1111 1011 1100 1010 1101
2012-CE-046
After converting to HEX it becomes 1FACABh Q10) What is the maximum un-signed integer of a 16-bit register? Ans: The maximum unsigned integer of a 16 bit register represent value upto (216 -1) =65535.
Q11)Determine the physical address of a memory location given by 0A51h:CD90h. Ans: CS = 0A51h EA = CD90h As we know that: PA = CSx10 + EA If we want to determine the physical address of memory we first need to put a zero at the end of the value of CS. Now CS becomes 0A510 Converting these both into binary: CS = 0A510h = 0000 1010 0101 0001 0000 EA = CD90h = 1100 1101 1001 0000 Addition:
Page 5
Assignment #2
2012-CE-046
Q12) What is the size DB, DW, DD, DQ and DT? Ans: DB DW DD DQ DT
allocates 1 bytes (8-bits) allocates 2 bytes (16-bits) allocates 4 bytes (32-bits) allocates 8 bytes (64-bits) allocates 10 bytes (80-bits)
Q13)How the multiple definition is implemented in assembly give example of it. Ans: There are two ways of printing HELLO
DB H DB E DB L DB L DB O
Another Way of printing the same string: Message DB H,E,L,L,O Q14) Draw symbol table of following data segment. .data Char1 db 1 Value dw ? Message db Hello$ Myvalue dd ? Ans: NAME Char1 Value Message Myvalue 0 1 3 9 OFFSET
Page 6
Assignment #2
2012-CE-046
MOV BX, XD
ADD X, Y ; X,Y Memory locations
VALID (only if XD is a variable containing some value) NOT VALID NOT VALID VALID VALID NOT VALID VALID NOT VALID NOT VALID VALID
MOV AX, AH ADD [BX], BX SUB BL, BH XLAT Table CMP [SI], SI DEC SI,1 CMP [SI] , [DI] TEST [DI],SI
Page 7