MCS-012 SOLVED ASSIGNMENT, BCA, MCA, 2014-15

Course Code : MCS-012
Course Title : Computer Organisation and Assembly
Language Programming
Assignment Number : MCA(1)/012/Assign/2014-15
Maximum Marks : 100
Weightage : 25%
Last Dates for Submission : 15th October, 2014 (For July 2014 Session)
15th April, 2015 (For January 2015 Session)
There are four questions in this assignment, which carries 80 marks. Rest 20 marks are for viva voce. You may use illustrations and diagrams to enhance the explanations. Please go through the guidelines regarding assignments given in the Programme Guide for the format of presentation. Answer to each part of the question should be confined to about 300 words.
Question 1 (Covers Block 1)
(a) Perform the following arithmetic operations using binary signed 2‟s complement notation for integers. You may assume that the maximum size of integers is of 9 bits including the sign bit. (Please note that the numbers given here are in decimal notation).
i) Add – 256 and 206
ii) Subtract 224 from –99
iii) Add 124 and 132
Please indicate the overflow if it occurs. Also write how you identify overflow.
(b) Convert the hexadecimal number: ( ABCD01)h into equivalent binary, octal and decimal.
(c) Convert the following string into equivalent “UTF 8” code – “DNS uses domains like .com, .au etc.”. Are these UTF 8 codes same as that used in ASCII?
(d) Use a Karnaugh’s map to design a odd parity generator circuit for 4 input bits.
(e ) An 8 bit data 10110011 after transmission is received as 10010011. Explain how SEC code will detect and correct this problem.
(f) Design a two-bit counter (a sequential circuit) that counts from 00 to 11. You should show the state table, state diagram, the k-map for circuit design and logic diagram of the resultant design using D flipflop.
(g) Explain the single precision floating point single IEEE 754 representation. Represent the number (63.125) 10 using IEEE 754 single precision and double precision representations.
Question 2 (Covers Block 2)
(a) What is the need of DMA, even though computer have Interrupt Driven I/O mechanism? How is DMA different to I/O processors? Explain with the help of a diagram. Suggest which I/O technique will be used for each of the following situation. Give justification in support of your answer.
(i) Data input by a user during execution of a program.
(ii) Input of a stream of data over a data Communication line over a network.
(b) How are tracks and sectors organised on a magnetic disk? How does the organisation of sectors on magnetic disk differ from CD ROM? Explain with the help of diagram. What is rotational latency in the context of disk access time? Assume that the disk rotates at 6000 rpm; each track of the disk has 16 sectors; data transfer rate of the disk is 64 MB/second; and average seek time of disk is10 millisecond. Calculate the average access time for the disk. (2 Marks)
(c) What is the need of interfaces like SCSI and IDE in a computer system? Assume that you are purchasing a computer with high-end graphics capability, which of the two interfaces would you use for such computer? Justify your answer.
(d) Define each of the following terms. Explain the main purpose / use / advantage.
(Word Limit for answer of each part is 50 words ONLY).
(i) Refresh Rate in the context of displays
(ii) Liquid crystal displays
(iii) Scan codes in the context of keyboard
(iv) Graphic Accelerators
(v) Classification of printers
(vi) SMPS
Question 3 (Covers Block 3)
(a) Assume that a new machine has been developed. This machine has 64 general purpose registers of 64 bits each. Out of these 64 registers, 32 registers are used as stack for subroutine calls. The machine has 1 GB main memory with memory word size of 64 bits. The Instructions of this machine is only one memory word. An instruction of the machine consists of opcode – 6 bits, addressing mode specification – 2 bits and remaining bits for specifying the operand addresses. An ADD instruction on this machine has a fixed opcode 110011. The four possible addressing modes for the ADD instruction are coded using the 2 bit addressing mode field. Each ADD instruction involves three operands with at least one of the operand as register operand. Design four ADD instructions, involving at least four different types of addressing modes. Give justification of the selection of every addressing mode.
(b) Compare and contrast the operations of Wilkes control Unit to that of Micro-programmed control Unit.
(c) What is the need of Instruction pipelining? Explain the instruction pipeline with the help of a diagram. Explain the problems of using instruction pipelining.
Question 4 (Covers Block 4)
(a) Write a program in 8086 assembly Language (with proper comments) to count the number of those alphabets that are same as well as are at the same position in two different strings. For example, in case the strings are: “ABCDEFGHIJ” and “BDCDABCDEF”, this count is 2, as the 3rd and 4th positions in both the strings contains C and D, respectively. You may assume that both the strings are available in the memory and are of length 10. Make suitable assumptions, if any.
Solution:
DATA SEGMENT
STR1 DB “ABCDEFGHIJ”
STR2 DB “BDCDABCDEF”
CNT DB 0H
MSG1 DB 10,13,’FISRT STRING IN MEMORY IS : $’
MSG2 DB 10,13,’SECOND STRING IN MEMORY IS : $’
MSG3 DB 10,13,’COUNT OF SAME POSITION EQUAL CHAR(S) IS : $’
DATA ENDS
DISPLAY MACRO MSG
MOV AH,9
LEA DX,MSG
INT 21H
ENDM
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
DISPLAY MSG1
DISPLAY STR1
DISPLAY MSG2
DISPLAY STR2
LEA SI,STR1
LEA DI,STR2
MOV CX,10
CHECK:
MOV AL,[SI]
CMP [DI],AL
JNE NOTEQU
INC CNT
NOTEQU: INC SI
INC DI
LOOP CHECK
DISPLAY MSG3
MOV DL,CNT
ADD DL,30H
MOV AH,2
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START
Output:
q4.1
(b) Write a program in 8086 assembly language to convert a four digit packed BCD number into equivalent ASCII digits. The packed BCD number may be assumed to be stored in memory. Your program should print the four ASCII digits.
Solution:
DATA SEGMENT
BCD DW 1234H
ASCII DB 5 DUP (‘$’)
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV AX,BCD
MOV BH,AH
MOV BL,AL
AND AH,0F0H
AND BH,0FH
AND AL,0F0H
AND BL,0FH
MOV CL,04H
ROL AH,CL
MOV CL,04H
ROL AL,CL
ADD AX,3030H
ADD BX,3030H
LEA SI,ASCII
MOV [SI],AH
INC SI
MOV [SI],BH
INC SI
MOV [SI],AL
INC SI
MOV [SI],BL
INC SI
LEA DX,ASCII
MOV AH,9
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START
Output:
q4.2




(c) Write a simple near procedure in 8086 assembly language that receives one 16 bit number as parameter value on the stack from the main module. It returns 0 if the upper byte of the number is 0, else returns 1. Make suitable assumptions, if any.
Solution:
DATA SEGMENT
MSG DB “BIT RETURNED IS : $”
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV BX,0FFFH
LEA DX,MSG
MOV AH,9
INT 21H
PUSH BX
CALL CHECK
ADD DL,30H
MOV AH,2
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
CHECK PROC NEAR
POP AX
POP BX
AND BH,11110000B
MOV CL,4
ROL BH,CL
CMP BH,0
JE SKIP
MOV DL,1
JMP DONE
SKIP:
MOV DL,0
DONE:
PUSH AX
RET
CHECK ENDP
END START
Output:

q4.3
Share on Google Plus

About Unknown

typing......
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment